Skip to content

Expose extension version #94

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
wants to merge 2 commits into from

Conversation

jschueller
Copy link
Contributor

supercedes #51

@jschueller
Copy link
Contributor Author

jschueller commented May 17, 2017

ping cc @callegar

@amueller
Copy link
Contributor

Why is a separate file better than __init__.py? (sorry if that's a stupid question)

@jschueller
Copy link
Contributor Author

@amueller that way I can import only the version

@jschueller jschueller mentioned this pull request May 18, 2017
@amueller
Copy link
Contributor

Can you give an example? If you do from numpydoc._version import __version__ Python will still read the __init__.py file, right?

@jschueller
Copy link
Contributor Author

How would you do it ?

@pv
Copy link
Member

pv commented May 18, 2017

I don't think there is a reasonable way to do it.

The handling of the release version is also somewhat suspect currently --- it should be 0.7.0.dev0 during development, and switched to 0.7.0 only in the release commit.

@pv pv closed this May 18, 2017
@jschueller jschueller deleted the metadata-version branch May 18, 2017 20:27
@amueller
Copy link
Contributor

@pv do you want to change it to 0.7.0.dev0? that would be helpful I think.

@callegar
Copy link

@amueller Having a dedicated file has several advantages, because you can have only the version number in it. In turn, this means that:

  1. you can easily read the version without executing the file (or by executing a file that you know that certainly has no side effect). This means that you can safely read the version number from setup.py. Conversely, having the version number in the package init.py means that this cannot generally be safely read from setup.py, because at the time setup.py is invoked, the package will not yet be installed and init.py may not be able to complete without errors, or another version of the package might be installed.
  2. you can easily update the version number programmatically (e.g. from the tags of a version control system, such as git)

@pv I suggest that the project should eventually move to read the version directly from the vcs (e.g. using the versioneer package)

@rgommers
Copy link
Member

I don't think there is a reasonable way to do it.

Reading in a separate file and parsing as text rather than importing doesn't sound completely unreasonable.

@jnothman
Copy link
Member

Can't we do this sort of think but make numpydoc.setup import numpydoc.numpydoc.setup locally?

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.

6 participants