mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-10-29 09:12:37 +00:00
build: specify dependencies directly in setup.cfg
In tox v4, "reuse of environments" was disabled [1]. This is then later
explained [2] to refer to exactly that thing which we were using for
inheriting the dependencies from the top-level testenv all the way to
the docs build. That's why the docs build in GitHub CI started failing.
IMHO, The Correct Way™ of specifying what dependencies are used for
which feature are the so-called "extra dependencies". Once they are in
place, it is be possible to install gnpy via, e.g., `pip install
oopt-gnpy[docs]`. However, this process is (as far as I can tell)
incompatible with `requirements.txt`; all my attempts at using the
standard dependency syntax in that file have failed for me.
So, in order to make this happen, let's move all the dependencies from a
more-or-less ad-hoc collection of files to this declarative approach
right in setup.cfg. That way, the deps are listed on a single place, in
a declarative manner, and as a result, the installation is now a trivial
pip oneliner.
As a result, one can also remove that duplication of dependencies in
docs requirements.
[1] https://tox.wiki/en/4.11.4/upgrading.html#reuse-of-environments
[2] https://tox.wiki/en/4.11.4/upgrading.html#packaging-configuration-and-inheritance
Change-Id: I34aa0c71e993b39e2b805a7de40e133b4d290318
Fixes: 47c89626 fix docs requirements
This commit is contained in:
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@@ -106,8 +106,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- run: |
|
||||
pip install -r tests/requirements.txt
|
||||
pip install --editable .
|
||||
pip install --editable .[tests]
|
||||
pytest -vv
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -136,8 +135,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- run: |
|
||||
pip install -r tests/requirements.txt
|
||||
pip install --editable .
|
||||
pip install --editable .[tests]
|
||||
pytest -vv
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
@@ -2,4 +2,3 @@ build:
|
||||
image: latest
|
||||
python:
|
||||
version: 3.8
|
||||
requirements_file: docs/requirements.txt
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
alabaster>=0.7.12,<1
|
||||
docutils>=0.17.1,<1
|
||||
matplotlib>=3.7.3,<4
|
||||
myst-parser>=0.16.1,<1
|
||||
networkx>=3.1,<4
|
||||
numpy>=1.24.4,<2
|
||||
Pygments>=2.11.2,<3
|
||||
rstcheck
|
||||
scipy>=1.10.1,<2
|
||||
Sphinx>=5.3.0,<6
|
||||
sphinxcontrib-bibtex>=2.4.1,<3
|
||||
xlrd>=1.2.0,<2
|
||||
@@ -1,11 +0,0 @@
|
||||
# matplotlib 3.8 removed support for Python 3.8
|
||||
matplotlib>=3.7.3,<4
|
||||
# networkx 3.2 removed support for Python 3.8
|
||||
networkx>=3.1,<4
|
||||
# numpy 1.25 removed support for Python 3.8
|
||||
numpy>=1.24.4,<2
|
||||
pbr>=6.0.0,<7
|
||||
# scipy 1.11 removed support for Python 3.8
|
||||
scipy>=1.10.1,<2
|
||||
# xlrd 2.x removed support for .xlsx, it's only .xls now
|
||||
xlrd>=1.2.0,<2
|
||||
32
setup.cfg
32
setup.cfg
@@ -49,3 +49,35 @@ console_scripts =
|
||||
gnpy-transmission-example = gnpy.tools.cli_examples:transmission_main_example
|
||||
gnpy-path-request = gnpy.tools.cli_examples:path_requests_run
|
||||
gnpy-convert-xls = gnpy.tools.convert:_do_convert
|
||||
|
||||
[options]
|
||||
install_requires =
|
||||
# matplotlib 3.8 removed support for Python 3.8
|
||||
matplotlib>=3.7.3,<4
|
||||
# networkx 3.2 removed support for Python 3.8
|
||||
networkx>=3.1,<4
|
||||
# numpy 1.25 removed support for Python 3.8
|
||||
numpy>=1.24.4,<2
|
||||
pbr>=6.0.0,<7
|
||||
# scipy 1.11 removed support for Python 3.8
|
||||
scipy>=1.10.1,<2
|
||||
# xlrd 2.x removed support for .xlsx, it's only .xls now
|
||||
xlrd>=1.2.0,<2
|
||||
|
||||
[options.extras_require]
|
||||
tests =
|
||||
build>=1.0.3,<2
|
||||
pytest>=7.4.3,<8
|
||||
# pandas 2.1 removed support for Python 3.8
|
||||
pandas>=2.0.3,<3
|
||||
# flake v6 killed the --diff option
|
||||
flake8>=5.0.4,<6
|
||||
|
||||
docs =
|
||||
alabaster>=0.7.12,<1
|
||||
docutils>=0.17.1,<1
|
||||
myst-parser>=0.16.1,<1
|
||||
Pygments>=2.11.2,<3
|
||||
rstcheck
|
||||
Sphinx>=5.3.0,<6
|
||||
sphinxcontrib-bibtex>=2.4.1,<3
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
build>=1.0.3,<2
|
||||
pytest>=7.4.3,<8
|
||||
# pandas 2.1 removed support for Python 3.8
|
||||
pandas>=2.0.3,<3
|
||||
|
||||
# flake v6 killed the --diff option
|
||||
flake8>=5.0.4,<6
|
||||
6
tox.ini
6
tox.ini
@@ -2,9 +2,8 @@
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
extras = tests
|
||||
deps =
|
||||
-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/tests/requirements.txt
|
||||
cover: pytest-cov
|
||||
linters: flake8
|
||||
linters: pep8-naming
|
||||
@@ -22,8 +21,7 @@ commands =
|
||||
python -m build
|
||||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
-r{toxinidir}/docs/requirements.txt
|
||||
extras = docs
|
||||
allowlist_externals =
|
||||
/bin/sh
|
||||
commands =
|
||||
|
||||
Reference in New Issue
Block a user