-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Individual versioning using semver/commitizen #18179
Comments
This is similar to #15374 , whoever a simpler version that updates the version number of pyproject.toml files (or similar) with whatever version the user decides to pass. maybe there is a way with the experimental shell command?? Thanks in advance! |
Ok, moving a wee bit but I think I need a bit of guidance. I can update the version number of my dependent libraries providing this experimental_run_shell_command:
Whoever, I need to run this for each individual library. If library-1 and library-3 have changed. I need to run:
Ideally I just want to do:
I will try to make it a plugin (and play around that area) but would appreciate some guidance to see if I am going in the right direction. Thanks in advance!! |
Ok, got something close enough. I have created a plugin in the folder BUILD
register.py
target_types.py
rules.py
I have a macro in the pants-plugin folder with the following:
I can run the following commands no bother:
Whoever it will be ideal if I can somehow hook it with the python source files so that it bumps the pyproject.toml file when the code has changed. Currently the following command understandably only bumps the version of the files if they have changed.
Any ideas or examples on how to archive this? Should I have extended the pythonsource instead of creating a new target? (aka, have I gone the wrong route??) Thanks in advance! |
Is your feature request related to a problem? Please describe.
When packaging multiple libraries, I don't find a way to increase their version number (patch, minor, major) automatically. Currently it requires to remember to edit the
pyproject.toml
fileDescribe the solution you'd like
It would be ideal if the package command can automatically increase the version number depending on the commits by using commitizen or others.
Describe alternatives you've considered
Adding a plugin (probably better than a macro) might be able to archive this, but haven't had the time to explore that option.
The idea is that it will run just before the package command and increase the version number of any libraries that has changed.
Appreciate if you can provide more info in other ways and/or examples to archive this.
Additional context
We use poetry for our libraries, and have a mono repo that generates multiple libraries (for external systems to consume).
An example. If I got 3 pyproject.toml that then I publish as libraries, called A,B and C.
Assuming dependencies goes like this C -> B -> A. Meaning, B depends on A and C depends on B.
Does this make sense?
A bonus extra would be to detect what number to increase depending on the commit (using git commitizen or similar) but I can live without that
Our libraries have a poetry file like this:
Got a wee publish macro that looks like this:
Then in the folder for each library I have this in the BUILD file
The project structure is like this:
The only root source config I got in the pants.toml is
And added also this like to activate the macros
Thanks in advance!!
From this slack message
The text was updated successfully, but these errors were encountered: