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
Merged

Static Version number in package #575

merged 1 commit into from May 7, 2019

Conversation

marcogario
Copy link
Contributor

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.

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

Choose a reason for hiding this comment

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

Doesn't this need to be un-indented?

Copy link
Contributor

@mikand mikand left a comment

Choose a reason for hiding this comment

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

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

@mikand
Copy link
Contributor

mikand 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?

@marcogario
Copy link
Contributor Author

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.

Simplifies the __init__.py and removes its usage in other parts of the
codebase.
@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
@marcogario
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@mikand
Copy link
Contributor

mikand 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 mentioned this pull request May 9, 2019
mikand pushed a commit that referenced this pull request May 9, 2019
marcogario pushed a commit that referenced this pull request May 10, 2019
This was referenced Apr 12, 2020
nbailluet pushed a commit to nbailluet/pysmt that referenced this pull request Mar 14, 2024
Simplifies the __init__.py and removes its usage in other parts of the
codebase.
nbailluet pushed a commit to nbailluet/pysmt that referenced this pull request Mar 14, 2024
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.

None yet

2 participants