Closed Cadair closed 2 years ago
Merging #92 (106d5c2) into main (c52cbe3) will increase coverage by
0.84%
. The diff coverage is97.81%
.
@@ Coverage Diff @@
## main #92 +/- ##
==========================================
+ Coverage 92.48% 93.33% +0.84%
==========================================
Files 4 5 +1
Lines 466 540 +74
==========================================
+ Hits 431 504 +73
- Misses 35 36 +1
Impacted Files | Coverage Δ | |
---|---|---|
parfive/downloader.py | 93.26% <95.34%> (-0.41%) |
:arrow_down: |
parfive/config.py | 98.87% <98.87%> (ø) |
|
parfive/utils.py | 94.54% <100.00%> (+0.15%) |
:arrow_up: |
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 c52cbe3...106d5c2. Read the comment docs.
I am going to ping people who have contributed to see if anyone wants to comment on this PR, and give people a chance to ask for tweaks before I push a major release.
@GitHK @rlaker @nabobalis @dstansby
Thanks for the review @GitHK, are you using the use_aiofiles=
kwarg to Downloader
? Would removing it cause you trouble?
Thanks for the review @GitHK, are you using the
use_aiofiles=
kwarg toDownloader
? Would removing it cause you trouble?
No issue for me. Go ahead and remove it. We usually do periodic updates and fix these small issues. It helps a lot when libraries point breaking changes in the changelog, upgrades are much smoother.
@GitHK Thanks! I have pulled it now, I am going to keep headers around for people using previous versions of sunpy.
I have pushed 2.0.0rc1 up to PyPI if people want to test this and open any issues.
Overall:
👍 on pydantic, such a great library. 👍 on the config refactor, makes things much clearer in the main downloader code. 👎 on adding type hints and using black.
This PR introduces breaking API changes, it will form a 2.0 release of parfive.
fixes #38 fixes #29
This PR is motivated by the fact that we have been slowly growing more and more keyword arguments, environment variables etc at various levels in the class.
This PR cleans up the environment variable handling and keyword arguments to the main
Downloader
class by making a config object which holds the state for the instance. As well as this some of the more obscure keyword arguments are moved into aSessionConfig
object.Changes in this PR
PARFIVE_HIDE_PROGRESS
environment variable will disable all progress bars.file_progress=
,use_aiofiles=
andnotebook=
keyword arguments have been moved into the newSessionConfig
object which can be passed toDownloader()
as theconfig=
keyword argument.headers=
keyword argument toDownloader()
is now deprecated in favour of passing them as part of theSessionConfig
object. They will be removed in a future release.Downloader
class is instantiated (by the new config classes).True
.timeouts
keyword argument has been removed from therun_download()
anddownload()
methods and replaced by an option inSessionConfig
.aiohttp.ClientSession
with theaiohttp_session_kwargs=
keyword argument toSessionConfig
.SessionConifg
where previously it could only be configured with an environment variable.SessionConfig
and the default when not using aiofiles has been increased from 100 bytes to 1024 bytes.SessionConfig
as well as theHTTP[S]_PROXY
environment variables.aiohttp.ClientTimeout
object toSessionConfig
.