From ea9cefce2555f6442f942d038868db94e2c888f6 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 24 Oct 2024 18:21:09 +0900 Subject: [PATCH] Use requirements.txt solely to manage dependencies ... to follow the standard method to manage dependencies. Also apply global upper constraints to use the consistent dependencies. Note that releasenotes target is still broken at this stage and needs further work. Change-Id: I8dfc5f1b621010364567e241c9e619c710faa6af --- doc/requirements.txt | 3 +++ requirements.txt | 5 +++-- setup.cfg | 12 ------------ test-requirements.txt | 2 ++ tox.ini | 37 +++++++++++++++++++++++-------------- 5 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..953f333 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,3 @@ +sphinx>=2.1.1 # BSD +openstackdocstheme>=2.2.1 # Apache-2.0 +reno>=1.6.2 # Apache-2.0 diff --git a/requirements.txt b/requirements.txt index 3f333b7..485a1ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ osc-lib>=1.0.1 # Apache-2.0 -keystoneauth1>=1.0.0 -cliff>=1.14.0 # Apache-2.0 +keystoneauth1>=1.0.0 # Apache-2.0 +cliff>=1.14.0 # Apache-2.0 +PyYAML>5.1 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 92dc085..b85054b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,11 +8,6 @@ author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://infrawatch.github.io/documentation/ python_requires = >=3.8 -install_requires = - keystoneauth1 - osc-lib - requests - PyYaml classifier = Environment :: Console Environment :: OpenStack @@ -34,13 +29,6 @@ classifier = packages = observabilityclient -[options.extras_require] -doc = - reno>=1.6.2 # Apache2 -test = - tempest>=10 - testtools>=1.4.0 - [entry_points] openstack.cli.extension = observabilityclient = observabilityclient.plugin diff --git a/test-requirements.txt b/test-requirements.txt index 915c41a..dac65be 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,5 @@ python-openstackclient>=6.3.0 # Apache-2.0 os-client-config>=1.28.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 +tempest>=10 # Apache-2.0 +testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index 6a02c45..ec7296b 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,10 @@ setenv = passenv = PROMETHEUS_* OBSERVABILITY_* -deps = .[test] +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} --test-path {env:OS_TEST_PATH} @@ -23,28 +26,26 @@ deps = hacking<3.1.0,>=3.0 commands = flake8 [testenv:venv] -deps = .[test,doc] commands = {posargs} [testenv:cover] -deps = {[testenv]deps} - pytest-cov +deps = + {[testenv]deps} + pytest-cov commands = observabilityclient {posargs} {env:$OS_TEST_PATH} [testenv:functional] setenv = - OS_TEST_PATH = ./observabilityclient/tests/functional - OS_TESTENV_NAME = {envname} + OS_TEST_PATH = ./observabilityclient/tests/functional + OS_TESTENV_NAME = {envname} allowlist_externals = - bash -deps = .[test] - pytest - -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt + bash +deps = + {[testenv]deps} + pytest commands = - bash tools/fix_ca_bundle.sh - stestr run --slowest {posargs} --test-path {env:OS_TEST_PATH} - + bash tools/fix_ca_bundle.sh + stestr run --slowest {posargs} --test-path {env:OS_TEST_PATH} [flake8] show-source = True @@ -81,3 +82,11 @@ application-import-names = observabilityclient [pytest] addopts = --verbose norecursedirs = .tox + +[testenv:releasenotes] +deps = + -r{toxinidir}/doc/requirements.txt + -r{toxinidir}/requirements.txt +allowlist_externals = + sphinx-build +commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html