Skip to content

Commit bad6900

Browse files
authored
Add use_env=False to all Download() calls (#68)
1 parent ecd2d4c commit bad6900

File tree

5 files changed

+53
-42
lines changed

5 files changed

+53
-42
lines changed

documentation/main.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ The library has detailed API documentation which can be found in the menu at the
5252

5353

5454
## Breaking Changes
55-
From 6.2.8, fix mark_data_updated which was broken due to an error in
56-
dataset_update_filestore_resource in which timezone information was
55+
From 6.2.8, fix mark_data_updated which was broken due to an error in
56+
dataset_update_filestore_resource in which timezone information was
5757
incorrectly added to the iso formatted string
5858

5959
From 6.2.7, generate_resource_from_iterator renamed to

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ dependencies = [
3737
"ckanapi>=4.8",
3838
"defopt>=6.4.0",
3939
"email_validator",
40-
"hdx-python-country>=3.7.0",
41-
"hdx-python-utilities>=3.6.8",
40+
"hdx-python-country>=3.7.2",
41+
"hdx-python-utilities>=3.6.9",
4242
"libhxl>=5.2.1",
4343
"makefun",
4444
"ndg-httpsclient",

requirements.txt

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# This file was autogenerated by uv via the following command:
22
# uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt
3-
annotated-types==0.6.0
3+
annotated-types==0.7.0
44
# via pydantic
55
attrs==23.2.0
66
# via
77
# frictionless
88
# jsonlines
99
# jsonschema
10+
# referencing
1011
cachetools==5.3.3
1112
# via google-auth
12-
certifi==2024.2.2
13+
certifi==2024.6.2
1314
# via requests
1415
cffi==1.16.0
1516
# via cryptography
@@ -22,9 +23,9 @@ charset-normalizer==3.3.2
2223
ckanapi==4.8
2324
click==8.1.7
2425
# via typer
25-
coverage==7.5.0
26+
coverage==7.5.3
2627
# via pytest-cov
27-
cryptography==42.0.5
28+
cryptography==42.0.8
2829
# via pyopenssl
2930
defopt==6.4.0
3031
distlib==0.3.8
@@ -40,19 +41,19 @@ docutils==0.21.2
4041
email-validator==2.1.1
4142
et-xmlfile==1.1.0
4243
# via openpyxl
43-
filelock==3.13.4
44+
filelock==3.14.0
4445
# via virtualenv
45-
frictionless==5.16.1
46+
frictionless==5.17.0
4647
# via hdx-python-utilities
4748
google-auth==2.29.0
4849
# via
4950
# google-auth-oauthlib
5051
# gspread
5152
google-auth-oauthlib==1.2.0
5253
# via gspread
53-
gspread==6.1.0
54-
hdx-python-country==3.7.0
55-
hdx-python-utilities==3.6.8
54+
gspread==6.1.2
55+
hdx-python-country==3.7.2
56+
hdx-python-utilities==3.6.9
5657
# via hdx-python-country
5758
humanize==4.9.0
5859
# via frictionless
@@ -70,16 +71,18 @@ iniconfig==2.0.0
7071
# via pytest
7172
isodate==0.6.1
7273
# via frictionless
73-
jinja2==3.1.3
74+
jinja2==3.1.4
7475
# via frictionless
7576
jsonlines==4.0.0
7677
# via hdx-python-utilities
7778
jsonpath-ng==1.6.1
7879
# via libhxl
79-
jsonschema==4.17.3
80+
jsonschema==4.22.0
8081
# via
8182
# frictionless
8283
# tableschema-to-template
84+
jsonschema-specifications==2023.12.1
85+
# via jsonschema
8386
libhxl==5.2.1
8487
# via hdx-python-country
8588
loguru==0.7.2
@@ -96,19 +99,19 @@ mdurl==0.1.2
9699
more-itertools==10.2.0
97100
# via inflect
98101
ndg-httpsclient==0.5.1
99-
nodeenv==1.8.0
102+
nodeenv==1.9.1
100103
# via pre-commit
101104
num2words==0.5.13
102105
# via quantulum3
103106
oauthlib==3.2.2
104107
# via requests-oauthlib
105-
openpyxl==3.1.2
108+
openpyxl==3.1.3
106109
# via hdx-python-utilities
107110
packaging==24.0
108111
# via pytest
109112
petl==1.7.15
110113
# via frictionless
111-
platformdirs==4.2.1
114+
platformdirs==4.2.2
112115
# via virtualenv
113116
pluggy==1.5.0
114117
# via pytest
@@ -118,7 +121,7 @@ ply==3.11
118121
# libhxl
119122
pockets==0.9.1
120123
# via sphinxcontrib-napoleon
121-
pre-commit==3.7.0
124+
pre-commit==3.7.1
122125
pyasn1==0.6.0
123126
# via
124127
# ndg-httpsclient
@@ -128,19 +131,17 @@ pyasn1-modules==0.4.0
128131
# via google-auth
129132
pycparser==2.22
130133
# via cffi
131-
pydantic==2.7.1
134+
pydantic==2.7.3
132135
# via frictionless
133-
pydantic-core==2.18.2
136+
pydantic-core==2.18.4
134137
# via pydantic
135-
pygments==2.17.2
138+
pygments==2.18.0
136139
# via rich
137140
pyopenssl==24.1.0
138141
# via ndg-httpsclient
139142
pyphonetics==0.5.3
140143
# via hdx-python-country
141-
pyrsistent==0.20.0
142-
# via jsonschema
143-
pytest==8.1.1
144+
pytest==8.2.2
144145
# via pytest-cov
145146
pytest-cov==5.0.0
146147
python-dateutil==2.8.2
@@ -162,31 +163,37 @@ pyyaml==6.0.1
162163
quantulum3==0.9.1
163164
ratelimit==2.2.1
164165
# via hdx-python-utilities
165-
requests==2.31.0
166+
referencing==0.35.1
167+
# via
168+
# jsonschema
169+
# jsonschema-specifications
170+
requests==2.32.3
166171
# via
167172
# ckanapi
168173
# frictionless
169174
# libhxl
170175
# requests-file
171176
# requests-oauthlib
172-
requests-file==2.0.0
177+
requests-file==2.1.0
173178
# via hdx-python-utilities
174179
requests-oauthlib==2.0.0
175180
# via google-auth-oauthlib
176181
rfc3986==2.0.0
177182
# via frictionless
178183
rich==13.7.1
179184
# via typer
185+
rpds-py==0.18.1
186+
# via
187+
# jsonschema
188+
# referencing
180189
rsa==4.9
181190
# via google-auth
182191
ruamel-yaml==0.18.6
183192
# via hdx-python-utilities
184193
ruamel-yaml-clib==0.2.8
185194
# via ruamel-yaml
186-
setuptools==69.5.1
187-
# via
188-
# ckanapi
189-
# nodeenv
195+
setuptools==70.0.0
196+
# via ckanapi
190197
shellingham==1.5.4
191198
# via typer
192199
simpleeval==0.9.13
@@ -202,23 +209,21 @@ six==1.16.0
202209
# sphinxcontrib-napoleon
203210
sphinxcontrib-napoleon==0.7
204211
# via defopt
205-
strenum==0.4.15
206-
# via gspread
207212
stringcase==1.2.0
208213
# via frictionless
209-
structlog==24.1.0
214+
structlog==24.2.0
210215
# via libhxl
211216
tableschema-to-template==0.0.13
212217
# via hdx-python-utilities
213218
tabulate==0.9.0
214219
# via frictionless
215220
text-unidecode==1.3
216221
# via python-slugify
217-
typeguard==4.2.1
222+
typeguard==4.3.0
218223
# via inflect
219224
typer==0.12.3
220225
# via frictionless
221-
typing-extensions==4.11.0
226+
typing-extensions==4.12.1
222227
# via
223228
# frictionless
224229
# inflect
@@ -234,9 +239,9 @@ urllib3==2.2.1
234239
# via
235240
# libhxl
236241
# requests
237-
validators==0.28.1
242+
validators==0.28.3
238243
# via frictionless
239-
virtualenv==20.26.0
244+
virtualenv==20.26.2
240245
# via pre-commit
241246
wheel==0.43.0
242247
# via libhxl

src/hdx/data/resource.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ def read_formats_mappings(
172172
if configuration is None:
173173
configuration = Configuration.read()
174174
with Download(
175-
full_agent=configuration.get_user_agent()
175+
full_agent=configuration.get_user_agent(),
176+
use_env=False,
176177
) as downloader:
177178
if url is None:
178179
url = configuration["formats_mapping_url"]
@@ -534,7 +535,9 @@ def download(self, folder: Optional[str] = None) -> Tuple[str, str]:
534535
else:
535536
headers = None
536537
with Download(
537-
full_agent=self.configuration.get_user_agent(), headers=headers
538+
full_agent=self.configuration.get_user_agent(),
539+
use_env=False,
540+
headers=headers,
538541
) as downloader:
539542
path = downloader.download_file(
540543
url, folder=folder, filename=filename

src/hdx/data/vocabulary.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ def _read_approved_tags(
258258
Returns:
259259
List[str]: List of approved tags
260260
"""
261-
with Download(full_agent=configuration.get_user_agent()) as downloader:
261+
with Download(
262+
full_agent=configuration.get_user_agent(), use_env=False
263+
) as downloader:
262264
if url is None:
263265
url = configuration["tags_list_url"]
264266
return list(
@@ -402,7 +404,8 @@ def read_tags_mappings(
402404
if configuration is None:
403405
configuration = Configuration.read()
404406
with Download(
405-
full_agent=configuration.get_user_agent()
407+
full_agent=configuration.get_user_agent(),
408+
use_env=False,
406409
) as downloader:
407410
if url is None:
408411
url = configuration["tags_mapping_url"]

0 commit comments

Comments
 (0)