From dfbd0e0979591e91ab6a4d308ab736ffa6b7d24d Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Fri, 18 Aug 2023 23:01:49 -0400 Subject: [PATCH 1/3] pyproject.toml: add dynamic requirements from file close #70 --- pyproject.toml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ca719ab..94e5f6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ readme = "README.md" requires-python = ">=3.8" keywords = ["solid Earth tides", "deformation", "geodesy", "geophysics"] license = {text = "GPL-3.0-or-later"} -classifiers=[ +classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering", @@ -21,11 +21,11 @@ classifiers=[ "Operating System :: OS Independent", "Programming Language :: Python :: 3", ] -dependencies = [ - "numpy", - "scipy", -] -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", "dependencies", "optional-dependencies"] [project.urls] "Homepage" = "https://github.com/insarlab/PySolid" @@ -35,6 +35,15 @@ dynamic = ["version"] include-package-data = true zip-safe = false +[tool.setuptools.dynamic] +dependencies = { file = ["requirements.txt"] } + +# extra requirements: `pip install pydolid[docs]` or `pip install .[docs,test]` +[tool.setuptools.dynamic.optional-dependencies.docs] +file = ["docs/requirements.txt"] +[tool.setuptools.dynamic.optional-dependencies.test] +file = ["tests/requirements.txt"] + [tool.setuptools.packages.find] where = ["src"] From 58bbe770f51041f952eb057f3b38ef9007cccb50 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Mon, 21 Aug 2023 08:22:08 -0400 Subject: [PATCH 2/3] fix typo in comment Co-authored-by: Zhang Yunjun --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 94e5f6b..175b10d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ zip-safe = false [tool.setuptools.dynamic] dependencies = { file = ["requirements.txt"] } -# extra requirements: `pip install pydolid[docs]` or `pip install .[docs,test]` +# extra requirements: `pip install pysolid[docs]` or `pip install .[docs,test]` [tool.setuptools.dynamic.optional-dependencies.docs] file = ["docs/requirements.txt"] [tool.setuptools.dynamic.optional-dependencies.test] From b6c9e063fcc1fb78f7ef752b6d3dcf7ed8e75cd5 Mon Sep 17 00:00:00 2001 From: Zhang Yunjun Date: Mon, 21 Aug 2023 23:03:33 +0800 Subject: [PATCH 3/3] update install note for build-from-source --- README.md | 6 +++--- pyproject.toml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d7af653..8eececd 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,14 @@ git clone https://github.com/insarlab/PySolid.git ```bash # option 1: use conda to install dependencies into an existing, activated environment -conda install -c conda-forge fortran-compiler --file PySolid/requirements.txt +conda install -c conda-forge fortran-compiler --file PySolid/requirements.txt --file PySolid/tests/requirements.txt # option 2: use conda to install dependencies into a new environment, e.g. named "pysolid" -conda create --name pysolid fortran-compiler --file PySolid/requirements.txt +conda create --name pysolid fortran-compiler --file PySolid/requirements.txt --file PySolid/tests/requirements.txt conda activate pysolid # option 3: have a Fortran compiler already installed and use pip to install the rest dependencies -python -m pip install -r PySolid/requirements.txt +python -m pip install -r PySolid/requirements.txt -r PySolid/tests/requirements.txt ``` ##### c. Install PySolid diff --git a/pyproject.toml b/pyproject.toml index 175b10d..19637c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ zip-safe = false dependencies = { file = ["requirements.txt"] } # extra requirements: `pip install pysolid[docs]` or `pip install .[docs,test]` +# note: the [docs] syntax requires setuptools>=64.0, thus, not working yet. [tool.setuptools.dynamic.optional-dependencies.docs] file = ["docs/requirements.txt"] [tool.setuptools.dynamic.optional-dependencies.test]