From 7f512d16bc38f85a21dd4708ddbf93ab33c5d248 Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Jun 25 2025 03:01:24 +0000 Subject: Switch to %pyproject_* macros Drop setuptools support and relevant cleanup. Only Python 3.6 and older environments still rely on setuptools so it can't be completely removed yet. Add python 3.14 classifiers and test environment. JIRA: RHELCMP-14595 Signed-off-by: Ondřej Nosek --- diff --git a/jenkins_test.dockerfile b/jenkins_test.dockerfile index 40eb410..14f3477 100644 --- a/jenkins_test.dockerfile +++ b/jenkins_test.dockerfile @@ -33,4 +33,4 @@ WORKDIR /src COPY . . -CMD ["tox", "-e", "py36,py39,py312,py313,flake8,bandit"] +CMD ["tox", "-e", "py36,py39,py312,py313,py314,flake8,bandit"] diff --git a/pyproject.toml b/pyproject.toml index 111f2e7..1e85f7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,19 +25,20 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ "argcomplete", - "cccolutils >= 1.4", + "cccolutils", "GitPython", - "koji >= 1.15", + "koji", "pycurl", "PyYAML", "requests", "rpm", - "six >= 1.9.0", + "six", ] [project.urls] @@ -52,7 +53,6 @@ exclude = [ "/doc/source/_static", ] only-exclude = [ - ".gitignore", "/doc/source/cli.rst", "/doc/source/man_pages.json", ] diff --git a/requirements/README.rst b/requirements/README.rst index 1c2ed3a..4e94bca 100644 --- a/requirements/README.rst +++ b/requirements/README.rst @@ -1,15 +1,6 @@ Requirements ============ -* fedora-py2.txt: contains Python 2 packages that are required to run rpkg and - tests, those are needed to be installed via package manager. - -* fedora-py3.txt: contains Python 3 packages that are required to run rpkg and - tests, those are needed to be installed via package manager. - * pypi.txt: contains Python packages that can be installed from PyPI via ``pip``. Some of required packages are not available in PyPI as of writing this README file. They has to be installed from package manager too. - -* fedora-cli-tools.txt: contains command line tools that rpkg executes them in - various commands, e.g. rpmlint, rpmbuild and mock. diff --git a/requirements/fedora-cli-tools.txt b/requirements/fedora-cli-tools.txt deleted file mode 100644 index 5209cc7..0000000 --- a/requirements/fedora-cli-tools.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Command line tools needed for running specific commands - -copr-cli -mock -rpm-build -rpmlint -module-build-service # needed for the module-buld-local command diff --git a/requirements/fedora-py2.txt b/requirements/fedora-py2.txt deleted file mode 100644 index ae24efa..0000000 --- a/requirements/fedora-py2.txt +++ /dev/null @@ -1,19 +0,0 @@ -libmodulemd -python2-cccolutils -python2-GitPython -python2-gobject-base -python2-koji -python2-pycurl -python-six -python2-rpm # rpm-python originally -python2-requests -PyYAML -# python2-openidc-client # used for MBS OIDC authentication -# python2-requests-gssapi # used for MBS Kerberos authentication - -# For running tests -python2-coverage -python2-flake8 -python2-mock -python2-rpmfluff -python2-openidc-client # used in MBS tests diff --git a/requirements/fedora-py3.txt b/requirements/fedora-py3.txt deleted file mode 100644 index 0cd8979..0000000 --- a/requirements/fedora-py3.txt +++ /dev/null @@ -1,18 +0,0 @@ -libmodulemd -python3-cccolutils -python3-GitPython -python3-gobject-base -python3-koji -python3-pycurl -python3-six -python3-rpm # rpm-python originally -python3-requests -python3-yaml -# python3-openidc-client # used for MBS OIDC authentication -# python3-requests-gssapi # used for MBS Kerberos authentication - -# For running tests -python3-coverage -python3-flake8 -python3-rpmfluff -python3-openidc-client # used in MBS tests diff --git a/requirements/pypi.txt b/requirements/pypi.txt index a1aa87d..01968d5 100644 --- a/requirements/pypi.txt +++ b/requirements/pypi.txt @@ -1,20 +1,11 @@ # List of Python packages that can be installed from PyPI. -cccolutils >= 1.4 +cccolutils GitPython -koji >= 1.15 +koji pycurl -six >= 1.9.0 +six requests rpm PyYAML argcomplete - -# rpm-py-installer -# -# Or, install from rpm-py-installer internal installer -# https://github.com/junaruga/rpm-py-installer#install-directly-without-rpm-py-installer-package -# python -c "$(curl -fsSL https://raw.githubusercontent.com/junaruga/rpm-py-installer/master/install.py)" - -# openidc-client # used for MBS OIDC authentication -# requests-gssapi # used for MBS Kerberos authentication diff --git a/setup.cfg b/setup.cfg index 20ee6da..6c18141 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,8 +5,4 @@ test = pytest max-line-length = 100 [tool:pytest] -# additional values for 'addopts' can be: -# --cov-report html -# -ra -q -addopts = --cov=pyrpkg testpaths = tests diff --git a/setup.py b/setup.py index d422730..65c71d1 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ from setuptools import find_packages, setup def read_requirements(requirements_file): specifiers = [] - dep_links = [] def read_lines(): with open(requirements_file, 'r') as f: @@ -18,21 +17,17 @@ def read_requirements(requirements_file): yield line for line in read_lines(): - if line.startswith('git+'): - dep_links.append(line) - else: - specifiers.append(line) + specifiers.append(line) - return specifiers, dep_links + return specifiers setup_py_path = os.path.dirname(os.path.realpath(__file__)) pypi_txt = os.path.join(setup_py_path, 'requirements', 'pypi.txt') test_pypi_txt = os.path.join(setup_py_path, 'requirements', 'test-pypi.txt') -install_requires, dep_links = read_requirements(pypi_txt) -tests_require, test_dep_links = read_requirements(test_pypi_txt) -dep_links += test_dep_links +install_requires = read_requirements(pypi_txt) +tests_require = read_requirements(test_pypi_txt) readme_rst = os.path.join(setup_py_path, 'README.rst') with open(readme_rst, 'r') as readme: @@ -49,10 +44,8 @@ setup( license="GPLv2+", url="https://pagure.io/rpkg", packages=find_packages(), - setup_requires=['setuptools_scm', 'pytest-runner'], install_requires=install_requires, tests_require=tests_require, - dependency_links=dep_links, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -67,6 +60,7 @@ setup( 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Libraries :: Python Modules', ], diff --git a/tox.ini b/tox.ini index 6fb76fd..ccbdac2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36,py39,py312,py313,flake8,doc,bandit +envlist = py27,py36,py39,py312,py313,py314,flake8,doc,bandit [testenv] skip_install = True @@ -10,6 +10,7 @@ basepython= py39: {env:TOXPYTHON:python3.9} py312: {env:TOXPYTHON:python3.12} py313: {env:TOXPYTHON:python3.13} + py314: {env:TOXPYTHON:python3.14} flake8: {env:TOXPYTHON:python3.6} flake8python2: {env:TOXPYTHON:python2.7} doc: {env:TOXPYTHON:python3} @@ -42,6 +43,10 @@ sitepackages=true # allow gi & libmodulemd for flatpak tests. System libraries are available for Python 3.13 sitepackages=true +[testenv:py314] +# allow gi & libmodulemd for flatpak tests. System libraries are available for Python 3.14 +sitepackages=true + [testenv:flake8] skip_install = True deps = flake8