Skip to content

Commit 81be58a

Browse files
committed
Move all config to pyproject
1 parent d354abf commit 81be58a

File tree

4 files changed

+82
-49
lines changed

4 files changed

+82
-49
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
pip install .[test]
2222
- name: Test with pytest
2323
run: |
24-
pytest -vv --cov=modello
24+
pytest -vv

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ Currently this requires Python 3.8+ but the version requirements can drop a coup
4444

4545

4646
## Development
47-
Run the tests and linting with `python setup.py test`. Pushes have the test suite run against them, and will also publish a release if tagged thanks to GitHub Actions. You can reproduce the Actions locally using [act](https://github.com/nektos/act), e.g. `TWINE_USERNAME= TWINE_PASSWORD= act`.
47+
Run the tests and linting with `pytest`. Pushes have the test suite run against them, and will also publish a release if tagged thanks to GitHub Actions. You can reproduce the Actions locally using [act](https://github.com/nektos/act), e.g. `TWINE_USERNAME= TWINE_PASSWORD= act`.
4848

49-
You can run all the tests with `python setup.py test`. If you want to run a subset of tests or otherwise pass arguments to pytest, use `./pytest` e.g.:
49+
If you want to run a subset of tests or otherwise pass arguments to pytest, just invoke `pytest` directly, e.g.:
5050
```sh
51-
./pytest examples/jobs.py::jobs.Job
51+
pytest examples/jobs.py::jobs.Job
5252
```
5353

5454
## TODO:

pyproject.toml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
1+
[build-system]
2+
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "modello"
7+
description = "sympy expressions in models"
8+
readme = "README.md"
9+
requires-python = ">=3.8"
10+
license = {text = "MIT"}
11+
authors = [{name = "Oliver Bristow", email = "[email protected]"}]
12+
dependencies = ["sympy"]
13+
keywords = ["symbolic modeling"]
14+
urls = {homepage = "https://github.com/Code0x58/modello/"}
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Intended Audience :: Developers",
18+
"Intended Audience :: Science/Research",
19+
"License :: OSI Approved :: MIT License",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3 :: Only",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
28+
]
29+
dynamic = ["version"]
30+
31+
[project.optional-dependencies]
32+
test = [
33+
"flake8-black",
34+
"flake8-docstrings",
35+
"flake8-isort",
36+
"pytest-cov>=2.6.1",
37+
"pytest-ruff",
38+
"pytest-mypy",
39+
"pytest-pudb",
40+
"pytest>=4.1",
41+
]
42+
43+
[tool.setuptools]
44+
py-modules = ["modello"]
45+
46+
[tool.setuptools_scm]
47+
48+
[tool.pytest.ini_options]
49+
addopts = "--doctest-modules --doctest-report=udiff --cov=modello --cov-report=html --cov-report=term --mypy --ruff"
50+
python_files = ["test_modello.py", "examples/*.py"]
51+
cache_dir = "artefacts/reports/.pytest_cache"
52+
53+
[tool.coverage.run]
54+
data_file = "artefacts/reports/.coverage"
55+
source = ["modello.py"]
56+
branch = true
57+
58+
[tool.coverage.html]
59+
directory = "artefacts/reports/coverage-html"
60+
61+
[tool.mypy]
62+
ignore_missing_imports = true
63+
cache_dir = "artefacts/reports/.mypy_cache"
64+
65+
[tool.mypy-modello]
66+
disallow_untyped_defs = true
67+
disallow_incomplete_defs = true
68+
disallow_untyped_decorators = true
69+
70+
[tool.isort]
71+
line_length = 120
72+
force_grid_wrap = 0
73+
use_parentheses = true
74+
include_trailing_comma = true
75+
combine_as_imports = true
76+
multi_line_output = 5
77+
178
[tool.ruff]
279
line-length = 120
3-
target-version = "py311"
80+
target-version = "py311"

setup.cfg

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

0 commit comments

Comments
 (0)