question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-vendored versioneer?

See original GitHub issue

I understand the reason why versioneer installs a script in the local directory, but with PEP 517 and PEP 518, we’re moving towards a system with explicitly declared build dependencies and running builds in isolated environments.

Currently, if you specify build-backend="setuptools.build_meta" in your pyproject.toml, you need to also add sys.path.append(os.dirname(__file__)) into your setup.py in order to use versioneer.

However, if you’re using PEP 517/518, that also means that you don’t need to vendor your build dependencies in the source root anymore, you can just declare them in pyproject.toml. The difference in semantics between the PEP 517 backend and python setup.py commands also gives you a golden opportunity for “opportunistic upgrading”. If you provide a version of versioneer that you can pip install, then anyone using versioneer can seamlessly upgrade to PEP 517 by simply adding versioneer to their pyproject.toml.

Currently, it fails because pip install versioneer installs a different versioneer module than the one that is picked up when you vendor it. I think you can make the PEP 517 transition much easier by giving projects a PyPI package they can depend on (maybe versioneer or versioneer-installed) that, when installed, puts the versioneer people are expecting on their environment’s path.

Note that this is closely related to #192, though #192 is “versioneer breaks because of a behavior change in pip”, whereas, when pip releases a new version, the issue will become “I have to add the source root to my sys.path if I want to use versioneer with the new setuptools build backends”.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
bucknernscommented, Jul 11, 2020

I made a package for this, because I needed it. I do this in my pyproject.toml I lock wheel for supporting an old artifactory version but not required for pypi. https://github.com/bucknerns/versioneer-518

[build-system]
requires = ["setuptools", "wheel==0.30.0", "versioneer-518"]

Edit: Made this more readable in case someone uses it.

1reaction
astrojuanlucommented, Dec 1, 2020

Now that versioneer-518 lives in https://github.com/python-versioneer/versioneer-518 and that versioneer development has resumed, are you considering merging both packages (or, in other words, require PEP-518 usage?)

Read more comments on GitHub >

github_iconTop Results From Across the Web

python-versioneer/versioneer-518: Non vendored versioneer
python-versioneer/versioneer-518. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read more >
versioneer - PyPI
Easy VCS-based management of project version strings.
Read more >
Labels :: Anaconda.org
Non-vendored versioneer in the spirit of PEP 518. copied from cf-staging / versioneer-518 · Conda · Files · Labels · Badges ...
Read more >
versioneer.py · master · RKIBioinformaticsPipelines / president
Versioneer works by adding a special `_version.py` file into your source ... a non-vendored build-time. 256. dependency.
Read more >
versioneer.py · master · mpm-at-recover / pycbg · GitLab
Versioneer works by adding a special `_version.py` file into your source ... a non-vendored build-time. 256. dependency.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found