Skip to content

Commit 5103853

Browse files
authored
pyproject.toml: use dynamic dependencies (#38)
* pyproject.toml: use dynamic dependencies + requirements.txt: - move the packaging related dependencies into tests/requirements.txt file - remove `matplotlib` as it's only used in the obsolete functions in utils.py, which is not used at all + pyproject.toml: - use dynamic files for dependencies and optional dependencies, to avoid duplicating the list of dependencies, to be consistent with mintpy - use dynamic files for readme as well * tests/requirements.txt: add matplotlib
1 parent 7d596cc commit 5103853

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
export PYTHONUNBUFFERED=1
5555
# install dependencies and source code
5656
source activate root
57-
mamba install --verbose --yes --file ${PYAPS_HOME}/requirements.txt
57+
mamba install --verbose --yes --file ${PYAPS_HOME}/requirements.txt --file ${PYAPS_HOME}/tests/requirements.txt
5858
python -m pip install ${PYAPS_HOME}
5959
6060
- run:

pyproject.toml

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "setuptools_scm[toml]", "wheel"]
2+
requires = ["setuptools>=64.0", "setuptools_scm[toml]>=8", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -9,8 +9,8 @@ authors = [
99
{name="Romain Jolivet", email="[email protected]"},
1010
{name="Angelique Benoit"},
1111
]
12-
readme = "README.md"
1312
requires-python = ">=3.8"
13+
1414
keywords = ["InSAR", "troposphere", "geodesy", "geophysics", "ERA5"]
1515
license = {text = "GPL-3.0-or-later"}
1616
classifiers=[
@@ -21,26 +21,28 @@ classifiers=[
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python :: 3",
2323
]
24-
dependencies = [
25-
"cdsapi>=0.7.0",
26-
"matplotlib",
27-
"numpy",
28-
"pygrib",
29-
"scipy",
30-
"urllib3",
31-
#"netcdf4", # for MERRA, which is currently not supported
32-
#"pyhdf", # for MERRA, which is currently not supported
33-
]
34-
dynamic = ["version"]
24+
25+
# see section: setuptools_scm
26+
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
27+
# dependencies will be read from text files
28+
dynamic = ["version", "readme", "dependencies", "optional-dependencies"]
3529

3630
[project.urls]
3731
"Homepage" = "https://github.com/insarlab/PyAPS"
38-
"Bug Tracker" = "https://github.com/insarlab/PyAPS/issues"
32+
"Issues" = "https://github.com/insarlab/PyAPS/issues"
3933

4034
[tool.setuptools]
4135
include-package-data = true
4236
zip-safe = false
4337

38+
[tool.setuptools.dynamic]
39+
dependencies = { file = ["requirements.txt"] }
40+
readme = { file = ["README.md"], content-type = "text/markdown" }
41+
42+
# extra requirements: `pip install pyaps3[test]` or `pip install .[test]`
43+
[tool.setuptools.dynamic.optional-dependencies.test]
44+
file = ["tests/requirements.txt"]
45+
4446
[tool.setuptools.packages.find]
4547
where = ["src"]
4648

requirements.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
# for running
21
cdsapi>=0.7.0
3-
matplotlib
42
numpy
53
pygrib
64
scipy
75
urllib3
86
#netcdf4 #for MERRA, which is currently not supported
97
#pyhdf #for MERRA, which is currently not supported
10-
# for packaging and installation
11-
pip
12-
setuptools
13-
setuptools_scm
14-
wheel

tests/requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
matplotlib
2+
pip
3+
setuptools
4+
setuptools_scm
5+
wheel

0 commit comments

Comments
 (0)