Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic versioning with dependencies #150

Closed
jakekadir opened this issue Oct 18, 2023 · 1 comment
Closed

Dynamic versioning with dependencies #150

jakekadir opened this issue Oct 18, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@jakekadir
Copy link

I have several packages, all of which are published together with the same Git version tag. I'm looking to dynamically update pyproject.toml to change these dependencies' version numbers to the same as the project version. For example, package A (which depends on packages B and C) with version 1.1.1 should depend on B v1.1.1 and C v1.1.1.

I have attempted this by adding files=["pyproject.toml"] with the relevant regex pattern, and the dependency versions are correctly updated. However, when the changes are reverted, the package version number isn't reset to 0.0.0 and dynamic versioning's enable is left as false. The dependencies' versions are successfully reset to their placeholder value. This seems to be because the package version in pyproject.toml and the user-given files are updated and reverted separately, so whichever is reverted last is left as the remaining file.

@mtkennerly mtkennerly added question Further information is requested bug Something isn't working and removed question Further information is requested labels Oct 27, 2023
@mtkennerly
Copy link
Owner

This seems to be because the package version in pyproject.toml and the user-given files are updated and reverted separately, so whichever is reverted last is left as the remaining file.

Good catch! The current order is: modify pyproject.toml version and enable -> for each substitution, record original state and apply changes -> revert version/enable -> revert substitutions. That doesn't work correctly for substitutions in pyproject.toml because the "original state" is being recorded too late.

I'll publish a fix for this.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants