8000 Versioneer does not write import inside __init__.py in accordance with versionfile_source · Issue #123 · python-versioneer/python-versioneer · GitHub
[go: up one dir, main page]

Skip to content

Versioneer does not write import inside __init__.py in accordance with versionfile_source #123

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

Closed
AndreiPashkin opened this issue Sep 3, 2016 · 2 comments · Fixed by #241
Labels

Comments

@AndreiPashkin
Copy link

Example:

[versioneer]
...
versionfile_source = src/myproject/__version__.py
versionfile_build = myproject/__version__.py
...

With that config versioneer install writes file __version__.py, but in __init__.py writes:

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

Notice - from ._version ..., not from .__version__ ....

@warner
Copy link
Collaborator
warner commented Dec 30, 2016

Oops, good catch. Looks like we should be using INIT_PY_SNIPPET (in src/setupfunc.py) as a template, and populate the import statement using the relative filename that we extract from versionfile_build. I'll see if I can assemble a test and a patch.

@cfobel
Copy link
cfobel commented Apr 17, 2017

This is still an issue, as seen in src/setupfunc.py.

@effigies effigies added the bug label Sep 15, 2020
@effigies effigies changed the title Versionees does not write import inside __init__.py in accordance with versionfile_source Versioneer does not write import inside __init__.py in accordance with versionfile_source Sep 16, 2020
effigies added a commit that referenced this issue May 20, 2021
* Change __init__.py snippet to fix #123 and #218

* ENH: Add migration path for new snippet

Co-authored-by: Christopher J. Markiewicz <markiewicz@stanford.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0