From f6cd64fcc9e718138791856e7f1d38d7d53bae67 Mon Sep 17 00:00:00 2001 From: scverse-bot Date: Tue, 28 Nov 2023 16:47:09 +0000 Subject: [PATCH 1/4] Update template to v0.3.0 --- .cruft.json | 9 ++++- .github/workflows/release.yaml | 39 +++++++++---------- .github/workflows/test.yaml | 12 ++++-- README.md.rej | 10 +++++ docs/_static/css/custom.css | 4 ++ docs/conf.py.rej | 36 +++++++++++++++++ docs/contributing.md | 18 +++++++-- docs/contributing.md.rej | 71 ++++++++++++++++++++++++++++++++++ docs/index.md.rej | 9 +++++ pyproject.toml.rej | 22 +++++++++++ 10 files changed, 201 insertions(+), 29 deletions(-) create mode 100644 README.md.rej create mode 100644 docs/_static/css/custom.css create mode 100644 docs/conf.py.rej create mode 100644 docs/contributing.md.rej create mode 100644 docs/index.md.rej create mode 100644 pyproject.toml.rej diff --git a/.cruft.json b/.cruft.json index 6faa97e7e..99c1947a1 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,7 +1,7 @@ { "template": "https://github.com/scverse/cookiecutter-scverse", - "commit": "605f95714130c960bce12eab98a4e023e8932249", - "checkout": "v0.2.22", + "commit": "8e96abb5c3e2d5078c44713958da672711cf2a48", + "checkout": "v0.3.0", "context": { "cookiecutter": { "project_name": "scirpy", @@ -16,6 +16,11 @@ ".github/workflows/**.yaml", "docs/_templates/autosummary/**.rst" ], + "_render_devdocs": false, + "_jinja2_env_vars": { + "lstrip_blocks": true, + "trim_blocks": true + }, "_template": "https://github.com/scverse/cookiecutter-scverse" } }, diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9352d045e..bd82eb55b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,30 +1,29 @@ name: Release on: - push: - tags: - - "*.*.*" + release: + types: [published] +# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/ jobs: release: - name: Release + name: Upload release to PyPI runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/{{ cookiecutter.package_name }} + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Python 3.10 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 with: - python-version: "3.10" - - - name: Install hatch - run: pip install hatch - - - name: Build project for distribution - run: hatch build - - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + filter: blob:none + fetch-depth: 0 + - uses: actions/setup-python@v4 with: - password: ${{ secrets.PYPI_API_TOKEN }} + python-version: "3.x" + cache: "pip" + - run: pip install build + - run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index edab0b486..0230ee0ac 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,10 +26,13 @@ jobs: - os: ubuntu-latest python: "3.9" - os: ubuntu-latest - python: "3.10" + python: "3.11" - os: ubuntu-latest - python: "3.10" + python: "3.11" pip-flags: "--pre" + name: PRE-RELEASE DEPENDENCIES + + name: ${{ matrix.name }} Python ${{ matrix.python }} env: OS: ${{ matrix.os }} @@ -59,6 +62,9 @@ jobs: PLATFORM: ${{ matrix.os }} DISPLAY: :42 run: | - pytest -v --cov --color=yes + coverage run -m pytest -v --color=yes + - name: Report coverage + run: | + coverage report - name: Upload coverage uses: codecov/codecov-action@v3 diff --git a/README.md.rej b/README.md.rej new file mode 100644 index 000000000..c4cc60434 --- /dev/null +++ b/README.md.rej @@ -0,0 +1,10 @@ +diff a/README.md b/README.md (rejected hunks) +@@ -33,7 +33,7 @@ pip install scirpy + 1. Install the latest development version: + + ```bash +-pip install git+https://github.com/grst/scirpy.git@main ++pip install git+https://github.com/scverse/scirpy.git@main + ``` + + ## Release notes diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css new file mode 100644 index 000000000..b8c8d47fa --- /dev/null +++ b/docs/_static/css/custom.css @@ -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; +} diff --git a/docs/conf.py.rej b/docs/conf.py.rej new file mode 100644 index 000000000..0e94204f4 --- /dev/null +++ b/docs/conf.py.rej @@ -0,0 +1,36 @@ +diff a/docs/conf.py b/docs/conf.py (rejected hunks) +@@ -109,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" +@@ -124,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, +- ) diff --git a/docs/contributing.md b/docs/contributing.md index 66a115c3b..541f674e8 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,6 +1,6 @@ # Contributing guide -Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this repo, too. +Scanpy provides extensive [developer documentation][scanpy developer guide], most of which applies to this project, too. This document will not reproduce the entire content from there. Instead, it aims at summarizing the most important information to get you started on contributing. @@ -42,10 +42,10 @@ git pull --rebase to integrate the changes into yours. While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage. -Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [black][black-editors] +Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors] and [prettier][prettier-editors]. -[black-editors]: https://black.readthedocs.io/en/stable/integrations/editors.html +[ruff-editors]: https://docs.astral.sh/ruff/integrations/ [prettier-editors]: https://prettier.io/docs/en/editors.html ## Writing tests @@ -64,7 +64,17 @@ command line by executing pytest ``` -in the root of the repository. Continuous integration will automatically run the tests on all pull requests. +in the root of the repository. + +### Continuous integration + +Continuous integration will automatically run the tests on all pull requests and test +against the minimum and maximum supported Python version. + +Additionally, there's a CI job that tests against pre-releases of all dependencies +(if there are any). The purpose of this check is to detect incompatibilities +of new package versions early on and gives you time to fix the issue or reach +out to the developers of the dependency before the package is released to a wider audience. [scanpy-test-docs]: https://scanpy.readthedocs.io/en/latest/dev/testing.html#writing-tests diff --git a/docs/contributing.md.rej b/docs/contributing.md.rej new file mode 100644 index 000000000..a2fc4ca13 --- /dev/null +++ b/docs/contributing.md.rej @@ -0,0 +1,71 @@ +diff a/docs/contributing.md b/docs/contributing.md (rejected hunks) +@@ -19,9 +19,8 @@ pip install -e ".[dev,test,doc]" + + ## Code-style + +-This template uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either +-automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for +-a full list of checks enabled for this repository. ++This package uses [pre-commit][] to enforce consistent code-styles. ++On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message. + + To enable pre-commit locally, simply run + +@@ -83,55 +92,8 @@ Before making a release, you need to update the version number in the `pyproject + > + > Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. + +-Once you are done, run +- +-``` +-git push --tags +-``` +- +-to publish the created tag on GitHub. Alternatively, it is possible to create a tag through the Github web interface. For more information, see [managing Github releases][]. This will automatically trigger a Github workflow that creates a release on PyPI. +- +-### The release Github workflow +- +-#### Behind the scenes +- +-This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section. +-Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run +- +-```bash +-python -m build +-``` +- +-This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository. +- +-Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running: +- +-```bash +-twine check dist/* +-``` +- +-and finally publishing it with: +- +-```bash +-twine upload dist/* +-``` +- +-Provide your username and password when requested and then go check out your package on [PyPI][]! +- +-For more information, follow the [Python packaging tutorial][]. +- +-#### Configuring the Github workflow +- +-Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][]. +-For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token. +-See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token. +-Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][]. +- +-[creating github secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets +-[creating pypi tokens]: https://pypi.org/help/#apitoken +-[managing github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository +-[python packaging tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives +-[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88 ++Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub. ++Specify `vX.X.X` as a tag name and create a release. For more information, see [managing Github releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI. + + ## Writing documentation + diff --git a/docs/index.md.rej b/docs/index.md.rej new file mode 100644 index 000000000..14a8d31fa --- /dev/null +++ b/docs/index.md.rej @@ -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 + diff --git a/pyproject.toml.rej b/pyproject.toml.rej new file mode 100644 index 000000000..2b3a64ba6 --- /dev/null +++ b/pyproject.toml.rej @@ -0,0 +1,22 @@ +diff a/pyproject.toml b/pyproject.toml (rejected hunks) +@@ -26,7 +26,6 @@ dependencies = [ + + [project.optional-dependencies] + dev = [ +- # CLI for bumping the version number + "pre-commit", + "twine>=4.0.2" + ] +@@ -42,10 +41,11 @@ doc = [ + "ipykernel", + "ipython", + "sphinx-copybutton", ++ "pandas", + ] + test = [ + "pytest", +- "pytest-cov", ++ "coverage", + ] + + [tool.coverage.run] From f04e06e1e6f045d2665768264e410599804a2d03 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:47:37 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md.rej | 4 ++-- docs/conf.py.rej | 4 ++-- docs/contributing.md.rej | 14 +++++++------- docs/index.md.rej | 4 ++-- pyproject.toml.rej | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md.rej b/README.md.rej index c4cc60434..82d66f501 100644 --- a/README.md.rej +++ b/README.md.rej @@ -1,10 +1,10 @@ diff a/README.md b/README.md (rejected hunks) @@ -33,7 +33,7 @@ pip install scirpy 1. Install the latest development version: - + ```bash -pip install git+https://github.com/grst/scirpy.git@main +pip install git+https://github.com/scverse/scirpy.git@main ``` - + ## Release notes diff --git a/docs/conf.py.rej b/docs/conf.py.rej index 0e94204f4..d060fbf9b 100644 --- a/docs/conf.py.rej +++ b/docs/conf.py.rej @@ -6,14 +6,14 @@ diff a/docs/conf.py b/docs/conf.py (rejected hunks) +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" @@ -124,18 +127,3 @@ nitpick_ignore = [ # you can add an exception to this list. diff --git a/docs/contributing.md.rej b/docs/contributing.md.rej index a2fc4ca13..10dfcb720 100644 --- a/docs/contributing.md.rej +++ b/docs/contributing.md.rej @@ -1,20 +1,20 @@ diff a/docs/contributing.md b/docs/contributing.md (rejected hunks) @@ -19,9 +19,8 @@ pip install -e ".[dev,test,doc]" - + ## Code-style - + -This template uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either -automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for -a full list of checks enabled for this repository. +This package uses [pre-commit][] to enforce consistent code-styles. +On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message. - + To enable pre-commit locally, simply run - + @@ -83,55 +92,8 @@ Before making a release, you need to update the version number in the `pyproject > > Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. - + -Once you are done, run - -``` @@ -66,6 +66,6 @@ diff a/docs/contributing.md b/docs/contributing.md (rejected hunks) -[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88 +Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub. +Specify `vX.X.X` as a tag name and create a release. For more information, see [managing Github releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI. - + ## Writing documentation - + diff --git a/docs/index.md.rej b/docs/index.md.rej index 14a8d31fa..922185b90 100644 --- a/docs/index.md.rej +++ b/docs/index.md.rej @@ -1,9 +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 - + diff --git a/pyproject.toml.rej b/pyproject.toml.rej index 2b3a64ba6..39e6e336a 100644 --- a/pyproject.toml.rej +++ b/pyproject.toml.rej @@ -1,6 +1,6 @@ diff a/pyproject.toml b/pyproject.toml (rejected hunks) @@ -26,7 +26,6 @@ dependencies = [ - + [project.optional-dependencies] dev = [ - # CLI for bumping the version number @@ -18,5 +18,5 @@ diff a/pyproject.toml b/pyproject.toml (rejected hunks) - "pytest-cov", + "coverage", ] - + [tool.coverage.run] From 3202e16266032e36fe86fadf8f6a2230126d12ec Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Thu, 28 Dec 2023 20:58:13 +0100 Subject: [PATCH 3/4] Fix merge conflicts --- README.md | 6 ++-- README.md.rej | 10 ------ docs/conf.py | 16 +-------- docs/conf.py.rej | 36 -------------------- docs/contributing.md | 67 +++---------------------------------- docs/contributing.md.rej | 71 ---------------------------------------- docs/index.md.rej | 9 ----- pyproject.toml | 2 +- pyproject.toml.rej | 22 ------------- 9 files changed, 10 insertions(+), 229 deletions(-) delete mode 100644 README.md.rej delete mode 100644 docs/conf.py.rej delete mode 100644 docs/contributing.md.rej delete mode 100644 docs/index.md.rej delete mode 100644 pyproject.toml.rej diff --git a/README.md b/README.md index 9e1b60f1f..88de01ae9 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Please consider making a tax-deductible [donation](https://numfocus.org/donate-t > -[badge-tests]: https://img.shields.io/github/actions/workflow/status/grst/scirpy/test.yaml?branch=main +[badge-tests]: https://img.shields.io/github/actions/workflow/status/scverse/scirpy/test.yaml?branch=main [link-tests]: https://github.com/scverse/scirpy/actions/workflows/test.yml [badge-docs]: https://img.shields.io/readthedocs/scirpy [badge-pypi]: https://img.shields.io/pypi/v/scirpy?logo=PyPI @@ -69,7 +69,7 @@ There are several alternative options to install scirpy: 3. Install the latest development version: ```bash - pip install git+https://github.com/grst/scirpy.git@main + pip install git+https://github.com/scverse/scirpy.git@main ``` 4. Run it in a container using [Docker][] or [Podman][]: @@ -123,7 +123,7 @@ You can cite the scverse publication as follows: > [10.1038/s41587-023-01733-8](https://doi.org/10.1038/s41587-023-01733-8). [scverse-discourse]: https://discourse.scverse.org/ -[issue-tracker]: https://github.com/grst/scirpy/issues +[issue-tracker]: https://github.com/scverse/scirpy/issues [changelog]: https://scirpy.readthedocs.io/latest/changelog.html [link-docs]: https://scirpy.readthedocs.io [link-api]: https://scirpy.readthedocs.io/latest/api.html diff --git a/README.md.rej b/README.md.rej deleted file mode 100644 index 82d66f501..000000000 --- a/README.md.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/README.md b/README.md (rejected hunks) -@@ -33,7 +33,7 @@ pip install scirpy - 1. Install the latest development version: - - ```bash --pip install git+https://github.com/grst/scirpy.git@main -+pip install git+https://github.com/scverse/scirpy.git@main - ``` - - ## Release notes diff --git a/docs/conf.py b/docs/conf.py index eea484b22..67b5fd0ae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -132,6 +132,7 @@ html_static_path = ["_static"] html_title = project_name html_logo = "img/scirpy_logo.png" +html_css_files = ["css/custom.css"] html_theme_options = { @@ -177,18 +178,3 @@ ("py:meth", "mudata.MuData.update"), ("py:class", "awkward.highlevel.Array"), ] - - -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, - ) diff --git a/docs/conf.py.rej b/docs/conf.py.rej deleted file mode 100644 index d060fbf9b..000000000 --- a/docs/conf.py.rej +++ /dev/null @@ -1,36 +0,0 @@ -diff a/docs/conf.py b/docs/conf.py (rejected hunks) -@@ -109,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" -@@ -124,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, -- ) diff --git a/docs/contributing.md b/docs/contributing.md index 541f674e8..a4db9310c 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -19,8 +19,8 @@ pip install -e ".[dev,test,doc]" ## Code-style -This template uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either -automatically fix issues with the code, or raise an error message. +This package uses [pre-commit][] to enforce consistent code-styles. +On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message. To enable pre-commit locally, simply run @@ -82,66 +82,8 @@ out to the developers of the dependency before the package is released to a wide ### Updating the version number -Before making a release, you need to update the version number. Please adhere to [Semantic Versioning][semver], in brief - -> Given a version number MAJOR.MINOR.PATCH, increment the: -> -> 1. MAJOR version when you make incompatible API changes, -> 2. MINOR version when you add functionality in a backwards compatible manner, and -> 3. PATCH version when you make backwards compatible bug fixes. -> -> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. - -We use [bump2version][] to automatically update the version number in all places and automatically create a git tag. -Run one of the following commands in the root of the repository - -```bash -bump2version patch -bump2version minor -bump2version major -``` - -Once you are done, run - -``` -git push --tags -``` - -to publish the created tag on GitHub. - -[bump2version]: https://github.com/c4urself/bump2version - -### Building and publishing the package on PyPI - -Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run - -```bash -python -m build -``` - -This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository. - -Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running: - -```bash -twine check dist/* -``` - -and finally publishing it with: - -```bash -twine upload dist/* -``` - -Provide your username and password when requested and then go check out your package on [PyPI][]! - -For more information, follow the [Python packaging tutorial][]. - -It is possible to automate this with GitHub actions, see also [this feature request][pypi-feature-request] -in the cookiecutter-scverse template. - -[python packaging tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives -[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88 +Scirpy uses [hatch-vcs](https://github.com/ofek/hatch-vcs) to automaticlly retrieve the version number +from the git tag. To make a new release, navigate to the “Releases” page of this project on GitHub. Specify vX.X.X as a tag name and create a release. For more information, see [managing GitHub releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI. ## Writing documentation @@ -205,3 +147,4 @@ open _build/html/index.html [numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html [sphinx autodoc typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints [pypi]: https://pypi.org/ +[managing GitHub releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository diff --git a/docs/contributing.md.rej b/docs/contributing.md.rej deleted file mode 100644 index 10dfcb720..000000000 --- a/docs/contributing.md.rej +++ /dev/null @@ -1,71 +0,0 @@ -diff a/docs/contributing.md b/docs/contributing.md (rejected hunks) -@@ -19,9 +19,8 @@ pip install -e ".[dev,test,doc]" - - ## Code-style - --This template uses [pre-commit][] to enforce consistent code-styles. On every commit, pre-commit checks will either --automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for --a full list of checks enabled for this repository. -+This package uses [pre-commit][] to enforce consistent code-styles. -+On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message. - - To enable pre-commit locally, simply run - -@@ -83,55 +92,8 @@ Before making a release, you need to update the version number in the `pyproject - > - > Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. - --Once you are done, run -- --``` --git push --tags --``` -- --to publish the created tag on GitHub. Alternatively, it is possible to create a tag through the Github web interface. For more information, see [managing Github releases][]. This will automatically trigger a Github workflow that creates a release on PyPI. -- --### The release Github workflow -- --#### Behind the scenes -- --This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section. --Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run -- --```bash --python -m build --``` -- --This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository. -- --Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running: -- --```bash --twine check dist/* --``` -- --and finally publishing it with: -- --```bash --twine upload dist/* --``` -- --Provide your username and password when requested and then go check out your package on [PyPI][]! -- --For more information, follow the [Python packaging tutorial][]. -- --#### Configuring the Github workflow -- --Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][]. --For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token. --See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token. --Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][]. -- --[creating github secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets --[creating pypi tokens]: https://pypi.org/help/#apitoken --[managing github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository --[python packaging tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives --[pypi-feature-request]: https://github.com/scverse/cookiecutter-scverse/issues/88 -+Once you are done, commit and push your changes and navigate to the "Releases" page of this project on GitHub. -+Specify `vX.X.X` as a tag name and create a release. For more information, see [managing Github releases][]. This will automatically create a git tag and trigger a Github workflow that creates a release on PyPI. - - ## Writing documentation - diff --git a/docs/index.md.rej b/docs/index.md.rej deleted file mode 100644 index 922185b90..000000000 --- a/docs/index.md.rej +++ /dev/null @@ -1,9 +0,0 @@ -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 - diff --git a/pyproject.toml b/pyproject.toml index 602990c92..31ee677fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ doc = [ ] test = [ 'pytest', - 'pytest-cov', + 'coverage', 'black', ] dandelion = [ diff --git a/pyproject.toml.rej b/pyproject.toml.rej deleted file mode 100644 index 39e6e336a..000000000 --- a/pyproject.toml.rej +++ /dev/null @@ -1,22 +0,0 @@ -diff a/pyproject.toml b/pyproject.toml (rejected hunks) -@@ -26,7 +26,6 @@ dependencies = [ - - [project.optional-dependencies] - dev = [ -- # CLI for bumping the version number - "pre-commit", - "twine>=4.0.2" - ] -@@ -42,10 +41,11 @@ doc = [ - "ipykernel", - "ipython", - "sphinx-copybutton", -+ "pandas", - ] - test = [ - "pytest", -- "pytest-cov", -+ "coverage", - ] - - [tool.coverage.run] From 0a6e88894c2b4fd569193c08e6afe4f1a9034e38 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Thu, 28 Dec 2023 21:01:10 +0100 Subject: [PATCH 4/4] Pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b6f7c958..28566a5d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ default_stages: minimum_pre_commit_version: 2.16.0 repos: - repo: https://github.com/psf/black - rev: "23.10.1" + rev: "23.12.1" hooks: - id: black - repo: https://github.com/asottile/blacken-docs @@ -26,7 +26,7 @@ repos: language_version: "17.9.1" exclude: '^\.conda' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix]