Skip to content

Commit

Permalink
Switch from using setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Nov 18, 2024
1 parent 44817b4 commit bf1e88d
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 119 deletions.
4 changes: 3 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ values =

[bumpversion:file:./pulpcore/app/apps.py]

[bumpversion:file:./setup.py]
[bumpversion:file:./pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:pulp_file/app/__init__.py]

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-393-g0e700c1
2021.08.26-394-gd21e6ea
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
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ graft pulpcore/etc
graft pulp_certguard/tests/functional/artifacts
exclude .gitleaks.toml
include LICENSE
include requirements.txt
include pyproject.toml
include CHANGES.md
include COMMITMENT
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/guides/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ git+https://github.com/pulp/pulpcore@refs/pull/1234/head
git+https://github.com/pulp/pulpcore@refs/heads/main
```

to `ci_requirements.txt` in the plugin PR. Make sure that file is covered by `MANIFEST.in`. Also
bump the requirement on `pulpcore` in `requirements.txt` to at least the current `dev` version if
you want to be sure the `lower bounds` scenario passes.
to `ci_requirements.txt` in the plugin PR. Make sure that file is covered by `MANIFEST.in`.
Also bump the requirement on `pulpcore` in `requirements.txt` or `pyproject.toml` to at least the current `dev` version
if you want to be sure the `lower bounds` scenario passes.

This works accordingly for depending on other plugins.

Expand Down
11 changes: 6 additions & 5 deletions docs/dev/guides/plugin-walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ See `writing-tasks`. Almost all plugins must implement a `sync` task, most imple

## Plugin Completeness Checklist

- `Plugin django app is defined using PulpAppConfig as a parent <plugin-django-application>`
- `Plugin entry point is defined <plugin-entry-point>`
- [pulpcore is specified as a requirement](https://github.com/pulp/pulp_rpm/blob/main/requirements.txt#L6)
- Necessary models/serializers/viewsets are `defined <subclassing-general>` and `discoverable <mvs-discovery>`. At a minimum:
- Plugin django app is defined using PulpAppConfig as a parent
- Plugin entry point is defined
- `pulpcore` is specified as a requirement
- Necessary models/serializers/viewsets are defined and discoverable.
At a minimum:
- models for plugin content type, remote, publisher
- serializers for plugin content type, remote, publisher
- viewset for plugin content type, remote, publisher
- `Errors are handled according to Pulp conventions <error-handling-basics>`
- Errors are handled according to Pulp conventions
- Docs for plugin are available (any location and format preferred and provided by plugin writer)
102 changes: 102 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,108 @@ requires = [
]
build-backend = 'setuptools.build_meta'

[project]
name = "pulpcore"
version = "3.68.0.dev"
description = "Pulp Django Application and Related Modules"
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",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.9"
dependencies = [
"aiodns>=3.0,<=3.2.0",
"aiofiles>=22.1,<24.2.0",
"aiohttp>=3.8.1,<3.10.11",
"asyncio-throttle>=1.0,<=1.0.2",
"async-timeout>=4.0.3,<4.0.4;python_version<'3.11'",
"backoff>=2.1.2,<2.2.2",
"click>=8.1.0,<=8.1.7",
"cryptography>=38.0.1,<43.0.4",
"Django~=4.2.0", # LTS version, switch only if we have a compelling reason to",
"django-filter>=23.1,<=24.3",
"django-guid>=3.3,<=3.5.0",
"django-import-export>=2.9,<3.4.0",
"django-lifecycle>=1.0,<=1.2.4",
"djangorestframework>=3.14.0,<=3.15.2",
"djangorestframework-queryfields>=1.0,<=1.1.0",
"drf-access-policy>=1.1.2,<1.5.1",
"drf-nested-routers>=0.93.4,<=0.94.1",
"drf-spectacular==0.27.2", # We monkeypatch this so we need a very narrow requirement string
"dynaconf>=3.1.12,<3.3.0",
"gunicorn>=20.1,<23.1.0",
"importlib-metadata>=6.0.1,<=6.0.1", # Pinned to fix opentelemetry dependency solving issues with pip
"jinja2>=3.1,<=3.1.4",
"json_stream>=2.3.2,<2.4",
"jq>=1.6.0,<1.9.0",
"PyOpenSSL<25.0",
"opentelemetry-api>=1.27.0,<1.28",
"opentelemetry-sdk>=1.27.0,<1.28",
"opentelemetry-exporter-otlp-proto-http>=1.27.0,<1.28",
"protobuf>=4.21.1,<5.0",
"pulp-glue>=0.18.0,<0.30",
"pygtrie>=2.5,<=2.5.0",
"psycopg[binary]>=3.1.8,<=3.2.3",
"pyparsing>=3.1.0,<=3.2.0",
"python-gnupg>=0.5,<=0.5.3",
"PyYAML>=5.1.1,<=6.0.2",
"redis>=4.3,<5.2.1",
"tablib<3.6.0",
"url-normalize>=1.4.3,<=1.4.3",
"uuid6>=2023.5.2,<=2024.7.10",
"whitenoise>=5.0,<6.9.0",
"yarl>=1.8,<1.17.2",
]

[project.optional-dependencies]
sftp = ["django-storages[sftp]==1.14.4"]
s3 = ["django-storages[boto3]==1.14.3"]
google = ["django-storages[google]==1.14.3"]
azure = ["django-storages[azure]==1.14.3"]
prometheus = ["django-prometheus"]
kafka = [
# Pinned because project warns "things might (and will) break with every update"
"cloudevents==1.11.0",
"confluent-kafka>=2.4.0,<2.7.0",
]

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

[project.scripts]
pulpcore-manager = "pulpcore.app.manage:manage"
pulpcore-worker = "pulpcore.tasking.entrypoint:worker"
pulpcore-api = "pulpcore.app.entrypoint:main"
pulpcore-content = "pulpcore.content.entrypoint:main"

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

[project.entry-points."pytest11"]
pulpcore = "pulpcore.pytest_plugin"
pulp_file = "pulp_file.pytest_plugin"
pulp_certguard = "pulp_certguard.pytest_plugin"

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

[tool.towncrier]
package = "pulpcore"
filename = "CHANGES.md"
Expand Down
41 changes: 0 additions & 41 deletions requirements.txt

This file was deleted.

64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

0 comments on commit bf1e88d

Please sign in to comment.