Skip to content

chore: consolidate package metadata into pyproject.toml (PEP 621)#473

Open
erdemtuna wants to merge 8 commits intoAdyen:mainfrom
erdemtuna:feature/471-consolidate-pyproject
Open

chore: consolidate package metadata into pyproject.toml (PEP 621)#473
erdemtuna wants to merge 8 commits intoAdyen:mainfrom
erdemtuna:feature/471-consolidate-pyproject

Conversation

@erdemtuna
Copy link
Copy Markdown

Summary

Make pyproject.toml the single source of truth for all package metadata (PEP 621), eliminating the duplication between setup.py and pyproject.toml that caused the pydantic dependency bug (PR #468).

Changes

File Change
setup.py Replace 45-line metadata file with 2-line minimal shim
pyproject.toml Add [project.urls], [tool.setuptools.packages.find], bump setuptools>=61.0.0
Makefile Install target uses pyproject.toml extras: pip install -e ".[requests,test,dev]"
release.yml Remove setup.py from version-files (shim has no version to bump)
lint.yml Cache key uses hashFiles('**/pyproject.toml') instead of setup.py

Motivation

Package metadata was duplicated across setup.py and pyproject.toml, which caused a real bug: pydantic>=2.0 was in pyproject.toml dependencies but missing from setup.py's install_requires (fixed in #468). This consolidation prevents that entire class of sync-related bugs.

Verification

  • ✅ All 162 tests pass (make tests)
  • ✅ Lint passes (make lint)
  • pip install . correctly installs pydantic
  • pip install -e ".[requests,test,dev]" works
  • setup.py contains zero version references
  • ✅ Release automation safe (perl s/// is a no-op on files with no match)

Out of Scope

  • VERSION file unchanged
  • setup.cfg unchanged
  • Adyen/settings.py unchanged
  • tox.ini unchanged (future improvement candidate)

Resolves #471

erdemtuna and others added 8 commits April 7, 2026 20:54
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CodeResearch.md: file:line mapping of all 5 target files plus verified-clean files
- ImplementationPlan.md: 2 phases (metadata consolidation + documentation)
- Single implementation phase — all changes are tightly coupled

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address feedback from 3-model plan review (GPT-5.4, Claude Opus, GPT-5.3-Codex):
- Add explicit SC-001 validation (pip install . + pydantic import)
- Add SC-003 built metadata inspection
- Remove conditional on build package availability
- Make SC-004 explicit (make install && make tests)
- Add FR traceability tags to all criteria
- Add Phase 2 dependency declaration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- S3: Fix P3 acceptance scenario to match FR-007 (setup.py removed from version-files)
- S5: Fix edge case factual error (build-system.requires doesn't apply to python setup.py install)
- S4: Reword NFR 'identical metadata' to allow intentional improvements (URLs, long_description)
- S1: Add pycurl exclusion assumption (requires system libcurl, tested via tox)

Cross-artifact review: 3-model (GPT-5.4, Claude Opus, GPT-5.3-Codex)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make pyproject.toml the single source of truth for all package metadata,
eliminating the duplication between setup.py and pyproject.toml that
caused the pydantic dependency bug (PR Adyen#468).

Changes:
- Simplify setup.py to minimal 2-line shim (FR-002)
- Bump build-system.requires to setuptools>=61.0.0 (FR-005)
- Add [project.urls] with Homepage/Repository/Issues (FR-004)
- Add [tool.setuptools.packages.find] with include=["Adyen*"] (FR-003)
- Update Makefile install to use pyproject.toml extras (FR-006)
- Remove setup.py from release.yml version-files (FR-007)
- Update lint.yml cache key to hash pyproject.toml (FR-008)

Resolves Adyen#471

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Docs.md captures as-built state: what changed, why, verification approach
- Update ImplementationPlan.md phase status to complete

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Artifact lifecycle: commit-and-clean — remove .paw/ from git index
before final PR. Artifacts remain on disk for reference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@erdemtuna erdemtuna requested a review from a team as a code owner April 7, 2026 19:01
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates project metadata and configuration from setup.py to pyproject.toml, simplifying the setup.py file to a minimal stub. It also updates the Makefile to utilize editable installs with extras and adds .paw/ to the .gitignore file. Feedback points out that the updated install target in the Makefile omits pycurl and coveralls, which were previously included in the default installation, potentially leading to an incomplete development environment.

@@ -1,5 +1,5 @@
install:
@pip install requests pycurl mock coveralls ruff
@pip install -e ".[requests,test,dev]"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The updated install target is missing pycurl and coveralls, which were previously installed by default.

  1. pycurl: This is defined as an optional dependency in pyproject.toml. To maintain the same development environment as before, it should be included in the extras list in the pip install command.
  2. coveralls: This dependency is missing from pyproject.toml entirely. To align with the goal of consolidating metadata, it should be added to the test or dev extras in pyproject.toml and then included here.

If these were intentionally removed from the default installation, please disregard this, but usually make install is expected to set up a complete environment for development and testing.

	@pip install -e ".[requests,pycurl,test,dev]"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both exclusions are intentional:

  1. pycurl: Requires system-level libcurl (libcurl4-openssl-dev) which is often not present on developer machines and causes install failures. It's adequately tested via tox's pycurl variant (tox -e py310-pycurl). Including it in make install would break the out-of-box dev setup on machines without libcurl.

  2. coveralls: Was a CI-only dependency not used in any local dev or test workflow — it's not in any pyproject.toml extras group and wasn't referenced in any Makefile target or CI workflow. Dropping it is intentional cleanup.

The new make install gives a complete local dev environment: editable install + requests + test deps + dev tools (ruff, pre-commit). Pycurl testing is handled by tox where the system dependency is explicitly set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: consolidate package metadata into pyproject.toml (PEP 621)

1 participant