Skip to content

Switch to setuptools-scm for versioning#37

Merged
seifertm merged 9 commits intopytest-dev:masterfrom
imranity:use-setuptools-scm
Jan 11, 2022
Merged

Switch to setuptools-scm for versioning#37
seifertm merged 9 commits intopytest-dev:masterfrom
imranity:use-setuptools-scm

Conversation

@imranity
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

blueyed commented Jul 16, 2019

@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.
@seifertm seifertm removed their request for review January 11, 2022 15:11
@seifertm
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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.

Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
Comment thread setup.cfg
seifertm and others added 5 commits January 11, 2022 20:42
…p.cfg.

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

Signed-off-by: Michael Seifert <[email protected]>
Signed-off-by: Michael Seifert <[email protected]>
@seifertm
Copy link
Copy Markdown
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
Copy Markdown
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.

7 participants