Skip to content

Commit

Permalink
ci: refactor pytests dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 4, 2023
1 parent e8f852b commit 2a5dedc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: pip install nox

- name: Run the benchmarks
uses: CodSpeedHQ/action@v1
uses: CodSpeedHQ/action@v2
with:
run: nox -s codspeed
token: ${{ secrets.CODSPEED_TOKEN }}
3 changes: 1 addition & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ def codspeed(session: nox.Session) -> bool:
_run_cargo(session, "codspeed", "run")
# python benchmarks
os.chdir(PYO3_DIR / "pytests")
session.install("-r", "requirements-dev.txt", "pytest-codspeed")
session.install(".")
session.install(".[dev]", "pytest-codspeed")
_run(session, "pytest", "--codspeed", external=True)


Expand Down
5 changes: 2 additions & 3 deletions pytests/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@nox.session
def test(session: nox.Session):
session.install("-rrequirements-dev.txt")
session.install(".[dev]")
try:
session.install("--only-binary=numpy", "numpy>=1.16")
except CommandFailed:
Expand All @@ -19,6 +19,5 @@ def test(session: nox.Session):

@nox.session
def bench(session: nox.Session):
session.install("-rrequirements-dev.txt")
session.install(".")
session.install(".[dev]")
session.run("pytest", "--benchmark-enable", "--benchmark-only", *session.posargs)
1 change: 0 additions & 1 deletion pytests/pyo3_pytests/__init__.py

This file was deleted.

9 changes: 9 additions & 0 deletions pytests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ classifiers = [
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
]

[project.optional-dependencies]
dev = [
"hypothesis>=3.55",
"pytest-asyncio>=0.21",
"pytest-benchmark>=3.4",
"pytest>=6.0",
"typing_extensions>=4.0.0"
]
5 changes: 0 additions & 5 deletions pytests/requirements-dev.txt

This file was deleted.

0 comments on commit 2a5dedc

Please sign in to comment.