Skip to content

Commit 8352d05

Browse files
committed
Update Python support and add dev tooling configs
Expanded supported Python versions to 3.9–3.12 in CI and metadata, and updated minimum required Python version to 3.9 in environment and project files. Modernized installation instructions in README to use pip. Added development and testing dependencies, and included configuration for ruff, mypy, and pytest in pyproject.toml to improve code quality and testing workflows.
1 parent dd9cd7b commit 8352d05

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed

.github/workflows/test_package_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
python: [ "3.10", "3.11" ]
78+
python: [ "3.9", "3.10", "3.11", "3.12" ]
7979
package: [ "wheel", "sdist", "archive" ]
8080

8181
steps:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Or
2020

2121
```bash
2222
git clone https://github.com/LorenFrankLab/track_linearization.git
23-
python setup.py install
23+
pip install .
2424
```
2525

2626
### Usage
@@ -35,5 +35,5 @@ python setup.py install
3535
cd <package folder>
3636
conda env create -f environment.yml
3737
conda activate track_linearization
38-
python setup.py develop
38+
pip install -e .
3939
```

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- "python>=3.6"
6+
- "python>=3.9"
77
- numpy
88
- scipy
99
- matplotlib

pyproject.toml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@ build-backend = "hatchling.build"
66
name = "track_linearization"
77
description = "A python package to map 2D trajectories to 1D."
88
readme = "README.md"
9-
requires-python = ">=3.8"
9+
requires-python = ">=3.9"
1010
license = { file = "LICENSE" }
1111
authors = [{ name = "Eric Denovellis", email = "[email protected]" }]
1212
classifiers = [
1313
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
1418
"License :: OSI Approved :: MIT License",
1519
"Operating System :: OS Independent",
20+
"Development Status :: 4 - Beta",
21+
"Intended Audience :: Science/Research",
22+
"Topic :: Scientific/Engineering",
1623
]
1724
dependencies = ["numpy", "scipy", "matplotlib", "pandas", "dask", "networkx>=3.2.1"]
1825
dynamic = ["version"]
@@ -22,8 +29,9 @@ dynamic = ["version"]
2229
"Bug Tracker" = "https://github.com/LorenFrankLab/track_linearization/issues"
2330

2431
[project.optional-dependencies]
25-
test = ["black", "pytest", "pytest-cov", "jupyter", "nbconvert"]
32+
test = ["black", "pytest", "pytest-cov", "jupyter", "nbconvert", "ruff", "mypy"]
2633
opt = ["numba", "ipympl"]
34+
dev = ["black", "pytest", "pytest-cov", "jupyter", "nbconvert", "ruff", "mypy", "pre-commit"]
2735

2836
[tool.hatch.version]
2937
source = "vcs"
@@ -36,3 +44,51 @@ exclude = [".git_archival.txt"]
3644

3745
[tool.hatch.build.targets.wheel]
3846
packages = ["src/track_linearization"]
47+
48+
[tool.ruff]
49+
target-version = "py39"
50+
line-length = 88
51+
52+
[tool.ruff.lint]
53+
select = [
54+
"E", # pycodestyle errors
55+
"W", # pycodestyle warnings
56+
"F", # pyflakes
57+
"I", # isort
58+
"B", # flake8-bugbear
59+
"C4", # flake8-comprehensions
60+
"UP", # pyupgrade
61+
]
62+
ignore = [
63+
"E501", # line too long, handled by black
64+
]
65+
66+
[tool.ruff.lint.per-file-ignores]
67+
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py
68+
69+
[tool.mypy]
70+
python_version = "3.9"
71+
warn_return_any = true
72+
warn_unused_configs = true
73+
disallow_untyped_defs = true
74+
disallow_incomplete_defs = true
75+
check_untyped_defs = true
76+
disallow_untyped_decorators = true
77+
no_implicit_optional = true
78+
warn_redundant_casts = true
79+
warn_unused_ignores = true
80+
warn_no_return = true
81+
warn_unreachable = true
82+
strict_equality = true
83+
84+
[tool.pytest.ini_options]
85+
testpaths = ["src/track_linearization/tests"]
86+
python_files = ["test_*.py"]
87+
python_classes = ["Test*"]
88+
python_functions = ["test_*"]
89+
addopts = [
90+
"--doctest-modules",
91+
"--cov=track_linearization",
92+
"--cov-report=html",
93+
"--cov-report=term-missing",
94+
]

0 commit comments

Comments
 (0)