Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.11, 3.12, 3.13]
python-version:
- "3.11"
- "3.12"
- "3.13"
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: run tests
run: |
pip install nox
pip install '.[test]'
nox --session coverage
uvx nox --session coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
env:
Expand Down
35 changes: 15 additions & 20 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


nox.options.sessions = ['test', 'coverage']

nox.options.default_venv_backend = "uv|virtualenv"

TEST_PYTHONS = [
"3.11",
Expand All @@ -19,20 +19,6 @@
]


@nox.session
def build(session: nox.Session) -> None:
"""
Build an SDist and wheel with ``flit``.
"""

dist_dir = DIR.joinpath("dist")
if dist_dir.exists():
shutil.rmtree(dist_dir)

session.install(".[dev]")
session.run("flit", "build")


@nox.session(python=TEST_PYTHONS[1])
def dev(session: nox.Session) -> None:
"""
Expand Down Expand Up @@ -66,7 +52,9 @@ def lint(session):
"""
Run the linter.
"""
session.install(".[dev]")
pyproject = nox.project.load_toml("pyproject.toml")
session.install(*nox.project.dependency_groups(pyproject, "dev"))
#session.install(".[dev]")
# run isort first since black disagrees with it
session.run("isort", "./src")
session.run("black", "./src", "--line-length=120")
Expand All @@ -78,7 +66,9 @@ def test(session) -> None:
"""
Run the unit and regular tests.
"""
session.install(".[test]")
session.install(".")
pyproject = nox.project.load_toml("pyproject.toml")
session.install(*nox.project.dependency_groups(pyproject, "test"))
session.run("pytest", "-n", "auto", *session.posargs)


Expand All @@ -87,9 +77,12 @@ def coverage(session) -> None:
"""
Run the unit and regular tests, and save coverage report
"""
session.install(".[test]", "pytest-cov")
session.install(".")
pyproject = nox.project.load_toml("pyproject.toml")
session.install(*nox.project.dependency_groups(pyproject, "test"))
session.install("pytest-cov")
session.run(
"pytest", "-n", "auto", "--cov=./", "--cov-report=xml", *session.posargs
"pytest", "-n", "auto", "--cov=crowsetta", "--cov-report=xml", *session.posargs
)


Expand All @@ -106,7 +99,9 @@ def doc(session: nox.Session) -> None:

Otherwise the docs will be built once using
"""
session.install(".[doc]")
session.install(".")
pyproject = nox.project.load_toml("pyproject.toml")
session.install(*nox.project.dependency_groups(pyproject, "doc"))
if session.posargs:
if "autobuild" in session.posargs:
print("Building docs at http://127.0.0.1:8000 with sphinx-autobuild -- use Ctrl-C to quit")
Expand Down
25 changes: 13 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
requires = ["uv_build>=0.8.3,<0.9.0"]
build-backend = "uv_build"

[project]
name = "crowsetta"
Expand All @@ -12,7 +12,7 @@ requires-python = ">=3.11"
dependencies = [
"appdirs >=1.4.4",
"attrs >=25.3.0",
"numpy >=1.26.0",
"numpy >=2.0.0",
"pandas >= 2.1.0",
"pandera >= 0.25.0",
"scipy >=1.12.0",
Expand All @@ -32,7 +32,11 @@ classifiers = [
'Programming Language :: Python :: Implementation :: CPython',
]

[project.optional-dependencies]
[project.urls]
Source = "https://github.com/vocalpy/crowsetta"
Documentation = "https://crowsetta.readthedocs.io"

[dependency-groups]
test = [
"pytest >=6.2.1",
"pytest-cov >=2.12.0",
Expand All @@ -56,19 +60,16 @@ doc = [
]
dev = [
'black >=23.1.0',
'crowsetta[doc, test]',
'flake8 >=6.0.0',
'flit',
'isort >=5.12.0',
'pycln >=2.1.3',
'twine',
]
{include-group = "test"},
{include-group = "doc"},

[project.urls]
Source = "https://github.com/vocalpy/crowsetta"
Documentation = "https://crowsetta.readthedocs.io"
]

[tool.flit.sdist]
exclude = [
[tool.uv.build-backend]
source-exclude = [
"tests/data_for_tests"
]
Loading
Loading