Skip to content

Commit 1ddd46d

Browse files
authored
Merge pull request #768 from mdellweg/pyproject
Switch away from setup.py
2 parents 9afd90b + ce8ffe8 commit 1ddd46d

File tree

12 files changed

+85
-140
lines changed

12 files changed

+85
-140
lines changed

.ci/scripts/check_release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ def template_config():
3737
def current_version(repo, commitish):
3838
try:
3939
pyproject_toml = tomllib.loads(repo.git.show(f"{commitish}:pyproject.toml"))
40-
current_version = pyproject_toml["project"]["version"]
40+
try:
41+
current_version = pyproject_toml["project"]["version"]
42+
except Exception:
43+
current_version = pyproject_toml["tool"]["bumpversion"]["current_version"]
4144
except Exception:
4245
current_version = repo.git.grep(
4346
"current_version", commitish, "--", ".bumpversion.cfg"

.ci/scripts/check_requirements.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def main():
6262
else:
6363
if check_prereleases and req.specifier.prereleases:
6464
# Do not even think about begging for more exceptions!
65-
if req.name != "pulp-python-client":
65+
if (
66+
not req.name.startswith("opentelemetry")
67+
and req.name != "pulp-python-client"
68+
):
6669
errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.")
6770
ops = [spec.operator for spec in req.specifier]
6871
if "~=" in ops:

.github/template_gitref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-399-g78ad960
1+
2021.08.26-403-g76d04d7

.github/workflows/scripts/before_install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fi
3030
COMMIT_MSG=$(git log --format=%B --no-merges -1)
3131
export COMMIT_MSG
3232

33-
COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py)
33+
COMPONENT_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
3434

3535
mkdir .ci/ansible/vars || true
3636
echo "---" > .ci/ansible/vars/main.yaml
@@ -61,10 +61,10 @@ then
6161
fi
6262

6363
if [[ "$TEST" = "pulp" ]]; then
64-
python3 .ci/scripts/calc_constraints.py -u requirements.txt > upperbounds_constraints.txt
64+
python3 .ci/scripts/calc_constraints.py -u pyproject.toml > upperbounds_constraints.txt
6565
fi
6666
if [[ "$TEST" = "lowerbounds" ]]; then
67-
python3 .ci/scripts/calc_constraints.py requirements.txt > lowerbounds_constraints.txt
67+
python3 .ci/scripts/calc_constraints.py pyproject.toml > lowerbounds_constraints.txt
6868
fi
6969

7070
if [ -f $POST_BEFORE_INSTALL ]; then

.github/workflows/scripts/publish_plugin_pypi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ then
2828
fi
2929

3030
twine upload -u __token__ -p "$PYPI_API_TOKEN" \
31-
"dist/pulp_python-$VERSION-py3-none-any.whl" \
32-
"dist/pulp-python-$VERSION.tar.gz" \
31+
dist/pulp?python-"$VERSION"-py3-none-any.whl \
32+
dist/pulp?python-"$VERSION".tar.gz \
3333
;

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Contributing
2+
3+
We have provided detailed documentation for ways in which you can
4+
contribute to Pulp here:
5+
https://docs.pulpproject.org/contributing/
6+
7+
This documentation includes:
8+
9+
* Suggestions of how to contribute
10+
* How we track bugs
11+
* Ways to get in touch with other contributors who can advise you
12+
* A contribution checklist
13+
* A developer guide
14+
15+
Join us! We look forward to hearing from you.

CONTRIBUTING.rst

Lines changed: 0 additions & 47 deletions
This file was deleted.

HISTORY.rst

Lines changed: 0 additions & 34 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include requirements.txt
33
include pyproject.toml
44
include CHANGES.md
55
include COMMITMENT
6+
exclude CONTRIBUTING.md
67
include COPYRIGHT
78
include functest_requirements.txt
89
include test_requirements.txt

pyproject.toml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 40.8.0",
4+
"wheel >= 0.29.0",
5+
]
6+
build-backend = 'setuptools.build_meta'
7+
8+
[project]
9+
name = "pulp_python"
10+
version = "3.13.0.dev"
11+
description = "pulp-python plugin for the Pulp Project"
12+
readme = "README.md"
13+
authors = [
14+
{name="Pulp Team", email="[email protected]"},
15+
]
16+
classifiers=[
17+
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
18+
"Operating System :: POSIX :: Linux",
19+
"Development Status :: 5 - Production/Stable",
20+
"Framework :: Django",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.9",
24+
]
25+
requires-python = ">=3.9"
26+
dependencies = [
27+
"pulpcore>=3.49.0,<3.70",
28+
"pkginfo>=1.10.0,<1.12.0", # Twine has <1.11 in their requirements
29+
"bandersnatch>=6.3,<7.0", # Anything >6.3 requires Python 3.10+
30+
"pypi-simple>=1.5.0,<2.0",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://pulpproject.org"
35+
Documentation = "https://pulpproject.org/pulp_python/"
36+
Repository = "https://github.com/pulp/pulp_python"
37+
"Bug Tracker" = "https://github.com/pulp/pulp_python/issues"
38+
Changelog = "https://pulpproject.org/pulp_python/changes/"
39+
40+
[project.entry-points."pulpcore.plugin"]
41+
pulp_python = "pulp_python:default_app_config"
42+
43+
[project.entry-points."pytest11"]
44+
pulp_python = "pulp_python.pytest_plugin"
45+
46+
[tool.setuptools.packages.find]
47+
where = ["."]
48+
149
[tool.towncrier]
250
package = "pulp_python"
351
filename = "CHANGES.md"
@@ -10,21 +58,15 @@ underlines = ["", "", ""]
1058

1159
[tool.check-manifest]
1260
ignore = [
13-
".bumpversion.cfg",
14-
".pep8speaks.yml",
1561
"CHANGES/**",
16-
"CONTRIBUTING.rst",
17-
"HISTORY.rst",
1862
"dev_requirements.txt",
1963
"doc_requirements.txt",
2064
"docs/**",
21-
"staging_docs/**",
2265
"template_config.yml",
23-
".travis/**",
24-
".travis.yml",
66+
".pep8speaks.yml",
2567
"shelf_reader-0.1-py2-none-any.whl",
26-
".github/**",
2768
".ci/**",
69+
".github/**",
2870
"lint_requirements.txt",
2971
".flake8",
3072
]
@@ -58,4 +100,8 @@ search = "version = \"{current_version}\""
58100
replace = "version = \"{new_version}\""
59101

60102
[[tool.bumpversion.files]]
61-
filename = "./setup.py"
103+
# This section is managed by the plugin template. Do not edit manually.
104+
105+
filename = "./pyproject.toml"
106+
search = "version = \"{current_version}\""
107+
replace = "version = \"{new_version}\""

0 commit comments

Comments
 (0)