Skip to content

Set cookiecutter/VERSION.txt as source of truth for version number#1896

Merged
ericof merged 2 commits intomainfrom
issue-1886-version
Jul 11, 2023
Merged

Set cookiecutter/VERSION.txt as source of truth for version number#1896
ericof merged 2 commits intomainfrom
issue-1886-version

Conversation

@ericof
Copy link
Copy Markdown
Member

@ericof ericof commented Jul 10, 2023

Closes #1886

@ericof ericof added the CI/CD This issue/PR relates to the project CI/CD update or fix. label Jul 10, 2023
@ericof ericof added this to the 2.2.3 milestone Jul 10, 2023
@ericof ericof requested review from jensens, kurtmckee and luzfcb July 10, 2023 19:39
@ericof ericof added the bug This issue/PR relates to a bug. label Jul 10, 2023
@ericof ericof merged commit 6c49e5a into main Jul 11, 2023
@ericof ericof deleted the issue-1886-version branch July 11, 2023 13:01
"""Read VERSION.txt and return its contents."""
path = Path(__file__).parent.resolve()
version_file = path / "VERSION.txt"
return version_file.read_text().strip()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend encoding="utf-8"

return version_file.read_text().strip()


version = _get_version()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this (and README.md) can also be done declaratively with setup.cfg.

"""Read cookiecutter/VERSION.txt and return its contents."""
path = Path("cookiecutter").resolve()
version_file = path / "VERSION.txt"
return version_file.read_text().strip()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend encoding="utf-8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue/PR relates to a bug. CI/CD This issue/PR relates to the project CI/CD update or fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.2.0 CLI reports version 2.1.2dev0

3 participants