-
Notifications
You must be signed in to change notification settings - Fork 533
ENH: Permit external packages to deprecate interfaces #2028
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
from warnings import warn | ||
import simplejson as json | ||
from dateutil.parser import parse as parseutc | ||
from packaging.version import Version | ||
|
||
from .. import config, logging, LooseVersion, __version__ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove LooseVersion from everywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used for versioning on external programs, e.g. FSVersion < 6.0 or FSLVersion > 507. Since these don't follow PEP440, I intended to leave them as they are. |
||
from ..utils.provenance import write_provenance | ||
|
@@ -43,7 +44,7 @@ | |
from ..external.due import due | ||
|
||
runtime_profile = str2bool(config.get('execution', 'profile_runtime')) | ||
nipype_version = LooseVersion(__version__) | ||
nipype_version = Version(__version__) | ||
iflogger = logging.getLogger('interface') | ||
|
||
FLOAT_FORMAT = '{:.10f}'.format | ||
|
@@ -352,6 +353,7 @@ class BaseTraitedSpec(traits.HasTraits): | |
XXX Reconsider this in the long run, but it seems like the best | ||
solution to move forward on the refactoring. | ||
""" | ||
package_version = nipype_version | ||
|
||
def __init__(self, **kwargs): | ||
""" Initialize handlers and inputs""" | ||
|
@@ -444,7 +446,7 @@ def _deprecated_warn(self, obj, name, old, new): | |
else: | ||
msg3 = '' | ||
msg = ' '.join((msg1, msg2, msg3)) | ||
if LooseVersion(str(trait_spec.deprecated)) < nipype_version: | ||
if Version(str(trait_spec.deprecated)) < self.package_version: | ||
raise TraitError(msg) | ||
else: | ||
if trait_spec.new_name: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ configparser | |
pytest>=3.0 | ||
mock | ||
pydotplus | ||
packaging |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ mock | |
pydotplus | ||
psutil | ||
matplotlib | ||
packaging |
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.
packing
should be added to requirements.txt and rtd_requirements as well?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 think, this would also need to be added to
SETUP_REQUIRES
. you can check by trying to install nipype in a clean environment usingpython setup.py 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.
Building the docker image (I never figured out how to do virtualenvs) from scratch. Is that an equivalent check?
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.
you can do this inside a basic continuumio/miniconda docker instance - think of that as a virtualenv.
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.
and more generally download and install miniconda and then do: conda create -n envname python=2/3 for creating virtual envs
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.
Builds and installs without issue. (Had to apt-get install build-essential, conda install scipy, lxml and dependencies, but otherwise no problems.)
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.
so that latter are runtime dependencies not setup dependencies. there is difference between setup requires and run/test requires. setup requires are things that the setup.py file imports.
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.
e.g. see: https://github.com/conda-forge/nipype-feedstock/blob/master/recipe/meta.yaml#L17
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.
Right. I don't think
packaging
is required by that. Runningpython setup.py bdist_wheel
worked fine. I then also ranpython setup.py install
which required the other dependencies.Sorry if I'm missing something.