Skip to content

Commit

Permalink
Merge pull request #768 from mdellweg/pyproject
Browse files Browse the repository at this point in the history
Switch away from setup.py
  • Loading branch information
mdellweg authored Nov 27, 2024
2 parents 9afd90b + ce8ffe8 commit 1ddd46d
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 140 deletions.
5 changes: 4 additions & 1 deletion .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def template_config():
def current_version(repo, commitish):
try:
pyproject_toml = tomllib.loads(repo.git.show(f"{commitish}:pyproject.toml"))
current_version = pyproject_toml["project"]["version"]
try:
current_version = pyproject_toml["project"]["version"]
except Exception:
current_version = pyproject_toml["tool"]["bumpversion"]["current_version"]
except Exception:
current_version = repo.git.grep(
"current_version", commitish, "--", ".bumpversion.cfg"
Expand Down
5 changes: 4 additions & 1 deletion .ci/scripts/check_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def main():
else:
if check_prereleases and req.specifier.prereleases:
# Do not even think about begging for more exceptions!
if req.name != "pulp-python-client":
if (
not req.name.startswith("opentelemetry")
and req.name != "pulp-python-client"
):
errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.")
ops = [spec.operator for spec in req.specifier]
if "~=" in ops:
Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-399-g78ad960
2021.08.26-403-g76d04d7
6 changes: 3 additions & 3 deletions .github/workflows/scripts/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/publish_plugin_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ then
fi

twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulp_python-$VERSION-py3-none-any.whl" \
"dist/pulp-python-$VERSION.tar.gz" \
dist/pulp?python-"$VERSION"-py3-none-any.whl \
dist/pulp?python-"$VERSION".tar.gz \
;
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Contributing

We have provided detailed documentation for ways in which you can
contribute to Pulp here:
https://docs.pulpproject.org/contributing/

This documentation includes:

* Suggestions of how to contribute
* How we track bugs
* Ways to get in touch with other contributors who can advise you
* A contribution checklist
* A developer guide

Join us! We look forward to hearing from you.
47 changes: 0 additions & 47 deletions CONTRIBUTING.rst

This file was deleted.

34 changes: 0 additions & 34 deletions HISTORY.rst

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include requirements.txt
include pyproject.toml
include CHANGES.md
include COMMITMENT
exclude CONTRIBUTING.md
include COPYRIGHT
include functest_requirements.txt
include test_requirements.txt
Expand Down
64 changes: 55 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
[build-system]
requires = [
"setuptools >= 40.8.0",
"wheel >= 0.29.0",
]
build-backend = 'setuptools.build_meta'

[project]
name = "pulp_python"
version = "3.13.0.dev"
description = "pulp-python plugin for the Pulp Project"
readme = "README.md"
authors = [
{name="Pulp Team", email="[email protected]"},
]
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",
]
requires-python = ">=3.9"
dependencies = [
"pulpcore>=3.49.0,<3.70",
"pkginfo>=1.10.0,<1.12.0", # Twine has <1.11 in their requirements
"bandersnatch>=6.3,<7.0", # Anything >6.3 requires Python 3.10+
"pypi-simple>=1.5.0,<2.0",
]

[project.urls]
Homepage = "https://pulpproject.org"
Documentation = "https://pulpproject.org/pulp_python/"
Repository = "https://github.com/pulp/pulp_python"
"Bug Tracker" = "https://github.com/pulp/pulp_python/issues"
Changelog = "https://pulpproject.org/pulp_python/changes/"

[project.entry-points."pulpcore.plugin"]
pulp_python = "pulp_python:default_app_config"

[project.entry-points."pytest11"]
pulp_python = "pulp_python.pytest_plugin"

[tool.setuptools.packages.find]
where = ["."]

[tool.towncrier]
package = "pulp_python"
filename = "CHANGES.md"
Expand All @@ -10,21 +58,15 @@ underlines = ["", "", ""]

[tool.check-manifest]
ignore = [
".bumpversion.cfg",
".pep8speaks.yml",
"CHANGES/**",
"CONTRIBUTING.rst",
"HISTORY.rst",
"dev_requirements.txt",
"doc_requirements.txt",
"docs/**",
"staging_docs/**",
"template_config.yml",
".travis/**",
".travis.yml",
".pep8speaks.yml",
"shelf_reader-0.1-py2-none-any.whl",
".github/**",
".ci/**",
".github/**",
"lint_requirements.txt",
".flake8",
]
Expand Down Expand Up @@ -58,4 +100,8 @@ search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "./setup.py"
# This section is managed by the plugin template. Do not edit manually.

filename = "./pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

0 comments on commit 1ddd46d

Please sign in to comment.