Skip to content

fixes #8133: migrate to setuptools_scm 6.x #8134

Merged
RonnyPfannschmidt merged 1 commit intopytest-dev:mainfrom
RonnyPfannschmidt:setuptools_scm_5
Oct 3, 2021
Merged

fixes #8133: migrate to setuptools_scm 6.x #8134
RonnyPfannschmidt merged 1 commit intopytest-dev:mainfrom
RonnyPfannschmidt:setuptools_scm_5

Conversation

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Dec 13, 2020

and use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST

fixes #8133

@RonnyPfannschmidt
Copy link
Member Author

@bluetech i believe the missing install in the deploy command created the problem
do you by chance have around a link to the build job else i'll search for more details sometime in the afternoon

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Thanks @RonnyPfannschmidt. I didn't test SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST on CI, only locally. I'll test this when I get a chance.

tox.ini Outdated
# TODO: When setuptools-scm 5.0.0 is released, use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
# and remove the next line.
passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
install_command=python -m pip --use-deprecated=legacy-resolver install {opts} {packages}
Copy link
Member

Choose a reason for hiding this comment

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

The fix should enable the removal of the --use-deprecated=legacy-resolver here

@bluetech
Copy link
Member

Basically the test is SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=10.20.30 tox -e regen with a new pip and seeing that:

  1. The regendoc install doesn't fail
  2. The correct version appears in the doc

@RonnyPfannschmidt
Copy link
Member Author

@bluetech thanks, i figured the issue - basically tox makes a sdist where the version pretending is not passed, which in turn confuses the rest

im now setting out to configure it correctly

@RonnyPfannschmidt
Copy link
Member Author

@bluetech i found a bug in the setuptools_scm pyproject integration, bugfix upcoming

@RonnyPfannschmidt
Copy link
Member Author

@gaborbernat is there potentially anything missing for tox to conisder it - even wit the bugfix i see the _FOR_PYTEST version being ignored while the normal one works

@RonnyPfannschmidt
Copy link
Member Author

@gaborbernat - nm, after updating a externalsetuptools_scm twice it actually worked, im not sure how that came to be but i suspect i poisoned my user-site, sorry for the noise

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the setuptools_scm_5 branch 2 times, most recently from 6c9a995 to 2753279 Compare December 20, 2020 15:47
@RonnyPfannschmidt RonnyPfannschmidt marked this pull request as ready for review December 20, 2020 15:47
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Should we backport this to 6.2.x?

@RonnyPfannschmidt
Copy link
Member Author

@bluetech please crosscheck if it works for you as well (to avoid a works on my box)

@RonnyPfannschmidt
Copy link
Member Author

@nicoddemus good idea

@RonnyPfannschmidt RonnyPfannschmidt added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Dec 20, 2020
@bluetech
Copy link
Member

@RonnyPfannschmidt I checked out this branch and tried the following:

SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=10.20.30 tox -e regen

tox does say:

.package recreate: /home/ran/src/pytest/.tox/.package
.package installdeps: setuptools>=42.0, setuptools-scm[toml]>=5.0.1, wheel

but...

regen inst-nodeps: /home/ran/src/pytest/.tox/.tmp/package/1/pytest-6.3.0.dev38+g2753279b1.tar.gz

that is, the specified version doesn't take.

Strangely, even though SETUPTOOLS_SCM_PRETEND_VERSION (without the FOR_PYTEST) is no longer allowed in passenv, that one does work.

I tried to completely rm my .tox directory and verified I the this branch checked out, still happens. Though I might still be missing something.

@RonnyPfannschmidt
Copy link
Member Author

Also update SETUPTOOLS_SCM in the surrounding env

@bluetech
Copy link
Member

What do you mean by surrounding env?

@RonnyPfannschmidt
Copy link
Member Author

@bluetech i appologize - the issue is observable for mae again as well

@gaborbernat - is there a easy way to debug what tox is doing here?

for some reason SETUPTOOLS_SCM_PRETEND_VERSION wont make it to the creation of the dist and i have no idea what exactly is wrong

@gaborbernat
Copy link
Contributor

Did you passed in at passenv, and just call it with -vvv to see the stdout of the build.

Base automatically changed from master to main March 9, 2021 20:40
this issues is less likely to hit due to the recent regendoc release
which includes a wheel

* migrate to setuptools_scm 6.3.2
* use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
@RonnyPfannschmidt
Copy link
Member Author

i upgraded this to the most recent setuptools_scm which includes a bugfix
additionally i added extra details to the commit message

@RonnyPfannschmidt RonnyPfannschmidt removed the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Oct 2, 2021
@RonnyPfannschmidt
Copy link
Member Author

won't need a backport anymore

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

I don't remember all of the details, but the changes LGTM.

@RonnyPfannschmidt
Copy link
Member Author

@bluetech there was a combination issue between regendoc and pytest setuptools_scm pretend_version

a pretend version at install time for regendoc would set it up wrong,
and the just for pytest pretend version had a bug that was only just fixed in the latest setuptools_scm version

@RonnyPfannschmidt RonnyPfannschmidt changed the title fixes #8133: migrate to setuptools_scm 5.x fixes #8133: migrate to setuptools_scm 6.x Oct 3, 2021
@RonnyPfannschmidt RonnyPfannschmidt merged commit 35d8c13 into pytest-dev:main Oct 3, 2021
@RonnyPfannschmidt RonnyPfannschmidt deleted the setuptools_scm_5 branch October 3, 2021 18:46
@nicoddemus nicoddemus mentioned this pull request Nov 11, 2025
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.

migrate to setuptools_scm >= 5

4 participants