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

bug: Using PEP440 version doesn't get reflected even when mentioned using -n pep440 #82

Open
Tuhin-thinks opened this issue Apr 4, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Tuhin-thinks
Copy link

Description of the bug

Generating CHANGELOG using pep440 returns the same string as provided in the --bump flag

while using --bump minor+dev:

image

To Reproduce

git change --config-file pyproject.toml --bump minor+dev

Full traceback

Used pyproject.toml
[tool.git-changelog]
convention = "angular"
in-place = true
output = "CHANGELOG.md"
marker-line = "<!-- insertion marker -->"
parse-refs = false
parse-trailers = false
provider = "github"
repository = "."
sections = "fix,chore,feat,docs,deps,style,refactor,test,perf"
template = "keepachangelog"
version-regex = "^## \\\\[(?P<version>v?[^\\\\]]+)"
versioning = "pep440"
zerover = true

Expected behavior

Generated version should be 0.2.0.dev0

Environment information

git-changelog --debug-info  # | xclip -selection clipboard
- __System__: Linux-6.5.0-26-generic-x86_64-with-glibc2.35
- __Python__: cpython 3.10.12 (/home/tuhin/Downloads/python_env/fastapi_env/bin/python)
- __Environment variables__:
- __Installed packages__:
  - `git-changelog` v2.5.1

Additional context

In the current repo I have a tag v0.1.0.Want to bump it using strategy minor+dev of pep440. But, the version string is coming as minor+dev

Also, at the very top of the CHANGELOG.md it's showing the following line:

and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

This clearly shows the project is not considering the pep440 versioning even after mentioning using -n or --versioning.

While running the following Python snippet shows the exact version that I want:

(fastapi_env) tuhin@tuhinLaptop:~/Documents/projects/fast_api_server$ ipython
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.22.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from git_changelog.versioning import bump_pep440

In [2]: bump_pep440('0.1.0', 'minor+dev')
Out[2]: '0.2.0.dev0'

In [3]: bump_pep440('0.1.0', 'minor+dev')
Out[3]: '0.2.0.dev0'
@pawamoy
Copy link
Owner

pawamoy commented Apr 4, 2024

Hello, thanks for the report. I was only able to partially replicate the issue. The bump strategy is wrongly used as is when this is the first tag/version.

Also, at the very top of the CHANGELOG.md it's showing the following line:

Good point, maybe it should link to PEP 440 instead.

@pawamoy pawamoy added the bug Something isn't working label Apr 4, 2024
pawamoy added a commit that referenced this issue Apr 4, 2024
This change also changes the behavior back to having the latest version be "Unreleased" if the bump option wasn't used.

Issue-82: #82
@pawamoy
Copy link
Owner

pawamoy commented Apr 4, 2024

I've pushed v2.5.2, let me know if it works for you. I decided not to change the header in the keepachangelog template because you can easily modify it yourself and it won't be touched by git-changelog when you update the changelog in-place.

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