Skip to content

Commit 4d7aa82

Browse files
authored
Merge pull request #3126 from HypothesisWorks/create-pull-request/patch
2 parents e329685 + 7cd920e commit 4d7aa82

5 files changed

Lines changed: 49 additions & 25 deletions

File tree

‎requirements/coverage.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mypy-extensions==0.4.3
2828
# via
2929
# black
3030
# typing-inspect
31-
numpy==1.21.2
31+
numpy==1.21.3
3232
# via
3333
# -r requirements/coverage.in
3434
# pandas
@@ -40,7 +40,7 @@ pathspec==0.9.0
4040
# via black
4141
platformdirs==2.4.0
4242
# via black
43-
pyparsing==2.4.7
43+
pyparsing==3.0.1
4444
# via packaging
4545
python-dateutil==2.8.2
4646
# via
@@ -54,7 +54,7 @@ pyyaml==6.0
5454
# via libcst
5555
redis==3.5.3
5656
# via fakeredis
57-
regex==2021.10.8
57+
regex==2021.10.23
5858
# via black
5959
six==1.16.0
6060
# via

‎requirements/test.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ py==1.10.0
2424
# via
2525
# pytest
2626
# pytest-forked
27-
pyparsing==2.4.7
27+
pyparsing==3.0.1
2828
# via packaging
2929
pytest==6.2.5
3030
# via

‎requirements/tools.in‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ flake8-2020
88
flake8-bandit
99
flake8-bugbear
1010
flake8-comprehensions
11+
flake8-datetimez
1112
flake8-docstrings
1213
flake8-mutable
14+
flake8-noqa
15+
flake8-simplify
16+
flake8-strftime
1317
ipython
1418
lark-parser
1519
libcst

‎requirements/tools.txt‎

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ alabaster==0.7.12
88
# via sphinx
99
asgiref==3.4.1
1010
# via django
11+
astor==0.8.1
12+
# via flake8-simplify
1113
attrs==21.2.0
1214
# via
1315
# flake8-bugbear
@@ -78,9 +80,14 @@ flake8==4.0.1
7880
# flake8-bandit
7981
# flake8-bugbear
8082
# flake8-comprehensions
83+
# flake8-datetimez
8184
# flake8-docstrings
85+
# flake8-helper
8286
# flake8-mutable
87+
# flake8-noqa
8388
# flake8-polyfill
89+
# flake8-simplify
90+
# flake8-strftime
8491
flake8-2020==1.6.0
8592
# via -r requirements/tools.in
8693
flake8-bandit==2.1.2
@@ -89,13 +96,23 @@ flake8-bugbear==21.9.2
8996
# via -r requirements/tools.in
9097
flake8-comprehensions==3.7.0
9198
# via -r requirements/tools.in
99+
flake8-datetimez==20.10.0
100+
# via -r requirements/tools.in
92101
flake8-docstrings==1.6.0
93102
# via -r requirements/tools.in
103+
flake8-helper==0.1.1
104+
# via flake8-strftime
94105
flake8-mutable==1.2.0
95106
# via -r requirements/tools.in
107+
flake8-noqa==1.2.0
108+
# via -r requirements/tools.in
96109
flake8-polyfill==1.0.2
97110
# via flake8-bandit
98-
gitdb==4.0.7
111+
flake8-simplify==0.14.2
112+
# via -r requirements/tools.in
113+
flake8-strftime==0.3.2
114+
# via -r requirements/tools.in
115+
gitdb==4.0.9
99116
# via gitpython
100117
gitpython==3.1.24
101118
# via bandit
@@ -154,7 +171,7 @@ pathspec==0.9.0
154171
# via black
155172
pbr==5.6.0
156173
# via stevedore
157-
pep517==0.11.1
174+
pep517==0.12.0
158175
# via pip-tools
159176
pexpect==4.8.0
160177
# via ipython
@@ -172,7 +189,7 @@ pluggy==1.0.0
172189
# via
173190
# pytest
174191
# tox
175-
prompt-toolkit==3.0.20
192+
prompt-toolkit==3.0.21
176193
# via ipython
177194
ptyprocess==0.7.0
178195
# via pexpect
@@ -197,7 +214,7 @@ pygments==2.10.0
197214
# ipython
198215
# readme-renderer
199216
# sphinx
200-
pyparsing==2.4.7
217+
pyparsing==3.0.1
201218
# via packaging
202219
pytest==6.2.5
203220
# via -r requirements/tools.in
@@ -215,7 +232,7 @@ pyyaml==6.0
215232
# libcst
216233
readme-renderer==30.0
217234
# via twine
218-
regex==2021.10.8
235+
regex==2021.10.23
219236
# via black
220237
requests==2.26.0
221238
# via
@@ -240,7 +257,7 @@ six==1.16.0
240257
# python-dateutil
241258
# tox
242259
# virtualenv
243-
smmap==4.0.0
260+
smmap==5.0.0
244261
# via gitdb
245262
snowballstemmer==2.1.0
246263
# via
@@ -257,7 +274,7 @@ sphinx==4.2.0
257274
# sphinx-rtd-theme
258275
sphinx-codeautolink==0.4.0
259276
# via -r requirements/tools.in
260-
sphinx-hoverxref==0.7b1
277+
sphinx-hoverxref==0.8b1
261278
# via -r requirements/tools.in
262279
sphinx-rtd-theme==1.0.0
263280
# via -r requirements/tools.in
@@ -277,9 +294,9 @@ sphinxcontrib-serializinghtml==1.1.5
277294
# via sphinx
278295
sqlparse==0.4.2
279296
# via django
280-
stevedore==3.4.0
297+
stevedore==3.5.0
281298
# via bandit
282-
tokenize-rt==4.1.0
299+
tokenize-rt==4.2.1
283300
# via pyupgrade
284301
toml==0.10.2
285302
# via
@@ -312,6 +329,7 @@ types-redis==3.5.15
312329
typing-extensions==3.10.0.2
313330
# via
314331
# black
332+
# flake8-noqa
315333
# gitpython
316334
# libcst
317335
# mypy
@@ -320,7 +338,7 @@ typing-inspect==0.7.1
320338
# via libcst
321339
urllib3==1.26.7
322340
# via requests
323-
virtualenv==20.8.1
341+
virtualenv==20.9.0
324342
# via tox
325343
wcwidth==0.2.5
326344
# via prompt-toolkit

