diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dcf52ee9..d4259c40 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,18 +16,28 @@ Changelog .. Release notes for existing releases are MUTABLE! If there is something that was missed or can be improved, feel free to change it! -Unreleased ----------- +[unreleased] +------------ + +Added +~~~~~ + +* CI jobs for checking compatibility with python 3.12 Removed ~~~~~~~ -* Support for Python3.8 is dropped +* Support for Python 3.8 is dropped * Removed all support for the retired Murano project * Removed all support for the retired Sahara project - * Removed all support for the retired Senlin project +Changed +~~~~~~~ + +* Implements pep-517 (pyproject.toml) and replaces pbr dependency + with setuptools-scm + [3.0.0] - 2024-05-23 -------------------- diff --git a/devstack/lib/rally b/devstack/lib/rally index fdf3fa3e..0b11e492 100644 --- a/devstack/lib/rally +++ b/devstack/lib/rally @@ -90,7 +90,7 @@ EOF # install_rally() - Collect source and prepare function install_rally() { - setup_develop $RALLY_DIR + setup_package $RALLY_DIR -e } # configure_rally() - Set config files, create data dirs, etc diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3af0e27e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +[project] +name = "rally-openstack" +description = "Rally plugins for OpenStack platform" +authors = [ + {name = "OpenStack", email = "openstack-discuss@lists.openstack.org"}, +] +readme = "README.rst" +license = { text = "Apache License, Version 2.0"} +classifiers = [ + "Environment :: OpenStack", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: Apache Software License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dynamic = ["version", "dependencies"] +requires-python = ">=3.9" + +[project.urls] +Homepage = "https://docs.openstack.org/rally/latest/" + +[build-system] +requires = [ + "setuptools>=64", + "setuptools_scm>=8" +] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools_scm] +local_scheme = "no-local-version" + +[tool.setuptools.packages.find] +where = ["."] +include = ["rally_openstack*"] +exclude = ["tests"] + +[project.entry-points."rally_plugins"] +path = "rally_openstack" +options = "rally_openstack.common.cfg.opts:list_opts" + +[project.entry-points."oslo.config.opts"] +rally_openstack = "rally_openstack.common.cfg.opts:list_opts" \ No newline at end of file diff --git a/rally_openstack/__init__.py b/rally_openstack/__init__.py index a6a173f6..52d2c6ca 100644 --- a/rally_openstack/__init__.py +++ b/rally_openstack/__init__.py @@ -12,17 +12,37 @@ # License for the specific language governing permissions and limitations # under the License. -import pbr.version +from importlib.metadata import version as _version + from rally.common import version as __rally_version__ from rally_openstack import _compat -__rally_version__ = __rally_version__.version_info.semantic_version() -__rally_version__ = __rally_version__.version_tuple() -__version_info__ = pbr.version.VersionInfo("rally-openstack") -__version__ = __version_info__.version_string() -__version_tuple__ = __version_info__.semantic_version().version_tuple() +if hasattr(__rally_version__, "__version_tuple__"): + __rally_version__ = __rally_version__.__version_tuple__ +else: + __rally_version__ = __rally_version__.version_info.semantic_version() + __rally_version__ = __rally_version__.version_tuple() + +try: + # Try to get version from installed package metadata + __version__ = _version("rally-openstack") +except Exception: + # Fallback to setuptools_scm for development installs + try: + from setuptools_scm import get_version # type: ignore[import-untyped] + + __version__ = get_version() + except Exception: + # Final fallback - this should rarely happen + __version__ = "0.0.0" + + +__version_tuple__ = tuple( + int(p) if p.isdigit() else p + for p in __version__.replace("-", ".").split(".") +) # WARNING: IF YOU ARE LOOKING FOR SOME PHYSICALLY UNEXISTING MODULES THAT CAN diff --git a/requirements.txt b/requirements.txt index 90f7bcaa..ca77194a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,7 @@ -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - requests!=2.20.0,!=2.24.0 # Apache-2.0 rally>=4.1.0 # Apache License, Version 2.0 +setuptools_scm # OpenStack related gnocchiclient # Apache Software License diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 52392eae..00000000 --- a/setup.cfg +++ /dev/null @@ -1,34 +0,0 @@ -[metadata] -name = rally-openstack -summary = Rally plugins for OpenStack platform -description_file = - README.rst -author = OpenStack -author_email = openstack-discuss@lists.openstack.org -home_page = https://docs.openstack.org/rally/latest/ -license = Apache License, Version 2.0 -python_requires = >=3.9 -classifier = - Environment :: OpenStack - Intended Audience :: Developers - Intended Audience :: Information Technology - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - -[files] -packages = - rally_openstack - -[entry_points] -rally_plugins = - path = rally_openstack - options = rally_openstack.common.cfg.opts:list_opts -oslo.config.opts = - rally_openstack = rally_openstack.common.cfg.opts:list_opts diff --git a/setup.py b/setup.py deleted file mode 100644 index 0cdc8c2e..00000000 --- a/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import setuptools - -setuptools.setup( - setup_requires=['pbr>=1.8'], - pbr=True) diff --git a/tox.ini b/tox.ini index 2e131db8..f43d9dde 100644 --- a/tox.ini +++ b/tox.ini @@ -46,7 +46,12 @@ commands = ansible-lint --strict --config-file tests/ci/playbooks/.ansible-lint deps = -r{toxinidir}/test-requirements.txt skip_install = true commands = flake8 -distribute = false + +[testenv:mypy] +skip_install = true +deps = {[testenv]deps} + -r{toxinidir}/types-requirements.txt +commands = mypy {posargs:"rally_openstack"} [testenv:venv] basepython = python3 @@ -132,10 +137,7 @@ filterwarnings = error ignore:the imp module is deprecated in favour of importlib.*:DeprecationWarning # we do not use anything inner from OptionParser, so we do not care about it's parent - ignore:The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.:DeprecationWarning: - # we do not use Option directly, it is initialized by OptionParser by itself. - # as soon as docutils team get rid of frontend.Option, they will also fix OptionParser - ignore: The frontend.Option class will be removed in Docutils 0.21 or later.:DeprecationWarning: + ignore:The frontend.Option.* class will be.*:DeprecationWarning: # raised by designateclient?! ignore:dns.hash module will be removed in future versions. Please use hashlib instead.:DeprecationWarning # should be fixed at rally framework (raised by functional job)