Skip to content

Commit 38c403e

Browse files
committed
Initial commit
0 parents  commit 38c403e

18 files changed

+780
-0
lines changed

.git_archival.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

.github/CONTRIBUTING.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2+
description of best practices for developing scientific packages.
3+
4+
[spc-dev-intro]: https://scientific-python-cookie.readthedocs.io/guide/intro
5+
6+
# Setting up a development environment manually
7+
8+
You can set up a development environment by running:
9+
10+
```bash
11+
python3 -m venv .venv
12+
source ./.venv/bin/activate
13+
pip install -v -e .[dev]
14+
```
15+
16+
or just
17+
18+
```bash
19+
hatch shell
20+
```
21+
22+
# Post setup
23+
24+
You should prepare pre-commit, which will help you by checking that commits pass
25+
required checks:
26+
27+
```bash
28+
pip install pre-commit # or brew install pre-commit on macOS
29+
pre-commit install # Will install a pre-commit hook into the git repo
30+
```
31+
32+
You can also/alternatively run `pre-commit run` (changes only) or
33+
`pre-commit run --all-files` to check even without installing the hook.
34+
35+
This project uses pre-commit for all style checking. Install pre-commit and run:
36+
37+
```bash
38+
pre-commit run -a
39+
```
40+
41+
to check all files.
42+
43+
# Testing
44+
45+
Use pytest to run the unit checks:
46+
47+
```bash
48+
pytest
49+
```
50+
51+
# Coverage
52+
53+
Use pytest-cov to generate coverage reports:
54+
55+
```bash
56+
pytest --cov=dask-ngs
57+
```
58+
59+
# Building docs
60+
61+
You can build the docs using:
62+
63+
```bash
64+
hatch docs
65+
```

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/ci.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
FORCE_COLOR: 3
19+
20+
jobs:
21+
pre-commit:
22+
name: Format
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: "3.x"
31+
- uses: pre-commit/[email protected]
32+
with:
33+
extra_args: --hook-stage manual --all-files
34+
35+
checks:
36+
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
37+
runs-on: ${{ matrix.runs-on }}
38+
needs: [pre-commit]
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python-version: ["3.7", "3.11"]
43+
runs-on: [ubuntu-latest, macos-latest, windows-latest]
44+
45+
steps:
46+
- uses: actions/checkout@v3
47+
with:
48+
fetch-depth: 0
49+
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
54+
- name: Install package
55+
run: python -m pip install .[test]
56+
57+
- name: Test package
58+
run: >-
59+
python -m pytest -ra --cov --cov-report=xml --cov-report=term
60+
--durations=20
61+
62+
- name: Upload coverage report
63+
uses: codecov/[email protected]
64+
65+
dist:
66+
needs: [pre-commit]
67+
name: Distribution build
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v3
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Build sdist and wheel
76+
run: pipx run build
77+
78+
- uses: actions/upload-artifact@v3
79+
with:
80+
path: dist
81+
82+
- name: Check products
83+
run: pipx run twine check dist/*
84+
85+
publish:
86+
needs: [dist]
87+
name: Publish to PyPI
88+
environment: pypi
89+
permissions:
90+
id-token: write
91+
runs-on: ubuntu-latest
92+
if: github.event_name == 'release' && github.event.action == 'published'
93+
94+
steps:
95+
- uses: actions/download-artifact@v3
96+
with:
97+
name: artifact
98+
path: dist
99+
100+
- uses: pypa/gh-action-pypi-publish@release/v1
101+
if: github.event_name == 'release' && github.event.action == 'published'
102+
with:
103+
# Remember to tell (test-)pypi about this repo before publishing
104+
# Remove this line to publish to PyPI
105+
repository-url: https://test.pypi.org/legacy/

.gitignore

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
# Spyder project settings
117+
.spyderproject
118+
.spyproject
119+
120+
# Rope project settings
121+
.ropeproject
122+
123+
# mkdocs documentation
124+
/site
125+
126+
# mypy
127+
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# setuptools_scm
141+
src/*/_version.py
142+
143+
144+
# ruff
145+
.ruff_cache/
146+
147+
# OS specific stuff
148+
.DS_Store
149+
.DS_Store?
150+
._*
151+
.Spotlight-V100
152+
.Trashes
153+
ehthumbs.db
154+
Thumbs.db
155+
156+
# Common editor files
157+
*~
158+
*.swp

.pre-commit-config.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
ci:
2+
autoupdate_commit_msg: "chore: update pre-commit hooks"
3+
autofix_commit_msg: "style: pre-commit fixes"
4+
5+
repos:
6+
- repo: https://github.com/psf/black
7+
rev: "23.3.0"
8+
hooks:
9+
- id: black-jupyter
10+
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: "v4.4.0"
13+
hooks:
14+
- id: check-added-large-files
15+
- id: check-case-conflict
16+
- id: check-merge-conflict
17+
- id: check-symlinks
18+
- id: check-yaml
19+
- id: debug-statements
20+
- id: end-of-file-fixer
21+
- id: mixed-line-ending
22+
- id: name-tests-test
23+
args: ["--pytest-test-first"]
24+
- id: requirements-txt-fixer
25+
- id: trailing-whitespace
26+
27+
- repo: https://github.com/pre-commit/pygrep-hooks
28+
rev: "v1.10.0"
29+
hooks:
30+
- id: rst-backticks
31+
- id: rst-directive-colons
32+
- id: rst-inline-touching-normal
33+
34+
- repo: https://github.com/asottile/blacken-docs
35+
rev: "1.13.0"
36+
hooks:
37+
- id: blacken-docs
38+
additional_dependencies: [black==23.3.0]
39+
40+
- repo: https://github.com/charliermarsh/ruff-pre-commit
41+
rev: "v0.0.264"
42+
hooks:
43+
- id: ruff
44+
args: ["--fix", "--show-fixes"]
45+
46+
- repo: https://github.com/codespell-project/codespell
47+
rev: "v2.2.4"
48+
hooks:
49+
- id: codespell

0 commit comments

Comments
 (0)