Skip to content

Fix dynamic version resolution in pyproject.toml#14395

Merged
giohappy merged 1 commit into
masterfrom
fix_pyproject_dynamic_version
Jun 29, 2026
Merged

Fix dynamic version resolution in pyproject.toml#14395
giohappy merged 1 commit into
masterfrom
fix_pyproject_dynamic_version

Conversation

@giohappy

Copy link
Copy Markdown
Contributor

No description provided.

@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Jun 29, 2026
@giohappy giohappy added backport 5.1.x and removed cla-signed CLA Bot: community license agreement signed labels Jun 29, 2026
@giohappy giohappy requested a review from etj June 29, 2026 15:22

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

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.

Code Review

This pull request updates the dynamic version configuration in pyproject.toml to use geonode.get_version instead of geonode.__version__. However, because setuptools does not execute callables when using the attr directive, referencing a function directly will cause an InvalidVersion error during build and installation. It is recommended to assign the output of get_version() to a string attribute and reference that attribute instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pyproject.toml Outdated
setuptools resolves the dynamic version attr by reading geonode.__version__
directly. That attribute is a tuple (e.g. (5, 1, 0, 'final', 0)); setuptools
normalises a non-string attr by joining it with dots, producing an invalid
PEP 440 version like '5.1.0.final.0' and breaking the wheel build.

Expose a plain string attribute __version_str__ = get_version() in
geonode/__init__.py and point the dynamic version at it, so setuptools reads
an already-normalised version string (e.g. '5.1.0').
@giohappy giohappy force-pushed the fix_pyproject_dynamic_version branch from 38aecc2 to 5a50f0b Compare June 29, 2026 15:31
@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Jun 29, 2026
@giohappy giohappy merged commit a2dda2e into master Jun 29, 2026
8 of 9 checks passed
@giohappy giohappy deleted the fix_pyproject_dynamic_version branch June 29, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 5.1.x cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants