Skip to content

Commit 94d2aed

Browse files
remove the dependancy on setup.cfg and setup.py (#177)
* removed flake8 * removed metadata * added dynamics * removed options * moved pytest options * removed coverage mentions * removed coverage mentions * simplified tephi pytest * muted error handling * readded cov mentions * added review review ignore * removed package options section * added scm (stackoverflow suggestion) * deleted setup.cfg * deleted manifest * deleted setup.py (manifest is fine, typo) * isolated build again... * removed iso-build, readded setup.py * rejigged order of pyproject.toml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added @bjlittle suggestions from prev pr * up to date with #173 * added testing matrix * corrected tox call * added space to pyproj.toml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0e3e8ad commit 94d2aed

File tree

6 files changed

+91
-146
lines changed

6 files changed

+91
-146
lines changed

.flake8

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

.github/workflows/ci-tests.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16-
build:
16+
tests:
17+
name: "${{ matrix.session }} (${{ matrix.version }})"
1718

18-
runs-on: ubuntu-latest
19+
runs-on: ${{ matrix.os }}
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ "ubuntu-latest" ]
25+
version: [ "py38", "py39", "py310", "py311"]
26+
session: [ "test" ]
27+
include:
28+
- version: "py311"
29+
coverage: "--cov-report= --cov=tephi"
1930

2031
steps:
2132
- uses: actions/checkout@v3
@@ -27,4 +38,6 @@ jobs:
2738
.tox
2839
2940
- name: Run tox
30-
run: pipx run 'tox<4'
41+
run: |
42+
pip install 'tox<4'
43+
tox -e ${{ matrix.version }}-${{ matrix.session }}

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ recursive-include docs *.png
1515
recursive-include docs *.py
1616
recursive-include docs *.rst
1717
recursive-include docs Makefile
18+
recursive-include tephi *.json
19+
recursive-include tephi *.npz
20+
recursive-include tephi *.txt

pyproject.toml

Lines changed: 70 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# See https://github.com/SciTools/.github/wiki/Linting
22
# for SciTools linting guidelines
33

4-
[tool.black]
5-
line-length = 79
6-
target-version = ["py37", "py38", "py39", "py310"]
7-
include = '\.pyi?$'
4+
[build-system]
5+
# Defined by PEP 518
6+
requires = ["setuptools>=60"]
7+
# Defined by PEP 517
8+
build-backend = "setuptools.build_meta"
89

