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

Static Version number in package #575

Merged
merged 1 commit into from May 7, 2019

Conversation

Projects
None yet
2 participants
@marcogario
Copy link
Contributor

commented May 4, 2019

When running a dev version, we use git to compute the version number. This works ok if we are running pysmt from the git checkout.

However, if we do pip install of a dev version, this can fail. This PR provides a default value for this.
This is more of a temporary fix and a principled solution would be appreciated.

@marcogario marcogario requested a review from mikand May 4, 2019

commits_from_tag = git_version().split("-")[1]
except Exception as ex:
commits_from_tag = ""
VERSION = VERSION[:4] + (commits_from_tag,)

This comment has been minimized.

Copy link
@mikand

mikand May 6, 2019

Contributor

Doesn't this need to be un-indented?

@mikand
Copy link
Contributor

left a comment

I think there is an error in the code, if there is no exception the VERSION and __version__ variables are not set

@mikand

This comment has been minimized.

Copy link
Contributor

commented May 6, 2019

As a principled solution, can't we simply overwrite the __init__.py file with simple constants when we do the deployment on pypi?

@mikand mikand assigned marcogario and unassigned mikand May 6, 2019

@marcogario marcogario force-pushed the dev_version branch from e6186fd to 036914f May 7, 2019

@marcogario

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

As suggested. This creates a new __init__.py file to hardcode the version number. We could be nicer and just replace the current content, but there is little reason to do so now.

I also removed dependencies from the git_version function from the installer.

Version: Static version in make_distrib.sh
Simplifies the __init__.py and removes its usage in other parts of the
codebase.

@marcogario marcogario force-pushed the dev_version branch from bfe1a3d to d450844 May 7, 2019

@marcogario marcogario changed the title Default Version number if git fails Static Version number in package May 7, 2019

@marcogario marcogario merged commit 6ce11e7 into master May 7, 2019

22 of 49 checks passed

