Closed cthoyt closed 1 year ago
Merging #61 (b18bec0) into main (d7fa850) will decrease coverage by
0.19%
. The diff coverage is56.25%
.
@@ Coverage Diff @@
## main #61 +/- ##
==========================================
- Coverage 66.98% 66.80% -0.19%
==========================================
Files 10 10
Lines 933 946 +13
Branches 194 198 +4
==========================================
+ Hits 625 632 +7
- Misses 287 291 +4
- Partials 21 23 +2
Impacted Files | Coverage ฮ | |
---|---|---|
src/pystow/utils.py | 61.91% <56.25%> (-0.34%) |
:arrow_down: |
:mega: Weโre building smart automated test selection to slash your CI/CD build times. Learn more
Hi @sgbaird @glass-ships, could you please test this out and let me know what you think?
will do, thanks @cthoyt !!
This behavior isn't enabled by default, you'll have to do something like:
import pystow
if __name__ == '__main__':
url = "https://zenodo.org/record/7633479/files/emojis.zip?download=1"
path = pystow.ensure(
"test",
force=True,
url=url,
name="emojis.zip",
download_kwargs=dict(progress_bar=True, backend="requests", tqdm_kwargs=dict(leave=True)),
)
print("download succeeded to ", path)
This behavior isn't enabled by default, you'll have to do something like:
import pystow if __name__ == '__main__': url = "https://zenodo.org/record/7633479/files/emojis.zip?download=1" path = pystow.ensure( "test", force=True, url=url, name="emojis.zip", download_kwargs=dict(progress_bar=True, backend="requests", tqdm_kwargs=dict(leave=True)), ) print("download succeeded to ", path)
Hmmm, still no luck. Sorry I think I'm missing something here. Updated the call to:
with monarchstow.ensure_open_sqlite_gz(
"sql",
url=SQL_DATA_URL,
force=update,
download_kwargs=dict(progress_bar=True, backend="requests", tqdm_kwargs=dict(leave=True))
) as db:
But I'm getting TypeError: urlretrieve() got an unexpected keyword argument 'progress_bar'
or TypeError: Session.request() got an unexpected keyword argument 'progress_bar'
@glass-ships you'll have to install your code from the branch where I implemented this, since it's neither merged nor released
@glass-ships you'll have to install your code from the branch where I implemented this, since it's neither merged nor released
I thought I had done exactly that by issuing the following:
$ poetry run pip uninstall pystow
$ cd </pystow/path>
$ poetry -C </my/library/path> run pip install .
A pip freeze | grep 'pystow'
returns pystow @ file:///D:/dev/pystow
though, which I guess I expected to be the version num..
Apologies for my stumbling around, I'm still getting used to manually managing dependencies with Poetry.
Ok, sorry again, looks like I've sorted my issue - my system appeared to be caching an older version and claiming it was up to date!
I nuked my environment and started again, and everything appears kosher!
(monarch-py-py3.10) PS D:\dev\pystow> monarch sql entity --id MONDO:0012933
Downloading monarch-kg.db.gz: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 475M/475M [00:04<00:00, 110MB/s]
# Rest of output
}
FYI @glass-ships I have made a release 0.5.0 that includes this feature
Closes #60
urllib
support (inspired by https://gist.github.com/leimao/37ff6e990b3226c2c9670a2cd1e4a6f5)requests
support (inspired by https://stackoverflow.com/a/63831344/5775947)Example usage: