-
Notifications
You must be signed in to change notification settings - Fork 6
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
chore: Modify build tool #36
Conversation
pyproject.toml
Outdated
[tool.setuptools_scm] | ||
write_to = "mox/__version__.py" | ||
[tool.hatch.version] | ||
path = "hatch/__about__.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should stay as "mox/__version__.py"
and it will write automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is according to docs hatch looks for a variable named __version__
inside the file pointed by path
but in mox/__version__.py
there's already a variable with a different value '0.1.dev296+gb25cd38.d20240110'
for the version which is (i believe) the version of the package and not the version of hatch, hence when i try to build using
poetry run python -m hatch build
it fails with the message:
ValueError: Error getting the version from source 'regex': unable to parse the version from the file: mox/__version__.py
Docs: https://hatch.pypa.io/latest/version/#pyprojecttoml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docs, what should be in __about__.py
is the project version, and not the version of hatch itself. The hatch version is already in pyproject.toml
. Here is a suggestion so it works with the current __version__.py
file:
path = "hatch/__about__.py" | |
path = "mox/__version__.py" | |
validate-bump = true | |
scheme = "semver" | |
pattern = "__version__ = version = \"(?P<version>[^\"]+)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, will patch it.
setuptools_scm = { version = "^8.0", python = ">=3.8,<4" } | ||
hatch = { version = "^1.9.1", python = ">=3.9,<4" } | ||
hatchling = { version = "^1.21.0", python = ">=3.8,<4" } | ||
hatch-semver = { version = "^1.0.1", python = ">=3.9,<4" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work! We need to drop Python 3.7 support before merging this, though. #37
@fmotaf can you merge the latest main and solve the conflicts here? thank you! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage 89.92% 89.92%
=======================================
Files 11 11
Lines 1072 1072
Branches 168 168
=======================================
Hits 964 964
Misses 83 83
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more. |
Great work! |
Closes #16