matthew-brett / xibabel

Piloting a new image object for neuroimaging based on XArray
BSD 2-Clause "Simplified" License
6 stars 0 forks source link

flit install fails #7

Closed ivanov closed 4 months ago

ivanov commented 8 months ago

running flit install on f2967a57ee78c5ce194e0c02cf9c3806ea56ea20 (https://github.com/matthew-brett/xibabel/pull/6)

results in

Building wheels for collected packages: xibabel
  Building wheel for xibabel (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for xibabel (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      Unexpected names under [project]: home-page
      Traceback (most recent call last):
        File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-o20hyr_3/overlay/lib/python3.11/site-packages/flit_core/buildapi.py", line 72, in build_wheel
          info = make_wheel_in(pyproj_toml, Path(wheel_directory))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-o20hyr_3/overlay/lib/python3.11/site-packages/flit_core/wheel.py", line 224, in make_wheel_in
          wb.build(editable)
        File "/tmp/pip-build-env-o20hyr_3/overlay/lib/python3.11/site-packages/flit_core/wheel.py", line 210, in build
          self.copy_module()
        File "/tmp/pip-build-env-o20hyr_3/overlay/lib/python3.11/site-packages/flit_core/wheel.py", line 164, in copy_module
          self._add_file(full_path, rel_path)
        File "/tmp/pip-build-env-o20hyr_3/overlay/lib/python3.11/site-packages/flit_core/wheel.py", line 111, in _add_file
          zinfo = zipfile.ZipInfo.from_file(full_path, rel_path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/pi/.pyenv/versions/3.11.0/lib/python3.11/zipfile.py", line 528, in from_file
          st = os.stat(filename)
               ^^^^^^^^^^^^^^^^^
      FileNotFoundError: [Errno 2] No such file or directory: 'src/xibabel/testing/ds000009/derivatives/mriqc/aMRIQC.csv'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for xibabel
Failed to build xibabel
ERROR: Could not build wheels for xibabel, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: python -m pip install --upgrade pip
Traceback (most recent call last):
  File "/home/pi/.pyenv/versions/xib2/bin/flit", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/flit/__init__.py", line 219, in main
    installer.install()
  File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/flit/install.py", line 432, in install
    self.install_with_pip()
  File "/home/pi/.pyenv/versions/3.11.0/envs/xib2/lib/python3.11/site-packages/flit/install.py", line 370, in install_with_pip
    check_call(cmd, shell=shell)
  File "/home/pi/.pyenv/versions/3.11.0/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/pi/.pyenv/versions/3.11.0/envs/xib2/bin/python', '-m', 'pip', 'install', '.[docs,developer,test]']' returned non-zero exit status 1.
ivanov commented 8 months ago

This might be a separate issue, but flit install -s installation worked ok, but does not permit datalad to do its magic

$ python -m xibabel.testing minimal
get(error): /home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/ds000105/sub-1/func/sub-1_task-objectviewing_run-01_bold.nii.gz [path not associated with dataset Dataset(/data/pi/fmri/take2/xibabel)]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/__main__.py", line 26, in <module>
    main()
  File "/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/__main__.py", line 22, in main
    get_set(test_set)
  File "/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/__init__.py", line 75, in get_set
    out_paths.add(get_file(path_str))
                  ^^^^^^^^^^^^^^^^^^
  File "/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/__init__.py", line 64, in get_file
    return _SOURCE2FETCHER[source](path_str)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/__init__.py", line 41, in get_datalad_file
    check_call(['datalad', 'get', str(rel_path)])
  File "/home/pi/.pyenv/versions/3.11.0/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['datalad', 'get', '/home/pi/.pyenv/versions/xib2/lib/python3.11/site-packages/xibabel/testing/ds000105/sub-1/func/sub-1_task-objectviewing_run-01_bold.nii.gz']' returned non-zero exit status 1.
matthew-brett commented 8 months ago

Yeah - at the moment - the tests and data installation only work for in-place install - because an install to your site-packages won't take across the submodules. I wonder whether we should just refactor this out to let datalad do its own git initialization.

matthew-brett commented 7 months ago

Is this working now?

matthew-brett commented 5 months ago

Ping @ivanov - I was still getting the error from some residual datalad files in the repository tree, doing an install from the repository. When I cleaned out those files, I no longer got the error. Can you confirm that a clean checkout does not generate the error?

matthew-brett commented 4 months ago

I think this is fixed, and tested. Reopen if I'm wrong?