Skip to content

Commit 9fb6c5a

Browse files
authored
Merge pull request #21 from tlambert03/src-layout
build: move to src layout, make compatible with uv sync (and use on CI)
2 parents e3c97b3 + b5d5f91 commit 9fb6c5a

24 files changed

Lines changed: 48 additions & 44 deletions

.cruft.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,17 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu-latest, windows-latest, macos-latest]
32-
python-version: ["3.9", "3.10", "3.11", "3.12"]
32+
python-version: ["3.9", "3.11", "3.13"]
3333

3434
steps:
3535
- uses: actions/checkout@v2
36-
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v4
36+
- uses: astral-sh/setup-uv@v6
3837
with:
3938
python-version: ${{ matrix.python-version }}
40-
- name: Install dependencies
41-
run: |
42-
pip install ".[dev]"
39+
enable-cache: true
40+
cache-dependency-glob: "**/pyproject.toml"
4341
- name: Test with pytest
44-
run: |
45-
pytest --color=yes -v tests
42+
run: uv run pytest
4643

4744
deploy:
4845
name: Deploy
@@ -58,21 +55,19 @@ jobs:
5855
- uses: actions/checkout@v4
5956
with:
6057
fetch-depth: 0
61-
62-
- name: 🐍 Set up Python
63-
uses: actions/setup-python@v5
58+
- uses: astral-sh/setup-uv@v6
6459
with:
65-
python-version: "3.x"
60+
python-version: ${{ matrix.python-version }}
61+
enable-cache: true
62+
cache-dependency-glob: "**/pyproject.toml"
6663

6764
- name: 👷 Build
68-
run: |
69-
python -m pip install build
70-
python -m build
65+
run: uv build
7166

7267
- name: 🚢 Publish to PyPI
7368
uses: pypa/gh-action-pypi-publish@release/v1
7469
with:
75-
password: ${{ secrets.PYPI_API_TOKEN }}
70+
password: ${{ secrets.PYPI_API_TOKEN }}
7671

7772
- uses: softprops/action-gh-release@v2
7873
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ build
1111
dist
1212
.vscode
1313
docs/_build/
14+
15+
# remove me to enforce synchrony across development environments
16+
uv.lock

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: check-added-large-files
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.11.5
18+
rev: v0.11.10
1919
hooks:
2020
- id: ruff
2121
args: [--fix, --unsafe-fixes]

pyproject.toml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,34 @@ authors = [
1313
{ email = "funkej@janelia.hhmi.org", name = "Jan Funke" },
1414
{ email = "talley.lambert@gmail.com", name = "Talley Lambert" },
1515
]
16-
dependencies = ["witty>=v0.2.0", "CT3", "numpy", "setuptools>=75.8.0"]
16+
classifiers = [
17+
"Development Status :: 3 - Alpha",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: MIT License",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Typing :: Typed",
26+
]
27+
dependencies = ["witty>=v0.2.1", "CT3>=3.3.3", "numpy", "setuptools>=75.8.0"]
28+
29+
[dependency-groups]
30+
dev = [
31+
"ipython>=8.18.1",
32+
"mypy>=1.15.0",
33+
"pre-commit>=4.2.0",
34+
"pytest>=8.3.5",
35+
"pytest-cov>=6.1.1",
36+
"ruff>=0.11.10",
37+
]
38+
1739

1840
[project.urls]
1941
homepage = "https://github.com/funkelab/spatial_graph"
2042
repository = "https://github.com/funkelab/spatial_graph"
2143

22-
[project.optional-dependencies]
23-
dev = ["pytest>=8.3.4", "ruff", "mypy", "pre-commit"]
24-
2544
[tool.ruff]
2645
target-version = "py39"
2746
line-length = 88
@@ -47,4 +66,8 @@ strict = false
4766
disallow_any_generics = false
4867
disallow_subclassing_any = false
4968
show_error_codes = true
50-
pretty = true
69+
pretty = true
70+
71+
[tool.pytest.ini_options]
72+
addopts = "-v --color=yes"
73+
filterwarnings = ["error", "ignore:'cgi' is deprecated"]

0 commit comments

Comments
 (0)