-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
19 changed files
with
848 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
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 @@ | ||
.git_archival.txt export-subst |
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,82 @@ | ||
# Contributing | ||
|
||
See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed | ||
description of best practices for developing scientific packages. | ||
|
||
[spc-dev-intro]: https://learn.scientific-python.org/development/ | ||
|
||
## Quick development | ||
|
||
The fastest way to start with development is to use nox. If you don't have nox, | ||
you can use `pipx run nox` to run it without installing, or `pipx install nox`. | ||
If you don't have pipx, then you can install with `pip install pipx`. If you use | ||
macOS, use `brew install pipx nox`. To use: | ||
|
||
``` | ||
nox | ||
``` | ||
|
||
This will lint and test using every installed version of Python on your system, | ||
skipping ones that are not installed. You can also run specific jobs: | ||
|
||
```console | ||
$ nox -s lint # Lint only | ||
$ nox -s tests # Python tests | ||
$ nox -s docs -- --serve # Build and serve the docs | ||
$ nox -s build # Make an SDist and wheel | ||
``` | ||
|
||
Nox handles everything for you, including setting up an temporary virtual | ||
environment for each run. | ||
|
||
## Setting up a development environment manually | ||
|
||
You can set up a development environment by running: | ||
|
||
```bash | ||
python3 -m venv .venv | ||
source ./.venv/bin/activate | ||
pip install -v -e .[dev] | ||
``` | ||
|
||
## Automated pre-commit checks | ||
|
||
`pre-commit` can check that code passes required checks before committing: | ||
|
||
```bash | ||
pip install pre-commit # or brew install pre-commit on macOS | ||
pre-commit install # install Git pre-commit hook from .pre-commit-config.yml | ||
``` | ||
|
||
You can also/alternatively run `pre-commit run` (will run for changed files | ||
only) or `pre-commit run --all-files` to check even without installing the hook. | ||
|
||
## Testing | ||
|
||
Use pytest to run the unit checks: | ||
|
||
```bash | ||
pytest | ||
``` | ||
|
||
### Coverage | ||
|
||
Use pytest-cov to generate coverage reports: | ||
|
||
```bash | ||
pytest --cov=ogdc-runner | ||
``` | ||
|
||
## Building docs | ||
|
||
You can build the docs using: | ||
|
||
```bash | ||
nox -s docs | ||
``` | ||
|
||
You can see a preview with: | ||
|
||
```bash | ||
nox -s docs -- --serve | ||
``` |
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,11 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
groups: | ||
actions: | ||
patterns: | ||
- "*" |
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,53 @@ | ||
name: "Build & release" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
release: | ||
types: | ||
- "published" | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Many color libraries just need this to be set to any value, but at least | ||
# one distinguishes color depth, where "3" -> "256-bit color". | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
build: | ||
name: "Build distributions (wheel & sdist)" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: "hynek/build-and-inspect-python-package@v2" | ||
|
||
publish: | ||
needs: ["build"] | ||
name: "Publish to PyPI" | ||
environment: "pypi" | ||
permissions: | ||
id-token: "write" | ||
runs-on: "ubuntu-latest" | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: "actions/download-artifact@v4" | ||
with: | ||
name: "Packages" | ||
path: "dist" | ||
|
||
- uses: "pypa/gh-action-pypi-publish@release/v1" | ||
with: | ||
# Remember to tell (test-)pypi about this repo before publishing | ||
# Remove this line to publish to PyPI | ||
repository-url: "https://test.pypi.org/legacy/" |
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,53 @@ | ||
name: "Quality checks" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Many color libraries just need this to be set to any value, but at least | ||
# one distinguishes color depth, where "3" -> "256-bit color". | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
test: | ||
name: "Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}" | ||
runs-on: "${{ matrix.runs-on }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.12"] | ||
runs-on: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
|
||
include: | ||
- python-version: "pypy-3.10" | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
allow-prereleases: true | ||
|
||
- name: "Install package" | ||
run: "python -m pip install .[test]" | ||
|
||
- name: "Test package" | ||
# prettier-ignore | ||
run: "python -m pytest -ra --durations=20 --cov --cov-report=xml --cov-report=term" | ||
|
||
- name: "Upload coverage report" | ||
uses: "codecov/[email protected]" | ||
with: | ||
token: "${{ secrets.CODECOV_TOKEN }}" |
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,158 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# setuptools_scm | ||
src/*/_version.py | ||
|
||
|
||
# ruff | ||
.ruff_cache/ | ||
|
||
# OS specific stuff | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# Common editor files | ||
*~ | ||
*.swp |
Oops, something went wrong.