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

Use setuptools-scm for versioning #748

Merged
merged 4 commits into from Apr 7, 2022
Merged

Use setuptools-scm for versioning #748

merged 4 commits into from Apr 7, 2022

Conversation

Nothing4You
Copy link
Collaborator

@Nothing4You Nothing4You commented Mar 15, 2022

What do these changes do?

Use setuptools-scm for versioning

  • generate aiomysql/_scm_version.py at build time, fallback to unknown if it doesn't exist
  • include setuptools-scm-git-archive to support versioning in archives from git tags
  • install aiomysql package in readthedocs and access generated version to embed in docs

To do

Are there changes in behavior for the user?

Self-reported __version__ now returns version generated by setuptools-scm during build, otherwise 'unknown'.

Related issue number

split from #734

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into CHANGES.txt

@Nothing4You Nothing4You added this to the 0.1 milestone Mar 15, 2022
@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #748 (e098883) into master (42532c8) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #748      +/-   ##
==========================================
- Coverage   92.86%   92.83%   -0.04%     
==========================================
  Files          35       36       +1     
  Lines        5533     5537       +4     
  Branches      941      941              
==========================================
+ Hits         5138     5140       +2     
- Misses        307      309       +2     
  Partials       88       88              
Flag Coverage Δ
ubuntu-latest_3.10_mariadb-10.2 89.36% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mariadb-10.3 89.36% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mariadb-10.4 89.36% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mariadb-10.5 89.34% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mariadb-10.6 89.34% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mariadb-10.7 89.34% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mysql-5.7 90.04% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_mysql-8.0 91.43% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.2 89.32% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.3 89.32% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.4 89.32% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.5 89.30% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.6 89.30% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mariadb-10.7 89.30% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mysql-5.7 90.01% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.11-dev_mysql-8.0 91.40% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.2 88.76% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.3 88.76% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.4 88.76% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.5 88.74% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.6 88.74% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mariadb-10.7 88.74% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.7_mysql-5.7 89.49% <50.00%> (-0.04%) ⬇️
ubuntu-latest_3.7_mysql-8.0 90.97% <50.00%> (-0.04%) ⬇️
ubuntu-latest_3.8_mariadb-10.2 89.40% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mariadb-10.3 89.40% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mariadb-10.4 89.40% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mariadb-10.5 89.38% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mariadb-10.6 89.38% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mariadb-10.7 89.38% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mysql-5.7 90.09% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_mysql-8.0 91.46% <50.00%> (-0.04%) ⬇️
ubuntu-latest_3.9_mariadb-10.2 89.25% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mariadb-10.3 89.25% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mariadb-10.4 89.25% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mariadb-10.5 89.24% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mariadb-10.6 89.24% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mariadb-10.7 89.24% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mysql-5.7 89.94% <50.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_mysql-8.0 91.32% <50.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiomysql/_version.py 50.00% <50.00%> (ø)

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 42532c8...e098883. Read the comment docs.

@lgtm-com

This comment was marked as off-topic.

- generate aiomysql/_scm_version.py at build time, fallback to `unknown` if it doesn't exist
- include setuptools-scm-git-archive to support versioning in archives from git tags
- install aiomysql package in readthedocs and access generated version to embed in docs

Split from #734, including suggestions from @webknjaz

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
@lgtm-com

This comment was marked as outdated.

@lgtm-com

This comment was marked as outdated.

@Nothing4You
Copy link
Collaborator Author

readthedocs builds don't currently have enough git context to determine the correct version, see build output for the pip install . step in the build log: https://readthedocs.org/projects/aiomysql/builds/16470357/

this relates to readthedocs/readthedocs.org#5031, I've requested the related feature flag via support form.

@Nothing4You
Copy link
Collaborator Author

RTD now fetches the full git history, showing correct scm generated version numbers.

@Nothing4You Nothing4You marked this pull request as ready for review April 7, 2022 19:44
@lgtm-com

This comment was marked as outdated.

@Nothing4You
Copy link
Collaborator Author

the only issue left with this is that make doc only works in an environment that has the package installed, other than that this should be good to go.

@lgtm-com
Copy link

lgtm-com bot commented Apr 7, 2022

This pull request introduces 1 alert when merging e098883 into 42532c8 - view on LGTM.com

new alerts:

  • 1 for Unused import

@Nothing4You Nothing4You merged commit 1697e15 into master Apr 7, 2022
@Nothing4You Nothing4You deleted the setuptools-scm branch April 7, 2022 20:09
@@ -0,0 +1 @@
ref-names: $Format:%D$
Copy link
Member

Choose a reason for hiding this comment

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

@Nothing4You FYI the recent versions of setuptools-scm need a more complete template — the current one has 4 lines, not just one.

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

Successfully merging this pull request may close these issues.

None yet

2 participants