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

Switch to setuptools-scm for versioning #37

Merged
merged 9 commits into from Jan 11, 2022

Conversation

hayderimran7
Copy link
Contributor

Following other pytest projects like pytest-html,
that use setuptool-scm to manage version
pytest-dev/pytest-html@d9c0b87 .
It would be nice other projects follow the suit and
let setuptools-scm manage version of this project.

@Tinche
Copy link
Member

Tinche commented Nov 28, 2016

Hi!

This looks interesting. I'm generally in favor, but I need to get some free time to read up on this and play around with it. :)

@nicoddemus
Copy link
Member

For the record it works great, and will also solve #92 because setuptools_scm will add all versioned files to the package automatically.

@nicoddemus
Copy link
Member

I've fixed the conflicts and adopted the strategy of writing a _version.py file so we can keep having the __version__ attribute in the package. 😉

@nicoddemus
Copy link
Member

This also paves the way to automatic deployments using Travis, which are highly recommended. Let me know if I can help @Tinche!

@blueyed
Copy link
Contributor

blueyed commented Jul 16, 2019

FWIW I think https://github.com/zsimic/setupmeta is even nicer.

@seifertm seifertm self-assigned this Jan 11, 2022
@seifertm seifertm mentioned this pull request Jan 11, 2022
maliki and others added 2 commits January 11, 2022 16:02
Following other pytest projects like pytest-html,
that use setuptool-scm to manage version, it would
be nice other projects follow the suit and
let setuptools-scm manage version of this project.
Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm
Copy link
Contributor

Rebased the PR to master and added setuptools_scm as dependency to the CI steps.

I also cloned my local pytest-asyncio git repo and and ran tox in a fresh virtualenv. Tox successfully picked up the dependency on setuptools_scm.

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2022

Codecov Report

Merging #37 (271edba) into master (41420cf) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   95.43%   95.45%   +0.02%     
==========================================
  Files           2        2              
  Lines         219      220       +1     
==========================================
+ Hits          209      210       +1     
  Misses         10       10              
Impacted Files Coverage Δ
pytest_asyncio/__init__.py 100.00% <100.00%> (ø)
pytest_asyncio/plugin.py 95.39% <0.00%> (+0.02%) ⬆️

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 41420cf...271edba. Read the comment docs.

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

Looks good, please apply my tiny improvements before pressing the 'squash and merge' button.

.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
seifertm and others added 5 commits January 11, 2022 20:42
…est job

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…p.cfg.

This prevents tools relying on setuptools from picking up the dependency correctly.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm
Copy link
Contributor

Without the pip install setuptools_scm in the testing job, tox didn't pick up the dependency on setuptools_scm correctly and the test run failed due to a missing _version.py file. After adding setuptools_scm to setup_requires in setup.cfg everything worked. This is also how pytest-xdist handles it. They define the dependency in setup.cfg, [1] but configure setuptools_scm in pyproject.toml [2].

[1] https://github.com/pytest-dev/pytest-xdist/blob/a1a6c77028d1c2215f2457482602d214f7f9f532/setup.cfg#L43
[2] https://github.com/pytest-dev/pytest-xdist/blob/a1a6c77028d1c2215f2457482602d214f7f9f532/pyproject.toml#L10-L11

@seifertm seifertm merged commit 37ec756 into pytest-dev:master Jan 11, 2022
@asvetlov
Copy link
Contributor

Interesting. I thought that the single source of setuptools_scm dependency (pyproject.toml) should be enough.
Can live with this sort of duplication, sure!
Thanks for the double-checking.

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.

None yet

7 participants