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

Ensure manifest tracks package version via module's __version__ attribute #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions harp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from harp.io import REFERENCE_EPOCH, MessageType, read
from harp.reader import create_reader
from harp.schema import read_schema

__version__ = "0.2.0"
Copy link
Contributor

@glopesdev glopesdev May 20, 2024

Choose a reason for hiding this comment

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

Actually I realise I do have one issue with this.

The way versioning is done currently is by using git tags instead of hard-coded strings, and I'm realising I actually really like that because you don't have to worry about updating any strings until you do the release and then uploading to pip just works consistently. Same with local builds in case there are local changes setup tools assumes a patch and pre-release suffix automatically as long as you don't hard-code things.

So I guess I would rather do this the other way around and backfill the string automatically from the git release tag, rather than having the release version be set from a string we have to manually remember to update.

Is that possible?

Copy link
Member Author

Choose a reason for hiding this comment

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

I would assume it needs to be done at the same time as the tag is added? Maybe we close this PR for now. At the time I wanted to use this to automatically generate a Deprecated user message but I ended up dropping it anyway.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ include-package-data = true
[tool.setuptools.packages.find]
include = ["harp*"]

[tool.setuptools.dynamic]
version = {attr = "harp.__version__"}

[tool.setuptools_scm]

[tool.black]
Expand Down