Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unzip with gz too #4883

Merged
merged 5 commits into from Apr 9, 2019

Conversation

Projects
None yet
3 participants
@memsharded
Copy link
Contributor

commented Mar 31, 2019

Changelog: Feature: tools.get() and tools.unzip() now handle also .gz compressed files
Docs: conan-io/docs#1230

Close #4876

@tags: slow

@ghost ghost assigned memsharded Mar 31, 2019

@ghost ghost added the stage: review label Mar 31, 2019

@memsharded memsharded added this to the 1.15 milestone Mar 31, 2019

@memsharded memsharded referenced this pull request Mar 31, 2019

Closed

[suggestion] Support .gz files in tools.get() #4876

3 of 3 tasks complete

@memsharded memsharded assigned lasote and unassigned memsharded Mar 31, 2019

@ghost ghost assigned memsharded Mar 31, 2019

@memsharded memsharded removed their assignment Apr 1, 2019

@ghost ghost assigned memsharded Apr 1, 2019

@lasote
Copy link
Contributor

left a comment

@memsharded memsharded referenced this pull request Apr 2, 2019

Merged

docs for gz #1230

@memsharded

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2019

Docs omit? don't be lazy please: https://docs.conan.io/en/latest/reference/tools.html#tools-unzip

Yes, sorry, I did a (very) quick look at the docs, and thought the extensions were not detailed. Docs added.

import gzip
with gzip.open(filename, 'rb') as f:
file_content = f.read()
target_name = filename[:-3] if destination == "." else destination

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 2, 2019

Member

Here the destination is expected to be a file (not a directory like in the other cases), the docstring for this function doesn't match. If given a directory this function will fail in the load with a IsADirectoryError. I'm not sure if we want to handle it better.

This comment has been minimized.

Copy link
@memsharded

memsharded Apr 8, 2019

Author Contributor

Updated docstring.

I have tried passing a folder as argument, and it failed (py2, Win), with IOError: [Errno 13] Permission denied: 'mytemp'. I think in either case the error should be clear enough, catching and re-raising a ConanException is a bit overkill for this case.

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 8, 2019

Member

No, don't need to reraise, it was just about the docstring (it is a documented tool). Don't forget to update it: https://docs.conan.io/en/latest/reference/tools.html#tools-unzip 😉

@memsharded memsharded removed their assignment Apr 8, 2019

@lasote lasote merged commit 337cd72 into conan-io:develop Apr 9, 2019

2 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details

@ghost ghost removed the stage: review label Apr 9, 2019

@memsharded memsharded deleted the memsharded:feature/unzip_gz branch Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.