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

Add support for defining multiple version patterns #237

Open
9ao9ai9ar opened this issue Jul 11, 2024 · 2 comments
Open

Add support for defining multiple version patterns #237

9ao9ai9ar opened this issue Jul 11, 2024 · 2 comments
Labels
bumpver2 enhancement New feature or request good first issue Good for newcomers

Comments

@9ao9ai9ar
Copy link

My use case is bumping the project version and the minimum-supported Python version (because each tool likes to define their own fields for this) strings inside pyproject.toml. Say we're allowed to write this in pyproject.toml:

[tool.bumpver.project]
current_version = "2024.07.11"
version_pattern = "YYYY.0M.0D[-PATCH]"
bumpver_flags = "--patch"
file_patterns = {
    "pyproject.toml" = [
        'version = "{version}"',
    ]
}

[tool.bumpver.python]
current_version = "3.10"
version_pattern = "MAJOR.MINOR"
bumpver_flags = "--minor"
file_patterns = {
    "pyproject.toml" = [
        '^pythonVersion = "{version}"',
        '^python-version = "{version}"',
        '^target-python-version = "{version}"',
    ]
}

and update the versions via specifying the subtable key:

> bumpver update project
> bumpver update python

It'll be a huge UX improvement.

@mbarkhau
Copy link
Owner

Hi @9ao9ai9ar

Do you think this request has overlap with #220 ?

From the CLI/UX side, I think you're on the right track. The idea in the other issue was to have multiple files, which I think might be worse than what you're suggesting here.

Are you interested in working on this?

@mbarkhau mbarkhau added enhancement New feature or request good first issue Good for newcomers labels Aug 17, 2024
@9ao9ai9ar
Copy link
Author

@mbarkhau I think both approaches can work, but multiple configs might suit his case better.

I no longer have a need for this feature, opting instead to not define any Python version-related field other than requires_python and just let the tools pick the one in the virtual environment, so no, I won't be interested in working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bumpver2 enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants