-
Notifications
You must be signed in to change notification settings - Fork 23
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
Using tbump with pyproject.toml and poetry #93
Comments
Looks like a bug. Could you try and post a minimal example? |
To reproduce:
Output:
|
Oh, I know what's going on. There was something in the back of my head telling me that using You see, That means that in addition to the files listed in The code is here: def compute_change_requests(self) -> List[ChangeRequest]:
# When bumping files in a project, we need to bump:
# * every file listed in the config file
# * and the `current_version` value in tbump's config file
assert self.config_file
change_requests = []
for file in self.files:
change_request = self.compute_change_request_for_file(file)
change_requests.append(change_request)
rel_path = self.config_file.path.relative_to(self.working_path)
config_file_change = ChangeRequest(
str(rel_path),
self.current_version,
self.new_version,
)
change_requests.append(config_file_change) # <- here
return change_requests So when you use I guess nobody complained so far because if you are using tbump for a python project, it makes sense to bump the version of your project in I guess we should use [tool.poetry]
version = "1.2.3" # bumped by tbump's patch algorithm
[tool.tbump]
current = "1.2.3" # bump by tomlkit
[[tool.tbump.file]]
src = "pyproject.toml"
# tell the patch algorithm to only replace lines containing 'version ='
search = 'version = "{current_version}"' This is going to be hard to explain to existing tbump users :/ |
By the way, a search on GitHub shows a list two projects that would be impacted were we to fix this bug: https://github.com/ffreemt/deepl-fastapi and |
I would say The current "search and replace" everything is somewhat risky as it will at some point not just change the version in the poetry field but also a dependency. For example:
In this case tbump would also bump the dependency |
Not if you use
I don´t want to do that. If we encode something specifically for Python projects, tbump becomes less useful as a universal version bumper (which is kind of its raison d´être) If you really want to use a tool dedicated to bump versions for Python projects, there are better alternatives :) |
No, that is hard-coded somewhere in tbump. Not sure where though. |
A shadock is currently proud of you \o/ |
Hi there,
I am playing around with tbump and i notice that it does patch my pyproject.toml
without me having a
[[tool.tbump.file]]
entry for the pyproject.toml.How come?
The text was updated successfully, but these errors were encountered: