Skip to content
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

Switch to autover #214

Merged
merged 8 commits into from Mar 5, 2018
Merged
6 changes: 5 additions & 1 deletion param/version.py
Expand Up @@ -168,7 +168,7 @@ class Version(object):
supplied."""

def __init__(self, release=None, fpath=None, commit=None, reponame=None,
commit_count_prefix='.post', archive_commit=None):
commit_count_prefix='.post', archive_commit=None, **kwargs):
"""
:release: Release tuple (corresponding to the current VCS tag)
:commit Short SHA. Set to '$Format:%h$' for git archive support.
Expand All @@ -177,6 +177,10 @@ def __init__(self, release=None, fpath=None, commit=None, reponame=None,
"""
self.fpath = fpath
self._expected_commit = commit

if release is not None or 'commit_count' in kwargs:
print('WARNING: param.Version now supports PEP440 and a new tag based workflow. See param/version.py for more details')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to use param.warning but that will probably cause cyclic import issues unless I inline the import? Is a print statement ok in this case and do you have any suggestions for a better message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using print is ok by me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so simple I didn't test it locally. I would wait for travis here and also on autover where I'll port this change across now. The only thing I'm wondering about is whether this print will be triggered in some of the unit tests.

self.expected_release = release

self._commit = None if (commit is None or commit.startswith("$Format")) else commit
Expand Down