Skip to content

Commit 1ffebf7

Browse files
committed
modernize
1 parent ed657c5 commit 1ffebf7

11 files changed

+240
-2547
lines changed

.gitattributes

-1
This file was deleted.

.gitignore

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
*.egg-info/
2-
*.pyc
1+
_version.py
2+
.coverage
33
.ipynb_checkpoints
4-
.pytest_cache
4+
.mypy_cache/
5+
.pytest_cache/
6+
.vscode/
7+
*.code-workspace
8+
*.egg*
9+
*.pyc
10+
**/__pycache__
511
build/
612
dist/
7-
docs/_build/

.pre-commit-config.yaml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-ast
7+
- id: debug-statements
8+
- id: end-of-file-fixer
9+
- id: check-docstring-first
10+
- id: check-added-large-files
11+
exclude_types: [yaml]
12+
- id: requirements-txt-fixer
13+
- id: file-contents-sorter
14+
files: requirements-dev.txt
15+
16+
- repo: https://github.com/pre-commit/mirrors-mypy
17+
rev: v1.11.1
18+
hooks:
19+
- id: mypy
20+
exclude: docs/source/conf.py
21+
entry: bash -c 'exec env CONDA_PREFIX="$(python -c "import sys; print(sys.executable)")"'
22+
args: ["--ignore-missing-imports", "--python-executable=CONDA_PREFIX"]
23+
24+
- repo: https://github.com/keewis/blackdoc
25+
rev: v0.3.9
26+
hooks:
27+
- id: blackdoc
28+
29+
- repo: https://github.com/econchick/interrogate
30+
rev: 1.7.0
31+
hooks:
32+
- id: interrogate
33+
exclude: ^(docs|tests)
34+
args: [--config=pyproject.toml]
35+
36+
- repo: https://github.com/codespell-project/codespell
37+
rev: v2.3.0
38+
hooks:
39+
- id: codespell
40+
exclude: >
41+
(?x)^(
42+
.*\.yaml
43+
)$
44+
args:
45+
- --ignore-words-list=pres
46+
47+
- repo: https://github.com/asottile/add-trailing-comma
48+
rev: v3.1.0
49+
hooks:
50+
- id: add-trailing-comma
51+
52+
- repo: https://github.com/astral-sh/ruff-pre-commit
53+
rev: v0.5.7
54+
hooks:
55+
- id: ruff
56+
args: ["--fix", "--show-fixes"]
57+
- id: ruff-format
58+
59+
- repo: https://github.com/nbQA-dev/nbQA
60+
rev: 1.8.7
61+
hooks:
62+
- id: nbqa-check-ast
63+
- id: nbqa-black
64+
- id: nbqa-ruff
65+
args: [
66+
--fix,
67+
--config=ruff.toml,
68+
]
69+
70+
- repo: https://github.com/bdice/nb-strip-paths
71+
rev: v0.1.0
72+
hooks:
73+
- id: nb-strip-paths
74+
75+
- repo: https://github.com/tox-dev/pyproject-fmt
76+
rev: 2.2.1
77+
hooks:
78+
- id: pyproject-fmt
79+
80+
ci:
81+
autofix_commit_msg: |
82+
[pre-commit.ci] auto fixes from pre-commit.com hooks
83+
84+
for more information, see https://pre-commit.ci
85+
autofix_prs: false
86+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
87+
autoupdate_schedule: monthly
88+
skip: []
89+
submodules: false

MANIFEST.in

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
include *.txt
22
include README.md
3+
include pyproject.toml
34

4-
recursive-include nbrr *.py
5-
include versioneer.py
6-
include nbrr/_version.py
5+
graft nbrr
6+
7+
prune .github
8+
prune *.egg-info
9+
prune tests
10+
11+
exclude .coveragerc
12+
exclude ruff.toml
13+
exclude .gitignore
14+
exclude .isort.cfg
15+
exclude .pre-commit-config.yaml
16+
exclude *.yml
17+
exclude nbrr/_version.py

nbrr/__init__.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from ._version import get_versions
1+
"""NBRR."""
22

3-
__version__ = get_versions()["version"]
4-
del get_versions
3+
try:
4+
from ._version import __version__
5+
except ImportError:
6+
__version__ = "unknown"

0 commit comments

Comments
 (0)