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

Allow specifying a function that gets the version #271

Open
flying-sheep opened this issue May 20, 2019 · 2 comments
Open

Allow specifying a function that gets the version #271

flying-sheep opened this issue May 20, 2019 · 2 comments

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented May 20, 2019

People like using versioneer, setuptools_scm, or get_version to retrieve the version from other places than the main module’s code.

Allowing to specify a function would have the advantage that people don’t have to make sure the main module is importable without all dependencies being installed.

It would neatly fix things like #253 (without ignoring errors) and #257 (without adding complexity to flit)

@astrojuanlu
Copy link

I tried using versioneer in a flit project and, by "tricking it" a bit (i.e. creating an empty setup.py and then removing it, and removing also the MANIFEST.in) I got it to work. So I don't see what changes should flit make.

@flying-sheep
Copy link
Contributor Author

Ah, yes. Versioneer will work, since it works by copying code into your project instead of being a dependency. But if you use something that works as a dependency, #253 will prevent stuff from working:

from setuptools_scm import get_version
__version__ = get_version(root='..', relative_to=__file__)

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

No branches or pull requests

2 participants