‎tooling/src/hypothesistooling/__main__.py‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
from datetime import datetime
2222
from glob import glob
2323
from urllib.parse import urlparse
24-
from urllib.request import urlretrieve
2524

2625
import hypothesistooling as tools
2726
import hypothesistooling.projects.conjecturerust as cr
2827
import hypothesistooling.projects.hypothesispython as hp
2928
import hypothesistooling.projects.hypothesisruby as hr
29+
import requests
3030
from coverage.config import CoverageConfig
3131
from hypothesistooling import installers as install, releasemanagement as rm
3232
from hypothesistooling.scripts import pip_tool
@@ -280,13 +280,12 @@ def update_python_versions():
280280
result = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE).stdout.decode()
281281
# pyenv reports available versions in chronological order, so we keep the newest
282282
# *unless* our current ends with a digit (is stable) and the candidate does not.
283-
digits = tuple("0123456789")
283+
stable = re.compile(r".*3\.\d+.\d+$")
284284
best = {}
285285
for line in map(str.strip, result.splitlines()):
286-
m = re.match(r"(?:pypy)?3\.(?:[6-9]|\d\d)", line)
287-
if m:
286+
if m := re.match(r"(?:pypy)?3\.(?:[6-9]|\d\d)", line):
288287
key = m.group()
289-
if key.endswith(digits) or not best.get(key, key).endswith(digits):
288+
if stable.match(line) or not stable.match(best.get(key, line)):
290289
best[key] = line
291290
print(best)
292291
thisfile = pathlib.Path(__file__)
@@ -309,12 +308,15 @@ def update_python_versions():
309308

310309

311310
def update_vendored_files():
312-
for url in [
313-
# Turns out that as well as adding new gTLDs, IANA can *terminate* old ones
314-
"http://data.iana.org/TLD/tlds-alpha-by-domain.txt",
315-
]:
316-
fname = urlparse(url).path.split("/")[-1]
317-
urlretrieve(url, os.path.join(hp.PYTHON_SRC, "hypothesis", "vendor", fname))
311+
vendor = pathlib.Path(hp.PYTHON_SRC) / "hypothesis" / "vendor"
312+
313+
# Turns out that as well as adding new gTLDs, IANA can *terminate* old ones
314+
url = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt"
315+
fname = vendor / urlparse(url).path.split("/")[-1]
316+
new = requests.get(url).content
317+
# If only the timestamp in the header comment has changed, skip the update.
318+
if fname.read_bytes().splitlines()[1:] != new.splitlines()[1:]:
319+
fname.write_bytes(new)
318320

319321

320322
@task()

0 commit comments

Comments
 (0)