Skip to content

Commit f6b26b6

Browse files
committed
chore: clean up unnecessary numpy dependency (and better pre-commit)
1 parent 246f470 commit f6b26b6

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ repos:
88
- id: check-added-large-files
99
- repo: local
1010
hooks:
11-
- id: nox
12-
name: nox
13-
description: Run nox fixers and linters.
14-
entry: nox -t fix style lint --no-install
11+
- id: nox (python)
12+
name: nox (python)
13+
description: Run nox fixers and linters for Python
14+
entry: nox -t python
1515
language: system
1616
pass_filenames: false
17-
types_or:
18-
- rust
17+
types:
1918
- python
19+
- id: nox (rust)
20+
name: nox (rust)
21+
description: Run nox fixers and linters for Rust
22+
entry: nox -t rust
23+
language: system
24+
pass_filenames: false
25+
types:
26+
- rust

noxfile.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,36 @@ def dev(session: nox.Session):
3737
session.run("pre-commit", "install")
3838

3939

40-
@nox.session(tags=["style", "fix"], python=False)
40+
@nox.session(tags=["style", "fix", "rust"], python=False)
4141
def rustfmt(session: nox.Session):
4242
if len(session.posargs) > 0:
4343
session.run("cargo", "+nightly", "fmt", *session.posargs, external=True)
4444
else:
4545
session.run("cargo", "+nightly", "fmt", "--all", external=True)
4646

4747

48-
@nox.session(tags=["lint", "fix"], python=False)
48+
@nox.session(tags=["lint", "fix", "rust"], python=False)
4949
def cargo_check(session: nox.Session):
5050
session.run("cargo", "check", "--workspace", external=True)
5151
session.run("cargo", "clippy", "--workspace", external=True)
5252

5353

54-
@nox.session(tags=["style", "fix"])
54+
@nox.session(tags=["style", "fix", "python"])
5555
def black(session: nox.Session):
5656
session.conda_install("black")
5757
session.run("black", str(__file__))
5858
with session.chdir(CURRENT_DIR / "pyargus"):
5959
session.run("black", ".")
6060

6161

62-
@nox.session(tags=["style", "fix"])
62+
@nox.session(tags=["style", "fix", "python"])
6363
def isort(session: nox.Session):
6464
session.conda_install("isort")
6565
with session.chdir(CURRENT_DIR / "pyargus"):
6666
session.run("isort", ".")
6767

6868

69-
@nox.session(tags=["lint"])
69+
@nox.session(tags=["lint", "python"])
7070
def flake8(session: nox.Session):
7171
session.conda_install(
7272
"flake8",
@@ -78,16 +78,16 @@ def flake8(session: nox.Session):
7878
session.run("flake8")
7979

8080

81-
@nox.session(tags=["lint", "fix"])
81+
@nox.session(tags=["lint", "fix", "python"])
8282
def ruff(session: nox.Session):
8383
session.conda_install("ruff")
8484
with session.chdir(CURRENT_DIR / "pyargus"):
8585
session.run("ruff", "--fix", "--exit-non-zero-on-fix", ".")
8686

8787

88-
@nox.session(tags=["lint"])
88+
@nox.session(tags=["lint", "python"])
8989
def mypy(session: nox.Session):
90-
session.conda_install("mypy", "typing-extensions", "pytest", "hypothesis", "numpy")
90+
session.conda_install("mypy", "typing-extensions", "pytest", "hypothesis")
9191
session.env.update(ENV)
9292

9393
with session.chdir(CURRENT_DIR / "pyargus"):

pyargus/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dev = [
2525
"black",
2626
]
2727

28-
test = ["pytest", "pytest-cov", "hypothesis", "numpy"]
28+
test = ["pytest", "pytest-cov", "hypothesis"]
2929

3030
[build-system]
3131
requires = ["maturin>=1.0,<2.0"]
@@ -44,7 +44,6 @@ testpaths = ["tests"]
4444
packages = ["argus"]
4545
# ignore_missing_imports = true
4646
show_error_codes = true
47-
plugins = ["numpy.typing.mypy_plugin"]
4847

4948
[tool.ruff]
5049
line-length = 127

0 commit comments

Comments
 (0)