-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add schema version #253
Add schema version #253
Conversation
@csadorf I used the |
Codecov Report
@@ Coverage Diff @@
## master #253 +/- ##
=========================================
+ Coverage 65.08% 65.4% +0.31%
=========================================
Files 39 41 +2
Lines 5588 5654 +66
=========================================
+ Hits 3637 3698 +61
- Misses 1951 1956 +5
Continue to review full report at Codecov.
|
Under what circumstances does this happen? For the warnings and error messages? |
I just did a quick search, I'm not sure where we used that class anyways, maybe use |
Right, in the errors/warnings. To see it, just initialize a new project and then edit the config file to a higher major/minor version. |
@csadorf Yeah, distutils is another choice. I am unavailable for most of the weekend, so if you’re interested in trying it, go ahead and commit to this branch. We may want to check if that Version class is used elsewhere and deprecate it if distutils does the job. |
I'll have a look at it. |
I realized that there are few things we didn't fully consider. I'm almost done with implementing the missing pieces. Will push soon. |
@csadorf Reminder to push your changes when convenient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was the last one to push changes, so I am erroneously still requested for review...
signac/__main__.py
Outdated
@@ -19,6 +19,8 @@ | |||
import errno | |||
from pprint import pprint, pformat | |||
|
|||
from packaging import version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://stackoverflow.com/a/11887885
According to this StackOverflow post, packaging
isn't in the standard library but comes as a dependency of setuptools
. I just wanted to make a note of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so we should probably add setuptools
to the dependencies, however, it is not clear to me if we need to require a specific version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csadorf I looked at the history of the setuptools git repo and changelog. packaging
has been included as a vendored package (not a dependency) since setuptools v8.0 (Dec 13, 2014). I think that StackOverflow answer I linked above is out of date. I recommend that we add packaging
as a dependency instead. It's a very common dependency so I expect it will be already met by most users' environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then in v39 it was changed to dependencies again?
Just tested, packaging
is not installed by default in a "fresh" conda environment, but it's certainly very easy to install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and we need packaging>=15.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csadorf Since we're hoping to include this in the release on Friday, I am offering some preliminary feedback - I know tests aren't passing yet but I hope this is still helpful.
3422698
to
8a7b7db
Compare
@bdice I plan on finalizing this before Friday. I need a free minute to consider how to potentially reduce the footprint of this patch (your concern). I'll ping you again when I think it's ready and will ask you to informally review it again. I realize that this PR is kind of turned around now, sorry about that. |
Definitely not a problem - my goal was only to provide a draft implementation for further consideration. Thanks for taking it on. |
fd79706
to
f2f2426
Compare
@bdice This should be ready now. Please have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csadorf Two change requests (I can't request changes on my own PR). I want to use proper semantic versions, e.g. '1.0.0'
instead of '1'
. Also we need to make the requirements.txt
file match the requirements in setup.py.
@@ -52,7 +41,7 @@ def get_validator(): | |||
cfg = """ | |||
project = string() | |||
workspace_dir = string(default='workspace') | |||
signac_version = version(default='0,1,0') | |||
schema_version = string(default='1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a proper semantic version string?
schema_version = string(default='1') | |
schema_version = string(default='1.0.0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below.
I opted to use a simpler system, because I don't think that semantic versioning actually makes sense in this context. What would it mean to have a minor or patch release of the scheme? Is there ever a scenario where you could operate on a minor or patch release without migrating? I compare this to other API schemes, that usually use a simple sequential scheme. Many RESTful APIs use a single number to indicate which API version they are using. I don't think that semantic versioning makes sense in this context. |
Refactoring.
To reduce footprint.
So that code related to a particular migration can be kept within one module.
With correct minimal version (tested).
And add unit test to check that the code is enabled when necessary.
Using the project instance provided by the unit test class.
To get more control over and information about the migration process.
a901ea4
to
c84c7cf
Compare
I agree that using an integer version (not a string version) is preferable, but then we don't need |
Agreed, I'll make that change. |
We determined that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csadorf Requesting changes: use integer versions everywhere, instead of mixing '1'
and '1.0.0'
styles.
Description
Adds an explicit schema version for the signac data model.
Motivation and Context
Resolves #165.
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary:
Example for a changelog entry:
Fix issue with launching rockets to the moon (#101, #212).