Skip to content

Commit

Permalink
pyproject.toml: use dynamic dependencies (#38)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yunjunz authored Sep 18, 2024
1 parent 7d596cc commit 5103853
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
export PYTHONUNBUFFERED=1
# install dependencies and source code
source activate root
mamba install --verbose --yes --file ${PYAPS_HOME}/requirements.txt
mamba install --verbose --yes --file ${PYAPS_HOME}/requirements.txt --file ${PYAPS_HOME}/tests/requirements.txt
python -m pip install ${PYAPS_HOME}
- run:
Expand Down
30 changes: 16 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0", "setuptools_scm[toml]", "wheel"]
requires = ["setuptools>=64.0", "setuptools_scm[toml]>=8", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -9,8 +9,8 @@ authors = [
{name="Romain Jolivet", email="insar@geologie.ens.fr"},
{name="Angelique Benoit"},
]
readme = "README.md"
requires-python = ">=3.8"

keywords = ["InSAR", "troposphere", "geodesy", "geophysics", "ERA5"]
license = {text = "GPL-3.0-or-later"}
classifiers=[
Expand All @@ -21,26 +21,28 @@ classifiers=[
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = [
"cdsapi>=0.7.0",
"matplotlib",
"numpy",
"pygrib",
"scipy",
"urllib3",
#"netcdf4", # for MERRA, which is currently not supported
#"pyhdf", # for MERRA, which is currently not supported
]
dynamic = ["version"]

# see section: setuptools_scm
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata
# dependencies will be read from text files
dynamic = ["version", "readme", "dependencies", "optional-dependencies"]

[project.urls]
"Homepage" = "https://github.com/insarlab/PyAPS"
"Bug Tracker" = "https://github.com/insarlab/PyAPS/issues"
"Issues" = "https://github.com/insarlab/PyAPS/issues"

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
readme = { file = ["README.md"], content-type = "text/markdown" }

# extra requirements: `pip install pyaps3[test]` or `pip install .[test]`
[tool.setuptools.dynamic.optional-dependencies.test]
file = ["tests/requirements.txt"]

[tool.setuptools.packages.find]
where = ["src"]

Expand Down
7 changes: 0 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# for running
cdsapi>=0.7.0
matplotlib
numpy
pygrib
scipy
urllib3
#netcdf4 #for MERRA, which is currently not supported
#pyhdf #for MERRA, which is currently not supported
# for packaging and installation
pip
setuptools
setuptools_scm
wheel
5 changes: 5 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
matplotlib
pip
setuptools
setuptools_scm
wheel

0 comments on commit 5103853

Please sign in to comment.