910
[project]
1011
authors = [
@@ -26,8 +27,6 @@ classifiers = [
2627
]
2728
description = "Tephigram plotting in Python"
2829
dynamic = [
29-
"dependencies",
30-
"optional-dependencies",
3130
"readme",
3231
"version",
3332
]
@@ -40,53 +39,26 @@ keywords = [
4039
license = {text = "BSD-3-Clause"}
4140
name = "tephi"
4241
requires-python = ">=3.8"
42+
dependencies = ["matplotlib", "numpy", "scipy"]
4343

4444
[project.urls]
4545
Code = "https://github.com/SciTools/tephi"
46-
Issues = "issues = https://github.com/SciTools/tephi/issues"
46+
Issues = "https://github.com/SciTools/tephi/issues"
4747
Binder= "https://mybinder.org/v2/gh/SciTools/tephi/main?filepath=index.ipynb"
4848
Docs = "https://tephi.readthedocs.io/en/latest/"
4949

50-
[build-system]
51-
# Defined by PEP 518
52-
requires = ["setuptools>=45"]
53-
# Defined by PEP 517
54-
build-backend = "setuptools.build_meta"
55-
56-
[tool.repo-review]
57-
# These are a list of the currently failing tests:
58-
ignore = [
59-
# https://learn.scientific-python.org/development/guides/style/#PC180
60-
"PC180", # Uses prettier
61-
62-
# https://learn.scientific-python.org/development/guides/packaging-simple/#PY005
63-
"PY005", # Has tests folder
64-
65-
# TODO: exceptions that still need investigating are below. Might be fixable, or might become permanent (above):
66-
67-
# https://learn.scientific-python.org/development/guides/pytest/#PP301
68-
"PP301", # Has pytest in pyproject
69-
70-
# https://learn.scientific-python.org/development/guides/gha-basic/#GH212
71-
"GH212", # Require GHA update grouping
72-
73-
# https://learn.scientific-python.org/development/guides/style/#PC170
74-
"PC170", # Uses PyGrep hooks (only needed if rST present)
75-
76-
# https://learn.scientific-python.org/development/guides/style/#PC901
77-
"PC901", # Custom pre-commit CI message
78-
]
79-
50+
[tool.black]
51+
line-length = 79
52+
target-version = ["py38", "py39", "py310", "py311"]
53+
include = '\.pyi?$'
8054

8155
[tool.mypy]
8256
strict = false
8357
ignore_missing_imports = true
8458
warn_unused_configs = true
8559
warn_unreachable = true
8660
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
87-
exclude = [
88-
89-
]
61+
exclude = []
9062

9163
[tool.numpydoc_validation]
9264
checks = [
@@ -126,6 +98,50 @@ exclude = [
12698
'\.__repr__$',
12799
]
128100

101+
[tool.pytest.ini_options]
102+
minversion = "6.0"
103+
markers = ["graphical: mark a test as a graphical test"]
104+
addopts = ["-ra",
105+
"-v",
106+
"--cov-config=.coveragerc",
107+
"--cov=tephi",
108+
"--cov-report=term-missing",
109+
"--doctest-modules",
110+
"--showlocals",
111+
"--strict-markers",
112+
"--strict-config"
113+
]
114+
xfail_strict = true
115+
log_cli_level = "info"
116+
testpaths = [
117+
"tephi/",
118+
]
119+
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS NUMBER"
120+
121+
[tool.repo-review]
122+
# These are a list of the currently failing tests:
123+
ignore = [
124+
# https://learn.scientific-python.org/development/guides/style/#PC180
125+
"PC180", # Uses prettier
126+
127+
# https://learn.scientific-python.org/development/guides/packaging-simple/#PY005
128+
"PY005", # Has tests folder
129+
130+
# TODO: exceptions that still need investigating are below. Might be fixable, or might become permanent (above):
131+
132+
# https://learn.scientific-python.org/development/guides/pytest#PP309
133+
"PP309", # has filterwarnings set
134+
135+
# https://learn.scientific-python.org/development/guides/gha-basic/#GH212
136+
"GH212", # Require GHA update grouping
137+
138+
# https://learn.scientific-python.org/development/guides/style/#PC170
139+
"PC170", # Uses PyGrep hooks (only needed if rST present)
140+
141+
# https://learn.scientific-python.org/development/guides/style/#PC901
142+
"PC901", # Custom pre-commit CI message
143+
]
144+
129145
[tool.ruff]
130146
line-length = 88
131147

@@ -176,6 +192,19 @@ known-first-party = ["tephi"]
176192
"ERA001", # Has commented out code
177193
]
178194

179-
180195
[tool.ruff.lint.pydocstyle]
181196
convention = "numpy"
197+
198+
[tool.setuptools.dynamic]
199+
version = { attr = "tephi.__version__"}
200+
readme = {file = ["README.md"], content-type = "text/markdown"}
201+
202+
[tool.setuptools.package-data]
203+
tephi = [
204+
"etc/test_data/*.txt",
205+
"tests/results/*.npz",
206+
"tests/results/imagerepo.json"
207+
]
208+
209+
[tool.setuptools.packages.find]
210+
include = ["tephi*"]

setup.cfg

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

tox.ini

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[tox]
22
requires =
33
tox-conda
4-
minversion = 3.15
5-
base_python = py311
6-
envlist=py{38,39,310,311}
4+
isolated_build = True
75

8-
[testenv]
6+
[testenv:py{38,39,310,311}-test]
97
description = invoke pytest to run automated tests
108
deps =
119
pytest

0 commit comments

Comments
 (0)