Skip to content

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

@vmuriart vmuriart commented Jan 7, 2017

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

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

tonyroberts commented Jan 7, 2017

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

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

vmuriart commented Jan 7, 2017

Copy link
Copy Markdown
Contributor Author

@tonyroberts thanks for the feedback, it worked

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

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

@den-run-ai

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

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

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

Copy link
Copy Markdown
Contributor

@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