Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template to v0.3.1 #12

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "c21b82bf134f3a0f13db7482d4fb04ca1f562d59",
"checkout": "main",
"commit": "586b1652162ff7994b0070a034023d64289ae416",
"checkout": "v0.3.1",
"context": {
"cookiecutter": {
"project_name": "scib-metrics",
Expand All @@ -13,9 +13,15 @@
"project_repo": "https://github.com/yoseflab/scib-metrics",
"license": "BSD 3-Clause License",
"_copy_without_render": [
".github/workflows/**.yaml",
".github/workflows/build.yaml",
".github/workflows/test.yaml",
"docs/_templates/autosummary/**.rst"
],
"_render_devdocs": false,
"_jinja2_env_vars": {
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse"
}
},
Expand Down
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2

[.cruft.json]
indent_size = 2

[Makefile]
indent_style = tab
102 changes: 58 additions & 44 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,67 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 5 1,15 * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0} # -e to fail on error

strategy:
fail-fast: false
matrix:
python: ["3.8", "3.10"]
os: [ubuntu-latest]
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0} # -e to fail on error

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.9"
- os: ubuntu-latest
python: "3.11"
- os: ubuntu-latest
python: "3.11"
pip-flags: "--pre"
name: PRE-RELEASE DEPENDENCIES

name: ${{ matrix.name }} Python ${{ matrix.python }}

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install ${{ matrix.pip-flags }} ".[dev,test]"
- name: Test
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install ".[dev,test]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
uses: codecov/codecov-action@v3
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
coverage run -m pytest -v --color=yes
- name: Report coverage
run: |
coverage report
- name: Upload coverage
uses: codecov/codecov-action@v3
89 changes: 89 additions & 0 deletions .pre-commit-config.yaml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks)
@@ -1,50 +1,42 @@
fail_fast: false
default_language_version:
- python: python3
+ python: python3
default_stages:
- - commit
- - push
+ - commit
+ - push
minimum_pre_commit_version: 2.16.0
repos:
- - repo: https://github.com/psf/black
- rev: "24.2.0"
- hooks:
- - id: black
- - repo: https://github.com/asottile/blacken-docs
- rev: 1.16.0
- hooks:
- - id: blacken-docs
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: v4.0.0-alpha.8
- hooks:
- - id: prettier
- # Newer versions of node don't work on systems that have an older version of GLIBC
- # (in particular Ubuntu 18.04 and Centos 7)
- # EOL of Centos 7 is in 2024-06, we can probably get rid of this then.
- # See https://github.com/scverse/cookiecutter-scverse/issues/143 and
- # https://github.com/jupyterlab/jupyterlab/issues/12675
- language_version: "17.9.1"
- - repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.2.2
- hooks:
- - id: ruff
- args: [--fix, --exit-non-zero-on-fix]
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.5.0
- hooks:
- - id: detect-private-key
- - id: check-ast
- - id: end-of-file-fixer
- - id: mixed-line-ending
- args: [--fix=lf]
- - id: trailing-whitespace
- - id: check-case-conflict
- - repo: local
- hooks:
- - id: forbid-to-commit
- name: Don't commit rej files
- entry: |
- Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
- Fix the merge conflicts manually and remove the .rej files.
- language: fail
- files: '.*\.rej$'
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: v4.0.0-alpha.8
+ hooks:
+ - id: prettier
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.2.2
+ hooks:
+ - id: ruff
+ types_or: [python, pyi, jupyter]
+ args: [--fix, --exit-non-zero-on-fix]
+ - id: ruff-format
+ types_or: [python, pyi, jupyter]
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.5.0
+ hooks:
+ - id: detect-private-key
+ - id: check-ast
+ - id: end-of-file-fixer
+ - id: mixed-line-ending
+ args: [--fix=lf]
+ - id: trailing-whitespace
+ - id: check-case-conflict
+ # Check that there are no merge conflicts (could be generated by template sync)
+ - id: check-merge-conflict
+ args: [--assume-in-merge]
+ - repo: local
+ hooks:
+ - id: forbid-to-commit
+ name: Don't commit rej files
+ entry: |
+ Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
+ Fix the merge conflicts manually and remove the .rej files.
+ language: fail
+ files: '.*\.rej$'
19 changes: 19 additions & 0 deletions README.md.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff a/README.md b/README.md (rejected hunks)
@@ -17,7 +17,7 @@ Please refer to the [documentation][link-docs]. In particular, the

## Installation

-You need to have Python 3.8 or newer installed on your system. If you don't have
+You need to have Python 3.9 or newer installed on your system. If you don't have
Python installed, we recommend installing [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge).

There are several alternative options to install scib-metrics:
@@ -33,7 +33,7 @@ pip install scib-metrics
1. Install the latest development version:

```bash
-pip install git+https://github.com/adamgayoso/scib-metrics.git@main
+pip install git+https://github.com/yoseflab/scib-metrics.git@main
```

## Release notes
4 changes: 4 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Reduce the font size in data frames - See https://github.com/scverse/cookiecutter-scverse/issues/193 */
div.cell_output table.dataframe {
font-size: 0.8em;
}
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"sphinx_autodoc_typehints",
"sphinx.ext.mathjax",
"IPython.sphinxext.ipython_console_highlighting",
"sphinxext.opengraph",
*[p.stem for p in (HERE / "extensions").glob("*.py")],
]

Expand Down
36 changes: 36 additions & 0 deletions docs/conf.py.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff a/docs/conf.py b/docs/conf.py (rejected hunks)
@@ -108,12 +109,15 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]
#
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
+html_css_files = ["css/custom.css"]
+
html_title = project_name

html_theme_options = {
"repository_url": repository_url,
"use_repository_button": True,
"path_to_docs": "docs/",
+ "navigation_with_keys": False,
}

pygments_style = "default"
@@ -123,18 +127,3 @@ nitpick_ignore = [
# you can add an exception to this list.
# ("py:class", "igraph.Graph"),
]
-
-
-def setup(app):
- """App setup hook."""
- app.add_config_value(
- "recommonmark_config",
- {
- "auto_toc_tree_section": "Contents",
- "enable_auto_toc_tree": True,
- "enable_math": True,
- "enable_inline_math": False,
- "enable_eval_rst": True,
- },
- True,
- )
9 changes: 9 additions & 0 deletions docs/index.md.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff a/docs/index.md b/docs/index.md (rejected hunks)
@@ -8,7 +8,6 @@

api.md
changelog.md
-template_usage.md
contributing.md
references.md

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ select = [
"RUF100", # Report unused noqa directives
]
ignore = [
# line too long -> we accept long comment lines; black gets rid of long code lines
# line too long -> we accept long comment lines; formatter gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
Expand Down Expand Up @@ -156,5 +156,5 @@ skip = [
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb"
"docs/notebooks/example.ipynb",
]
Loading