pysmt.pysmt Build #20190507.6 failed
Details
pysmt.pysmt (OSX10_13 Py27Msat) OSX10_13 Py27Msat failed
Details
pysmt.pysmt (OSX10_13 Py27NoSolver) OSX10_13 Py27NoSolver failed
Details
pysmt.pysmt (OSX10_13 Py27Yices) OSX10_13 Py27Yices failed
Details
pysmt.pysmt (OSX10_13 Py27Z3) OSX10_13 Py27Z3 failed
Details
pysmt.pysmt (OSX10_13 Py37Msat) OSX10_13 Py37Msat failed
Details
pysmt.pysmt (OSX10_13 Py37NoSolver) OSX10_13 Py37NoSolver failed
Details
pysmt.pysmt (OSX10_13 Py37Yices) OSX10_13 Py37Yices failed
Details
pysmt.pysmt (OSX10_13 Py37Z3) OSX10_13 Py37Z3 failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Bdd) Ubuntu16Py27 Py27Bdd failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Btor) Ubuntu16Py27 Py27Btor failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27CVC4) Ubuntu16Py27 Py27CVC4 failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Msat) Ubuntu16Py27 Py27Msat failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27MsatWrap) Ubuntu16Py27 Py27MsatWrap failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27NoSolver) Ubuntu16Py27 Py27NoSolver failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Picosat) Ubuntu16Py27 Py27Picosat failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Yices) Ubuntu16Py27 Py27Yices failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Z3) Ubuntu16Py27 Py27Z3 failed
Details
pysmt.pysmt (Ubuntu16Py27 Py27Z3Wrap) Ubuntu16Py27 Py27Z3Wrap failed
Details
pysmt.pysmt (Ubuntu16PyPy3 PyPy3NoSolver) Ubuntu16PyPy3 PyPy3NoSolver failed
Details
pysmt.pysmt (Ubuntu16PyPy3 PyPy3Z3Wrap) Ubuntu16PyPy3 PyPy3Z3Wrap failed
Details
pysmt.pysmt (Win2016 Py27Msat) Win2016 Py27Msat failed
Details
pysmt.pysmt (Win2016 Py27NoSolver) Win2016 Py27NoSolver failed
Details
pysmt.pysmt (Win2016 Py27Z3) Win2016 Py27Z3 failed
Details
pysmt.pysmt (Win2016 Py37Msat) Win2016 Py37Msat failed
Details
pysmt.pysmt (Win2016 Py37NoSolver) Win2016 Py37NoSolver failed
Details
pysmt.pysmt (Win2016 Py37Z3) Win2016 Py37Z3 failed
Details
clahub All contributors have signed the Contributor License Agreement.
Details
pysmt.pysmt (Ubuntu16All Py27All) Ubuntu16All Py27All succeeded
Details
pysmt.pysmt (Ubuntu16All Py27Cython) Ubuntu16All Py27Cython succeeded
Details
pysmt.pysmt (Ubuntu16All Py27CythonGMPy) Ubuntu16All Py27CythonGMPy succeeded
Details
pysmt.pysmt (Ubuntu16All Py27GMPy) Ubuntu16All Py27GMPy succeeded
Details
pysmt.pysmt (Ubuntu16All Py37All) Ubuntu16All Py37All succeeded
Details
pysmt.pysmt (Ubuntu16All Py37Cython) Ubuntu16All Py37Cython succeeded
Details
pysmt.pysmt (Ubuntu16All Py37CythonGMPy) Ubuntu16All Py37CythonGMPy succeeded
Details
pysmt.pysmt (Ubuntu16All Py37GMPy) Ubuntu16All Py37GMPy succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Bdd) Ubuntu16Py37 Py37Bdd succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Btor) Ubuntu16Py37 Py37Btor succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37CVC4) Ubuntu16Py37 Py37CVC4 succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Msat) Ubuntu16Py37 Py37Msat succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37MsatWrap) Ubuntu16Py37 Py37MsatWrap succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37NoSolver) Ubuntu16Py37 Py37NoSolver succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Picosat) Ubuntu16Py37 Py37Picosat succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Yices) Ubuntu16Py37 Py37Yices succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Z3) Ubuntu16Py37 Py37Z3 succeeded
Details
pysmt.pysmt (Ubuntu16Py37 Py37Z3Wrap) Ubuntu16Py37 Py37Z3Wrap succeeded
Details
pysmt.pysmt (Ubuntu16PyPy2 PyPy2MsatWrap) Ubuntu16PyPy2 PyPy2MsatWrap succeeded
Details
pysmt.pysmt (Ubuntu16PyPy2 PyPy2NoSolver) Ubuntu16PyPy2 PyPy2NoSolver succeeded
Details
pysmt.pysmt (Ubuntu16PyPy2 PyPy2Z3Wrap) Ubuntu16PyPy2 PyPy2Z3Wrap succeeded
Details
@marcogario

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

I merged this to fix the error on master. Still would like your opinion on the approach. In particular, I think we might be using two different version numbers.

My interpretation of the PEP 440 (https://www.python.org/dev/peps/pep-0440/#pre-release-spelling) is that the development of the version 0.8.1 should be labeled 0.8.1.devX. This is consistent with the way I first created the versioning string in init.py, but not with the git numbering, since git takes a post-release approach, and gives a number based on the previous tag.

I think using 0.8.1.devX clearly identifies that we are working on 0.8.1. I would probably say we can change the script in make_distrib.sh to replace the last digit of VERSION with the number of commits since the tag as obtained from git describe. I.e., even if git describe would provide 0.8.0-X-YYYY as output, we only consider the value X, and create 0.8.1.devX as version number.

marcogario added a commit that referenced this pull request May 7, 2019

@marcogario

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

See commit d8196b for the versioning consistent with the point above. This has not been merged, yet.

@mikand

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

I agree. So each time we make a release M.m.v we tag in git and update the default VERSION value in __init__.py by setting M'.m'.v' and we count the commits in master after the tag creating a version number M'.m'.v'.devN. The only question is how do we determine M', m' and v' before we make the actual changes... So, how do I know if the next iteration will be a major, minor or version update?

@mikand mikand referenced this pull request May 9, 2019

Merged

Dev Version Numbering #579

mikand added a commit that referenced this pull request May 9, 2019

marcogario added a commit that referenced this pull request May 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.