Skip to content

Commit

Permalink
migrate to uv and pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeliza committed Dec 20, 2024
1 parent 6e84728 commit 7ba6302
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 72 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Test with pytest
run: |
pytest -v
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run tests
run: uv run pytest
89 changes: 81 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,95 @@
[tool.pyright]
include = ["nbank"]

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "neurobank"
dynamic = ["version"]
description = "Simple data management system for neuroscience"
readme = "README.rst"
license = {text = "BSD 3-Clause License"}
authors = [
{name = "Dan Meliza", email = "[email protected]"},
]
maintainers = [
{name = "Dan Meliza", email = "[email protected]"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Operating System :: Unix",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Natural Language :: English",
]
requires-python = ">=3.7"
dependencies = [
"httpx>=0.24",
]

[dependency-groups]
dev = [
"pytest>=7.0",
"respx>=0.20",
"ruff>=0.7.0"
]

[project.urls]
Homepage = "https://github.com/melizalab/neurobank"

[project.scripts]
nbank = "nbank.script:main"

[tool.hatch.version]
path = "nbank/__init__.py"

[tool.black]
line-length = 88
target-version = ["py310"]
include = '\.pyi?$'

[tool.pytest.ini_options]
python_files = ["test_*.py", "*_test.py"]
addopts = "-v"
testpaths = ["test"]

[tool.ruff]
target-version = "py37"
extend-exclude = ["attic"]
line-length = 88
target-version = "py310"

[tool.ruff.lint]
extend-select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"B", # flake8-bugbear
"I", # isort
"PGH", # pygrep-hooks
"RUF", # Ruff-specific
"UP", # pyupgrade
]
ignore = ["E221", "E501", "E701"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

[tool.mypy]
ignore_missing_imports = true
python_version = "3.8"
ignore_missing_imports = true
strict_optional = true
check_untyped_defs = true

[tool.hatch.build]
include = ["nbank/**"]
exclude = ["*test*"]
artifacts = ["README.rst"]

52 changes: 0 additions & 52 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit 7ba6302

Please sign in to comment.