-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
scverse-bot
authored and
scverse-bot
committed
May 21, 2024
1 parent
270b58d
commit 6923883
Showing
13 changed files
with
297 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/atlas_protocol_scripts | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff a/.github/workflows/test.yaml b/.github/workflows/test.yaml (rejected hunks) | ||
@@ -23,13 +23,16 @@ jobs: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- - os: ubuntu-latest | ||
- python: "3.9" | ||
- os: ubuntu-latest | ||
python: "3.10" | ||
- os: ubuntu-latest | ||
- python: "3.10" | ||
+ python: "3.12" | ||
+ - os: ubuntu-latest | ||
+ python: "3.12" | ||
pip-flags: "--pre" | ||
+ name: PRE-RELEASE DEPENDENCIES | ||
+ | ||
+ name: ${{ matrix.name }} Python ${{ matrix.python }} | ||
|
||
env: | ||
OS: ${{ matrix.os }} | ||
@@ -56,6 +59,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ __pycache__/ | |
/.pytest_cache/ | ||
/.cache/ | ||
/data/ | ||
/node_modules/ | ||
|
||
# docs | ||
/docs/generated/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks) | ||
@@ -6,29 +6,18 @@ default_stages: | ||
- push | ||
minimum_pre_commit_version: 2.16.0 | ||
repos: | ||
- - repo: https://github.com/psf/black | ||
- rev: "24.4.2" | ||
- 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/astral-sh/ruff-pre-commit | ||
rev: v0.4.4 | ||
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.6.0 | ||
hooks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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.9 or newer installed on your system. If you don't have | ||
+You need to have Python 3.10 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 atlas_protocol: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
@@ -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, | ||
- ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
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 | ||
|
||
@@ -195,3 +157,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
Oops, something went wrong.