Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add __version__ #312

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

Merged
merged 3 commits into from
Jan 8, 2017
Merged

Add __version__ #312

merged 3 commits into from
Jan 8, 2017

Conversation

vmuriart
Copy link
Contributor

@vmuriart vmuriart commented Jan 7, 2017

Closes #67, #218.

Ideally we would implement `__version__` as a property, but this requires
`ModuleFunctionAttribute` to work.
Since version is being implemented as a function, using `Version()`
instead since __version__ is expected to be a property.
@vmuriart vmuriart self-assigned this Jan 7, 2017
@vmuriart
Copy link
Contributor Author

vmuriart commented Jan 7, 2017

For reference, below is the alternative method I been using to detect the currently installed version.

def pythonnet_version():
    # Based from: http://stackoverflow.com/a/23885252
    import pip

    for x in pip.get_installed_distributions():
        if x.key == "pythonnet":
            return x.version

@tonyroberts
Copy link
Contributor

tonyroberts commented Jan 7, 2017

Would it be simpler to add __version__ to clr.py (in src/runtime/resources)? Everything in that file gets added to the clr module in Initialize. A small change would be needed as currently Initialize ignores anything starting with an underscore.

@vmuriart
Copy link
Contributor Author

vmuriart commented Jan 7, 2017

That would make more sense. Let me review and try that out. thanks!

@vmuriart
Copy link
Contributor Author

vmuriart commented Jan 7, 2017

@tonyroberts thanks for the feedback, it worked

@vmuriart vmuriart changed the title Add Version to CLR module Add __version__ Jan 7, 2017
@filmor
Copy link
Member

filmor commented Jan 8, 2017

It would be a lot nicer (and more future proof) if this information was taken during the build process from either a version file or the git repository (e.g. using https://github.com/warner/python-versioneer).

@den-run-ai
Copy link
Contributor

I agree with @filmor - we need automated way of updating versions. One trigger (e.g. Github release tag) should make changes in setup.py and __version__.

@vmuriart
Copy link
Contributor Author

vmuriart commented Jan 8, 2017

I agree, I was thinking along the same lines and was inclining towards bumpversion.

In the interest of separations of concerns though, can we merge this pr and I'll open a ticket to add the automation.

@den-run-ai
Copy link
Contributor

den-run-ai commented Jan 8, 2017 via email

@vmuriart vmuriart merged commit a330330 into pythonnet:master Jan 8, 2017
@vmuriart vmuriart deleted the #67-#218 branch January 8, 2017 22:39
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.

4 participants