Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Add "compress" extra to allow all compression libs to be easily installed #450

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

chrisburr
Copy link
Member

I recently modified LHCb's DIRAC extension to make it use uproot for extracting metadata from ROOT files. This has worked really well but declaring the dependency is a little awkward as it has to list each compression library individually and stay updated if new ones are ever added.

What do you think about adding another extra that allows people to depend on all of the decompression related dependencies using pip install uproot[decompress] or adding uproot[decompress] to their package's setup.py?

Alternative name suggestions for this extra are welcome.

@jpivarski
Copy link
Member

jpivarski commented Feb 11, 2020

I like this idea! I've seen other projects that use it (like TensorFlow including GPU backends or not), but I've never looked into how it was done.

  1. What happens if a user installs uproot, then later decides to install uproot[compress]? It doesn't matter to me whether pip carefully installs the difference or redundantly re-downloads uproot, but at least it should leave the user with the same thing they would have gotten if they initially installed uproot[compress].
  2. What if they initially install uproot[compress], then when they update, forget and do pip install -U uproot without the [compress]? Does it do something reasonable? (Not getting the latest compression libraries but getting the latest uproot would be one reasonable possibility.)
  3. I'm trying to think of an easier to remember name—they shouldn't have to look up whether it's [compress], [compression], [decomrpession], etc. This also affects uproot-writing, so leaving off the "de" is meaningful. (Also, some people say, "uncompress", though never "uncompression". I'm just trying to think of what will lead to the fewest human guessing-errors.)

@chrisburr
Copy link
Member Author

I've had a play inside virtual environments. If you want to try the command for installing extras with git exists but isn't obvious:

pip install 'git+https://github.com/chrisburr/uproot.git@add-compression-libs-extra#egg=uproot[compress]'

I've abused my admin powers to edit your comment to so I can give numbered responses:

  1. It does the correct thing, only installs the extra libs, everything else is Requirement already satisfied.
  2. Updates uproot but not the other libs.
  3. Yeah I'm not a fan of this name either. I first called it readall but I think that's too ambiguous with remote reading libraries. I've changed it to compress for now.
  4. Uninstalling behaves like usual for pip in that only uproot is removed and not awkward or anything else

@chrisburr chrisburr changed the title Add "decompression" extra to allow all compression libs to be easily installed Add "compress" extra to allow all compression libs to be easily installed Feb 11, 2020
@chrisburr
Copy link
Member Author

@jpivarski Any further thoughts on this?

@jpivarski
Copy link
Member

@chrisburr I didn't realize this was still waiting. It looks good to me. Should I merge it (i.e. you're not planning to do anything else)?

@chrisburr
Copy link
Member Author

If you're happy with the name compress go ahead.

@jpivarski jpivarski merged commit c97586a into scikit-hep:master Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants