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

fix: package version #2816

Merged
merged 4 commits into from
Apr 19, 2022
Merged

Conversation

charles-cooper
Copy link
Member

this is a hybrid approach. previously we used bumpversion to bump the
version and then appended the commithash to the --version output. as
of 0.3.1, we used setuptools-scm to append the commit hash. however,
setuptools-scm did not have a way to create multiple versions -- one for
our --version output, and one for PKG-INFO.

this commit uses setuptools-scm to automate the global (ex. v0.3.2)
version string calculation, while using an auxiliary file to keep track
of the commit hash for --version.

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

this is a hybrid approach. previously we used bumpversion to bump the
version and then appended the commithash to the `--version` output. as
of 0.3.1, we used setuptools-scm to append the commit hash. however,
setuptools-scm did not have a way to create multiple versions -- one for
our `--version` output, and one for PKG-INFO.

this commit uses setuptools-scm to automate the global (ex. v0.3.2)
version string calculation, while using an auxiliary file to keep track
of the commit hash for `--version`.
@codecov-commenter
Copy link

codecov-commenter commented Apr 19, 2022

Codecov Report

Merging #2816 (f4f7107) into master (3b6a411) will decrease coverage by 0.02%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##           master    #2816      +/-   ##
==========================================
- Coverage   87.48%   87.46%   -0.03%     
==========================================
  Files          94       94              
  Lines        9997    10001       +4     
  Branches     2478     2432      -46     
==========================================
+ Hits         8746     8747       +1     
- Misses        784      785       +1     
- Partials      467      469       +2     
Impacted Files Coverage Δ
vyper/cli/vyper_compile.py 68.14% <ø> (ø)
vyper/cli/vyper_ir.py 0.00% <ø> (ø)
vyper/cli/vyper_json.py 79.78% <ø> (ø)
vyper/cli/vyper_serve.py 0.00% <0.00%> (ø)
vyper/__init__.py 76.47% <66.66%> (-5.35%) ⬇️
vyper/ir/s_expressions.py 91.17% <0.00%> (-2.95%) ⬇️
vyper/codegen/abi_encoder.py 86.53% <0.00%> (-0.13%) ⬇️
vyper/codegen/core.py 84.52% <0.00%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b6a411...f4f7107. Read the comment docs.

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

If there's not a way to do this with setuptools_scm (add __commit__ to version.py separately from __version__) then this approach makes sense

setup.py Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@charles-cooper
Copy link
Member Author

If there's not a way to do this with setuptools_scm (add __commit__ to version.py separately from __version__) then this approach makes sense

there is not. see here https://github.com/pypa/setuptools_scm/blob/ca3855ba66fa4cb100f5039eea909932f815a4a4/src/setuptools_scm/__init__.py#L34-L43 -- there is no way to get anything besides the package version string into version.py.

even though we don't generate them anymore, they sometimes get generated
when building old releases locally
@charles-cooper charles-cooper enabled auto-merge (squash) April 19, 2022 15:55
@charles-cooper charles-cooper merged commit b1942c0 into vyperlang:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants