FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add __version__ by vmuriart · Pull Request #312 · pythonnet/pythonnet · GitHub

Add __version__ - #312

Merged
vmuriart merged 3 commits into
pythonnet:masterfrom
vmuriart:#67-#218
Jan 8, 2017
Merged

Add __version__#312
vmuriart merged 3 commits into
pythonnet:masterfrom
vmuriart:#67-#218

Conversation

vmuriart commented Jan 7, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

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 self-assigned this Jan 7, 2017

vmuriart commented Jan 7, 2017

Copy link
Copy Markdown
Contributor Author

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 commented Jan 7, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

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 commented Jan 7, 2017

Copy link
Copy Markdown
Contributor Author

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

vmuriart commented Jan 7, 2017

Copy link
Copy Markdown
Contributor Author

@tonyroberts thanks for the feedback, it worked

vmuriart changed the title Add Version to CLR module Add __version__ Jan 7, 2017

filmor commented Jan 8, 2017

Copy link
Copy Markdown
Member

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).

Copy link
Copy Markdown
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 commented Jan 8, 2017

Copy link
Copy Markdown
Contributor Author

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 commented Jan 8, 2017 via email

Copy link
Copy Markdown
Contributor

vmuriart merged commit a330330 into pythonnet:master Jan 8, 2017
vmuriart deleted the #67-#218 branch January 8, 2017 22:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL