Skip to content

Conversation

yarikoptic
Copy link
Member

Ran into it while testing neurodebian package for 0.8.0 -- ran into:

$> docker run -it --rm reproin-test-0.8.0:latest --help
Traceback (most recent call last):
  File "/usr/bin/heudiconv", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pathlib' distribution was not found and is required by heudiconv

because info.py claims it as a dependency, and there were no pip install which would have pulled it from pypi (even though it is included in python itself)

Moreover inclusion of pathlib into list of dependencies breaks on
Debian installation with python 3.7 where there is no explicit pathlib
package available
@yarikoptic yarikoptic added the bug label Apr 20, 2020
@yarikoptic yarikoptic added this to the 0.8.1 milestone Apr 20, 2020
@codecov
Copy link

codecov bot commented Apr 20, 2020

Codecov Report

Merging #443 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #443   +/-   ##
=======================================
  Coverage   74.99%   74.99%           
=======================================
  Files          35       35           
  Lines        2863     2863           
=======================================
  Hits         2147     2147           
  Misses        716      716           
Impacted Files Coverage Δ
heudiconv/info.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1a7cb5...672d3a3. Read the comment docs.

@yarikoptic yarikoptic merged commit e6edf98 into nipy:master Apr 21, 2020
@caldodge
Copy link

This is actually a major issue for heudiconv, since it requires features that exist in the built-in pathlib, but not the version installed via pip. For example, the package version does not allow "exist_ok" as a parameter to "mkdir" in a Path object.

@yarikoptic
Copy link
Member Author

why would you install pathlib via pip if it is now included in the standard library and thus most likely pypi version is just outdated (last updated in 2014)?

@caldodge
Copy link

caldodge commented Oct 10, 2020 via email

@yarikoptic
Copy link
Member Author

;-) it does have the latest version! it is just those (same) people just need to release heudiconv 0.8.1...

but the point here is that actually it should have been pathlib pypi maintainers which probably should have made it impossible to install pathlib for versions of python where it was already included.But let's get back to

This is actually a major issue for heudiconv, since it requires features that exist in the built-in pathlib, but not the version installed via pip. For example, the package version does not allow "exist_ok" as a parameter to "mkdir" in a Path object.

(git)lena:~/picts/mris/heudiconv-master[master]git
$> git describe
v0.8.0-68-gd855f64
$> git grep exist_ok
$>

do you have more specific pointer of what feature of bundled pathlib we are using which is not present in pypi's?

@caldodge
Copy link

caldodge commented Oct 11, 2020 via email

yarikoptic added a commit that referenced this pull request Dec 23, 2020
Various improvements and compatibility/support (dcm2niix, datalad,
duecredit) changes.  Major change is placement of output files to the
target output directory during conversion.

- #454 zenodo referencing in README.rst and support for ducredit for
  heudiconv and reproin heuristic
- #445 more tutorial references in README.md

- [#485][] placed files during conversion right away into the target
  directory (with a `_heudiconv???` suffix, renamed into ultimate target
  name later on), which avoids hitting file size limits of /tmp ([#481][]) and
  helped to avoid a regression in dcm2nixx 1.0.20201102
- #477 replaced `rec-<magnitude|phase>` with `part-<mag|phase>` now
  that BIDS supports the part entity
- #473 made default for CogAtlasID to be a TODO URL
- #459 made AcquisitionTime used for acq_time scans file field
- #451 retained sub-second resolution in scans files
- #442 refactored code so there is now heudiconv.main.workflow for
  more convenient use as a Python module

- minimal version of nipype set to 1.2.3 to guarantee correct handling
  of DWI files ([#480][])
- `heudiconvDCM*` temporary directories are removed now ([#462][])
- compatibility with DataLad 0.13 ([#464][])

- #443 pathlib as a dependency (we are Python3 only now)

* tag 'v0.9.0':
  Add a helper rule to upload to pypi
  update changelog reference as part of prep release
  [DATALAD RUNCMD] prepare the release
  CHANGELOG entry for 0.9.0
yarikoptic added a commit that referenced this pull request Dec 23, 2020
Various improvements and compatibility/support (dcm2niix, datalad,
duecredit) changes.  Major change is placement of output files to the
target output directory during conversion.

- #454 zenodo referencing in README.rst and support for ducredit for
  heudiconv and reproin heuristic
- #445 more tutorial references in README.md

- [#485][] placed files during conversion right away into the target
  directory (with a `_heudiconv???` suffix, renamed into ultimate target
  name later on), which avoids hitting file size limits of /tmp ([#481][]) and
  helped to avoid a regression in dcm2nixx 1.0.20201102
- #477 replaced `rec-<magnitude|phase>` with `part-<mag|phase>` now
  that BIDS supports the part entity
- #473 made default for CogAtlasID to be a TODO URL
- #459 made AcquisitionTime used for acq_time scans file field
- #451 retained sub-second resolution in scans files
- #442 refactored code so there is now heudiconv.main.workflow for
  more convenient use as a Python module

- minimal version of nipype set to 1.2.3 to guarantee correct handling
  of DWI files ([#480][])
- `heudiconvDCM*` temporary directories are removed now ([#462][])
- compatibility with DataLad 0.13 ([#464][])

- #443 pathlib as a dependency (we are Python3 only now)

* tag 'v0.9.0':
  Do no bother ensuring that version changed - should be no changes
@yarikoptic yarikoptic deleted the bf-py3 branch April 30, 2021 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants