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

file_pattern conflicts with dependencies #181

Closed
sparktx-adam-gleason opened this issue Jun 30, 2022 · 3 comments
Closed

file_pattern conflicts with dependencies #181

sparktx-adam-gleason opened this issue Jun 30, 2022 · 3 comments

Comments

@sparktx-adam-gleason
Copy link

I have the following file_patterns under `[tool.bumpver.file_patterns]' in my pyproject.toml file

  • "pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']

I'm seeing a conflict with dependencies running bumpver update --dry --minor command

...
-django-reversion = "5.0.0"
+django-reversion = "0.6.0"
...

'version = "{version}"' pattern is a subpattern within django-reversion = "5.0.0"

Is there a way to limit match to full pattern and not match a subpattern?

@mbarkhau
Copy link
Owner

mbarkhau commented Jul 1, 2022

I gave it a try to use regexp syntax in file patterns and the detection appears to work. The replacement however does not, as the regex characters are added as literals.

[bumpver:file_patterns]
setup.cfg =
    ^current_version = "{version}"$
 [bumpver]
-current_version = "2022.1117"
+^current_version = "2022.1118"$
 version_pattern = "YYYY.BUILD[-TAG]"

I've made a patch so it now strips replaces these characters before rewriting: ^$.

 [bumpver]
-current_version = "2022.1117"
+current_version = "2022.1118"
 version_pattern = "YYYY.BUILD[-TAG]"

@mbarkhau
Copy link
Owner

mbarkhau commented Jul 1, 2022

I just pushed 2022.1118, hope it helps with your use-case.

@mbarkhau mbarkhau closed this as completed Jul 1, 2022
@sparktx-adam-gleason
Copy link
Author

🙌 Perfect this works well for my use case.

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

No branches or pull requests

2 participants