Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Python 2 builds breaking pybids #36

Closed
effigies opened this issue Nov 8, 2018 · 10 comments
Closed

Python 2 builds breaking pybids #36

effigies opened this issue Nov 8, 2018 · 10 comments

Comments

@effigies
Copy link

effigies commented Nov 8, 2018

Just to let you know, some time between Oct 10 and 17, the Python 2 nightly build started producing the following failure in pybids:

ImportError while importing test module '/home/travis/build/bids-standard/pybids/bids/analysis/tests/test_analysis.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
venv/lib/python2.7/site-packages/six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
bids/analysis/tests/test_analysis.py:2: in <module>
    from bids.analysis import Analysis
bids/__init__.py:4: in <module>
    from .analysis import Analysis
bids/analysis/__init__.py:1: in <module>
    from .analysis import Analysis
bids/analysis/analysis.py:2: in <module>
    from bids.layout import BIDSLayout
bids/layout/__init__.py:1: in <module>
    from .layout import BIDSLayout
bids/layout/layout.py:5: in <module>
    from .validation import BIDSValidator
bids/layout/validation.py:6: in <module>
    import pandas as pd
venv/lib/python2.7/site-packages/pandas/__init__.py:35: in <module>
    "the C extensions first.".format(module))
E   ImportError: C extension: No module named enum not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

As well as a number of similar errors. See, e.g., Travis builds #792.4 or #817.4.

This only occurs with --pre builds using the ManyLinux repository. Depending on the exact timing of the builds, it looks like it could have been caused by either of the last two commits: 131a2b7 or 93b492a

Related discussion: bids-standard/pybids#276

@effigies
Copy link
Author

effigies commented Dec 7, 2018

Sorry to pester, but does anybody have information on this? We're having to ignore errors in Python2+nightly altogether, in order to have a reliable indicator of other errors, which means upcoming changes in Pandas that only affect Python 2 are going to be completely missed until they're released.

@jreback
Copy link
Contributor

jreback commented Dec 7, 2018

have u seen: https://travis-ci.org/MacPython/pandas-wheels/builds

our nightly builds have been working for quite some time (small hiccup on 32 but for a little)

@effigies
Copy link
Author

effigies commented Dec 7, 2018

I'm not sure what to take away from that. We're still unable to use the package that is produced.

See, for example: https://travis-ci.org/bids-standard/pybids/jobs/465013222

@jreback
Copy link
Contributor

jreback commented Dec 7, 2018

you have a file named enum.py which is shadowing a built in module - not a great idea

@effigies
Copy link
Author

effigies commented Dec 7, 2018

Running python -v -m bids.analysis, I'm unable to see evidence of any enum.py except the builtin module, and searching through the file trees for pybids and our main dependencies, I can't see an enum.py anywhere. Sorry if I'm being dense...

@jreback
Copy link
Contributor

jreback commented Dec 7, 2018

then no idea

@effigies
Copy link
Author

effigies commented Dec 7, 2018

From playing around a bit more, it seems to be that Pandas uses Enum, but doesn't require enum34 for Python versions <3.4. It looks like this dependency was introduced in pandas-dev/pandas#22802.

It wasn't erroring out in your tests, apparently, because hypothesis depends on it:

9103 Collecting enum34; python_version == "2.7" (from hypothesis)

Testing in bids-standard/pybids#315 to see if this clears up all of the errors.

@jreback
Copy link
Contributor

jreback commented Dec 7, 2018

hmm interesting can u make an issue on the main pandas repo

@effigies
Copy link
Author

effigies commented Dec 7, 2018

Was just about to submit a PR. Do you prefer to have an issue first?

@jreback
Copy link
Contributor

jreback commented Dec 7, 2018

what u did is fine thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants