neuropoly / bids_neuropoly

Python package that deals with BIDS structure for filtering data (specific to NeuroPoly developments)
1 stars 0 forks source link

Fails to build from source #15

Open kousu opened 3 years ago

kousu commented 3 years ago

If I use --no-binary to install bids_neuropoly from source it fails with

FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

And, annoying, then pip decides instead of stopping to quietly install version 0.1 instead.

i.e. this sdist (via https://pypi.org/project/bids-neuropoly/0.2/#files) is broken, but this older sdist (via https://pypi.org/project/bids-neuropoly/0.1/#files) works.

This should be a simple fix: either make sure to ship requirements.txt in the sdist (I did a similar fix recently over https://github.com/UNFmontreal/Dcm2Bids/pull/111) or migrate the contents of requirements.txt directly into setup.py.

Reproduction ``` [kousu@requiem neuropoly]$ python3 -m virtualenv venv created virtual environment CPython3.9.2.final.0-64 in 993ms creator CPython3Posix(dest=/home/kousu/src/neuropoly/venv, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/kousu/.local/share/virtualenv) added seed packages: pip==21.0.1, setuptools==54.1.2, wheel==0.36.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator [kousu@requiem neuropoly]$ . venv/bin/activate (venv) [kousu@requiem neuropoly]$ pip install --no-binary "bids-neuropoly" bids-neuropoly Collecting bids-neuropoly Using cached bids_neuropoly-0.2.tar.gz (2.9 kB) ERROR: Command errored out with exit status 1: command: /home/kousu/src/neuropoly/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7gscpkxs/bids-neuropoly_65ebbc03972941c8aff1c850f4ddf7eb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7gscpkxs/bids-neuropoly_65ebbc03972941c8aff1c850f4ddf7eb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-0byjh1pb cwd: /tmp/pip-install-7gscpkxs/bids-neuropoly_65ebbc03972941c8aff1c850f4ddf7eb/ Complete output (7 lines): Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-7gscpkxs/bids-neuropoly_65ebbc03972941c8aff1c850f4ddf7eb/setup.py", line 9, in with open('requirements.txt') as f: File "/usr/lib/python3.9/codecs.py", line 905, in open file = builtins.open(filename, mode, buffering) FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt' ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/f0/a9/380b11fd9a6748b996916ad1430b1e23776899c51cfb89114a154b258760/bids_neuropoly-0.2.tar.gz#sha256=172214eb473f82dafc654db4312350a24334df227c7329577873c65e22b59453 (from https://pypi.org/simple/bids-neuropoly/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Using cached bids_neuropoly-0.1.tar.gz (5.4 kB) Collecting pybids>=0.6.5 Using cached pybids-0.12.4-py2.py3-none-any.whl (3.2 MB) Collecting nibabel>=2.3.0 Using cached nibabel-3.2.1-py3-none-any.whl (3.3 MB) Collecting pandas>=0.23.0 Using cached pandas-1.2.3-cp39-cp39-manylinux1_x86_64.whl (9.7 MB) Collecting numpy>=1.14 Using cached numpy-1.20.1-cp39-cp39-manylinux2010_x86_64.whl (15.4 MB) Collecting packaging>=14.3 Using cached packaging-20.9-py2.py3-none-any.whl (40 kB) Collecting pyparsing>=2.0.2 Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB) Collecting python-dateutil>=2.7.3 Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) Collecting pytz>=2017.3 Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB) Collecting bids-validator Using cached bids_validator-1.6.0-py2.py3-none-any.whl (15 kB) Collecting patsy Using cached patsy-0.5.1-py2.py3-none-any.whl (231 kB) Collecting num2words Using cached num2words-0.5.10-py3-none-any.whl (101 kB) Collecting click Using cached click-7.1.2-py2.py3-none-any.whl (82 kB) Collecting sqlalchemy<1.4.0.dev0 Downloading SQLAlchemy-1.3.23-cp39-cp39-manylinux2010_x86_64.whl (1.3 MB) |████████████████████████████████| 1.3 MB 2.8 MB/s Collecting scipy Downloading scipy-1.6.2-cp39-cp39-manylinux1_x86_64.whl (27.3 MB) |████████████████████████████████| 27.3 MB 160 kB/s Collecting six>=1.5 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting docopt>=0.6.2 Using cached docopt-0.6.2.tar.gz (25 kB) Skipping wheel build for bids-neuropoly, due to binaries being disabled for it. Building wheels for collected packages: docopt Building wheel for docopt (setup.py) ... done Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13705 sha256=f9efc7d704d826473f7726dd2cceeb01362d6174a87a8a78ff5c4bebdb50fa1a Stored in directory: /home/kousu/.cache/pip/wheels/70/4a/46/1309fc853b8d395e60bafaf1b6df7845bdd82c95fd59dd8d2b Successfully built docopt Installing collected packages: six, pyparsing, pytz, python-dateutil, packaging, numpy, docopt, sqlalchemy, scipy, patsy, pandas, num2words, nibabel, click, bids-validator, pybids, bids-neuropoly Running setup.py install for bids-neuropoly ... done Successfully installed bids-neuropoly-0.1 bids-validator-1.6.0 click-7.1.2 docopt-0.6.2 nibabel-3.2.1 num2words-0.5.10 numpy-1.20.1 packaging-20.9 pandas-1.2.3 patsy-0.5.1 pybids-0.12.4 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2021.1 scipy-1.6.2 six-1.15.0 sqlalchemy-1.3.23 (venv) [kousu@requiem neuropoly]$ python3 Python 3.9.2 (default, Feb 20 2021, 18:40:11) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import bids_neuropoly >>> bids_neuropoly.version Traceback (most recent call last): File "", line 1, in AttributeError: module 'bids_neuropoly' has no attribute 'version' >>> bids_neuropoly.__version__ '0.1' >>> (venv) [kousu@requiem neuropoly]$ ls venv/ bin/ .gitignore lib/ pyvenv.cfg (venv) [kousu@requiem neuropoly]$ ls venv/lib/python3.9/site-packages/ bids/ docopt.py pandas/ pyparsing.py six.py bids_neuropoly/ nibabel/ pandas-1.2.3.dist-info/ python_dateutil-2.8.1.dist-info/ sqlalchemy/ bids_neuropoly-0.1-py3.9.egg-info/ nibabel-3.2.1.dist-info/ patsy/ pytz/ SQLAlchemy-1.3.23.dist-info/ bids_validator/ nisext/ patsy-0.5.1.dist-info/ pytz-2021.1.dist-info/ _virtualenv.pth bids_validator-1.6.0.dist-info/ num2words/ pip/ scipy/ _virtualenv.py click/ num2words-0.5.10.dist-info/ pip-21.0.1.dist-info/ scipy-1.6.2.dist-info/ wheel/ click-7.1.2.dist-info/ numpy/ pip-21.0.1.virtualenv scipy.libs/ wheel-0.36.2.dist-info/ dateutil/ numpy-1.20.1.dist-info/ pkg_resources/ setuptools/ wheel-0.36.2.virtualenv _distutils_hack/ numpy.libs/ pybids-0.12.4.dist-info/ setuptools-54.1.2.dist-info/ distutils-precedence.pth packaging/ __pycache__/ setuptools-54.1.2.virtualenv docopt-0.6.2.dist-info/ packaging-20.9.dist-info/ pyparsing-2.4.7.dist-info/ six-1.15.0.dist-info/ (venv) [kousu@requiem neuropoly]$ ls venv/lib/python3.9/site-packages/bids bids/ bids_neuropoly/ bids_neuropoly-0.1-py3.9.egg-info/ bids_validator/ bids_validator-1.6.0.dist-info/ (venv) [kousu@requiem neuropoly]$ ls venv/lib/python3.9/site-packages/bids_neuropoly-0.1-py3.9.egg-info/ dependency_links.txt installed-files.txt PKG-INFO requires.txt SOURCES.txt top_level.txt (venv) [kousu@requiem neuropoly]$ cat venv/lib/python3.9/site-packages/bids_neuropoly-0.1-py3.9.egg-info/PKG-INFO Metadata-Version: 1.1 Name: bids-neuropoly Version: 0.1 Summary: An open-source BIDS parser. Home-page: https://github.com/neuropoly/bids_neuropoly Author: Christian S. Perone Author-email: christian.perone@gmail.com License: UNKNOWN Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python :: 3 (venv) [kousu@requiem neuropoly]$ deactivate ```
jcohenadad commented 3 years ago

Are we still using BIDS neuropoly? @alexfoias @mariehbourget? Didn't we move to the more active and community-supported pybids?

kousu commented 3 years ago

It's still in https://github.com/ivadomed/ivadomed/blob/d9a5bdb652dd79e588dcf7988b7fae8e6ecf8be8/requirements.txt#L1 :shrug:

kousu commented 3 years ago

Used here: https://github.com/ivadomed/ivadomed/blob/d9a5bdb652dd79e588dcf7988b7fae8e6ecf8be8/ivadomed/loader/utils.py#L587

but everywhere else uses pybids:

https://github.com/ivadomed/ivadomed/blob/d9a5bdb652dd79e588dcf7988b7fae8e6ecf8be8/ivadomed/loader/utils.py#L699

https://github.com/ivadomed/ivadomed/blob/d9a5bdb652dd79e588dcf7988b7fae8e6ecf8be8/ivadomed/loader/utils.py#L727

https://github.com/ivadomed/ivadomed/blob/d9a5bdb652dd79e588dcf7988b7fae8e6ecf8be8/ivadomed/loader/utils.py#L732

mariehbourget commented 3 years ago

Are we still using BIDS neuropoly? @alexfoias @mariehbourget? Didn't we move to the more active and community-supported pybids?

For ivadomed, bids_neuropoly is not used anymore in the loading pipeline. It is only used in the function merge_bids_dataset that could be removed as well, see issue #726.

alexfoias commented 3 years ago

I personally didn't use this in a very good while. We should stick to pybids and dcm2bids.

mariehbourget commented 3 years ago

For ivadomed, bids_neuropoly is not used anymore and was removed from requirements in PR #746.

alexfoias commented 3 years ago

@kousu @jcohenadad the issue https://github.com/ivadomed/ivadomed/issues/726 was fixed. I think we can archive this repo.