From 3e65260c4c33f6fec9b33553418008848ddc6802 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Mon, 18 Nov 2024 12:01:53 -0500 Subject: [PATCH] Switch from setup.py to pyproject.toml [noissue] --- .bumpversion.cfg | 4 +- .github/template_gitref | 2 +- .github/workflows/scripts/before_install.sh | 6 +-- MANIFEST.in | 1 - pyproject.toml | 46 +++++++++++++++++++++ requirements.txt | 9 ---- setup.py | 41 ------------------ 7 files changed, 53 insertions(+), 56 deletions(-) delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e6fadb422..0e2870831 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -16,4 +16,6 @@ values = [bumpversion:file:./pulp_rpm/app/__init__.py] -[bumpversion:file:./setup.py] +[bumpversion:file:./pyproject.toml] +search = version = "{current_version}" +replace = version = "{new_version}" diff --git a/.github/template_gitref b/.github/template_gitref index d37a43c86..6f3b6024b 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-393-g0e700c1 +2021.08.26-394-gd21e6ea diff --git a/.github/workflows/scripts/before_install.sh b/.github/workflows/scripts/before_install.sh index b0fdb789a..438f5e6eb 100755 --- a/.github/workflows/scripts/before_install.sh +++ b/.github/workflows/scripts/before_install.sh @@ -30,7 +30,7 @@ fi COMMIT_MSG=$(git log --format=%B --no-merges -1) export COMMIT_MSG -COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py) +COMPONENT_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") mkdir .ci/ansible/vars || true echo "---" > .ci/ansible/vars/main.yaml @@ -61,10 +61,10 @@ then fi if [[ "$TEST" = "pulp" ]]; then - python3 .ci/scripts/calc_constraints.py -u requirements.txt > upperbounds_constraints.txt + python3 .ci/scripts/calc_constraints.py -u pyproject.toml > upperbounds_constraints.txt fi if [[ "$TEST" = "lowerbounds" ]]; then - python3 .ci/scripts/calc_constraints.py requirements.txt > lowerbounds_constraints.txt + python3 .ci/scripts/calc_constraints.py pyproject.toml > lowerbounds_constraints.txt fi if [ -f $POST_BEFORE_INSTALL ]; then diff --git a/MANIFEST.in b/MANIFEST.in index 9402d5f95..19cfaa7e3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,7 +8,6 @@ include pulp_rpm/app/schema/* include pulp_rpm/tests/functional/sign-metadata.sh include pulp_rpm/tests/sample-rpm-0-0.x86_64.rpm include pyproject.toml -include requirements.txt include test_requirements.txt include unittest_requirements.txt exclude releasing.md diff --git a/pyproject.toml b/pyproject.toml index 1f59beb49..d86981c32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,52 @@ requires = [ ] build-backend = 'setuptools.build_meta' +[project] +name = "pulp-rpm" +version = "3.28.0.dev" +description = "Pulp plugin to manage RPM repositories" +readme = "README.rst" +authors = [ + {name="Pulp Rpm Plugin Project Developers", email="pulp-dev@redhat.com"} +] +classifiers = [ + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: POSIX :: Linux", + "Development Status :: 5 - Production/Stable", + "Framework :: Django", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +requires-python = ">=3.9" +dependencies = [ + "createrepo_c~=1.2", + "django_readonly_field~=1.1.1", + "jsonschema>=4.6,<5.0", + "libcomps>=0.1.20.post1,<0.2", + "productmd~=1.33.0", + "pulpcore>=3.49.11,<3.70", + "solv~=0.7.21", + "aiohttp_xmlrpc~=1.5.0", + "importlib-resources~=6.4.0", +] + +[project.urls] +Homepage = "https://pulpproject.org" +Documentation = "https://pulpproject.org/pulp_rpm/" +Repository = "https://github.com/pulp/pulp_rpm" +"Bug Tracker" = "https://github.com/pulp/pulp_rpm/issues" +Changelog = "https://pulpproject.org/pulp_rpm/changes/" + +[project.entry-points."pulpcore.plugin"] +pulp_rpm = "pulp_rpm:default_app_config" + +[tool.setuptools.packages.find] +where = ["."] + [tool.towncrier] package = "pulp_rpm" filename = "CHANGES.md" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1509821e9..000000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -createrepo_c~=1.2 -django_readonly_field~=1.1.1 -jsonschema>=4.6,<5.0 -libcomps>=0.1.20.post1,<0.2 -productmd~=1.33.0 -pulpcore>=3.49.11,<3.70 -solv~=0.7.21 -aiohttp_xmlrpc~=1.5.0 -importlib-resources~=6.4.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index f5a2ecd76..000000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 - -from setuptools import setup, find_packages - -with open("requirements.txt") as requirements: - requirements = requirements.readlines() - -with open("README.rst") as f: - long_description = f.read() - -setup( - name="pulp-rpm", - version="3.28.0.dev", - description="RPM plugin for the Pulp Project", - long_description=long_description, - license="GPLv2+", - author="Pulp Project Developers", - author_email="pulp-list@redhat.com", - url="http://www.pulpproject.org", - python_requires=">=3.9", - install_requires=requirements, - include_package_data=True, - packages=find_packages(exclude=["test"]), - classifiers=( - "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", - "Operating System :: POSIX :: Linux", - "Development Status :: 5 - Production/Stable", - "Framework :: Django", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - ), - entry_points={ - "pulpcore.plugin": [ - "pulp_rpm = pulp_rpm:default_app_config", - ], - }, -)