Skip to content

Commit 506cd87

Browse files
committed
Drop support for Python 3.4 at EOL
1 parent 1bb0384 commit 506cd87

File tree

9 files changed

+18
-31
lines changed

9 files changed

+18
-31
lines changed

hypothesis-python/RELEASE.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
RELEASE_TYPE: minor
2+
3+
This release blocks installation of Hypothesis on Python 3.4, which
4+
:PEP:`reached its end of life date on 2019-03-18 <429>`.
5+
6+
This should not be of interest to anyone but downstream maintainers -
7+
if you are affected, migrate to a secure version of Python as soon as
8+
possible or at least seek commercial support.

hypothesis-python/docs/supported.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for the details.
1111
Python versions
1212
---------------
1313

14-
Hypothesis is supported and tested on CPython 2.7 and CPython 3.4+, i.e.
14+
Hypothesis is supported and tested on CPython 2.7 and CPython 3.5+, i.e.
1515
`all versisions of CPython with upstream support <https://devguide.python.org/#status-of-python-branches>`_,
1616

1717
Hypothesis also supports the latest PyPy for both Python 2 (until 2020) and Python 3.

hypothesis-python/setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def local_file(name):
9393
zip_safe=False,
9494
extras_require=extras,
9595
install_requires=install_requires,
96-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
96+
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
9797
classifiers=[
9898
"Development Status :: 5 - Production/Stable",
9999
"Framework :: Hypothesis",
@@ -106,7 +106,6 @@ def local_file(name):
106106
"Programming Language :: Python",
107107
"Programming Language :: Python :: 2.7",
108108
"Programming Language :: Python :: 3",
109-
"Programming Language :: Python :: 3.4",
110109
"Programming Language :: Python :: 3.5",
111110
"Programming Language :: Python :: 3.6",
112111
"Programming Language :: Python :: 3.7",

hypothesis-python/src/hypothesis/searchstrategy/regex.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@
5555
sre.CATEGORY_NOT_WORD: BYTES_ALL - BYTES_WORD,
5656
}
5757

58-
# On Python < 3.4 (including 2.7), the following unicode chars are weird.
59-
# They are matched by the \W, meaning 'not word', but unicodedata.category(c)
60-
# returns one of the word categories above. There's special handling below.
61-
HAS_WEIRD_WORD_CHARS = sys.version_info[:2] < (3, 4)
58+
# On Python 2, these unicode chars are matched by \W, meaning 'not word',
59+
# but unicodedata.category(c) returns one of the word categories above.
6260
UNICODE_WEIRD_NONWORD_CHARS = set(u"\U00012432\U00012433\U00012456\U00012457")
6361

6462

@@ -164,16 +162,12 @@ def add_category(self, category):
164162
elif category == sre.CATEGORY_WORD:
165163
self._categories |= UNICODE_WORD_CATEGORIES
166164
self._whitelist_chars.add(u"_")
167-
if HAS_WEIRD_WORD_CHARS and self._unicode: # pragma: no cover
168-
# This code is workaround of weird behavior in
169-
# specific Python versions and run only on those versions
165+
if self._unicode and not PY3: # pragma: no cover
170166
self._blacklist_chars |= UNICODE_WEIRD_NONWORD_CHARS
171167
elif category == sre.CATEGORY_NOT_WORD:
172168
self._categories |= UNICODE_CATEGORIES - UNICODE_WORD_CATEGORIES
173169
self._blacklist_chars.add(u"_")
174-
if HAS_WEIRD_WORD_CHARS and self._unicode: # pragma: no cover
175-
# This code is workaround of weird behavior in
176-
# specific Python versions and run only on those versions
170+
if self._unicode and not PY3: # pragma: no cover
177171
self._whitelist_chars |= UNICODE_WEIRD_NONWORD_CHARS
178172
else: # pragma: no cover
179173
raise AssertionError("Unknown character category: %s" % category)

hypothesis-python/tests/cover/test_regex.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from hypothesis.errors import InvalidArgument
2929
from hypothesis.internal.compat import PY3, hrange, hunichr
3030
from hypothesis.searchstrategy.regex import (
31-
HAS_WEIRD_WORD_CHARS,
3231
SPACE_CHARS,
3332
UNICODE_DIGIT_CATEGORIES,
3433
UNICODE_SPACE_CATEGORIES,
@@ -63,7 +62,7 @@ def is_word(s):
6362
return all(
6463
c == "_"
6564
or (
66-
(not HAS_WEIRD_WORD_CHARS or c not in UNICODE_WEIRD_NONWORD_CHARS)
65+
(PY3 or c not in UNICODE_WEIRD_NONWORD_CHARS)
6766
and unicodedata.category(c) in UNICODE_WORD_CATEGORIES
6867
)
6968
for c in s

hypothesis-python/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,34,35,36,37,py27}-{brief,prettyquick,full,custom}
2+
envlist = py{27,35,36,37,py27}-{brief,prettyquick,full,custom}
33
toxworkdir={env:TOX_WORK_DIR:.tox}
44

55
[testenv]

scripts/install.ps1

+1-5
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ function InstallPip ($python_home) {
9696

9797
function DownloadMiniconda ($python_version, $platform_suffix) {
9898
$webclient = New-Object System.Net.WebClient
99-
if ($python_version -eq "3.4") {
100-
$filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe"
101-
} else {
102-
$filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe"
103-
}
99+
$filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe"
104100
$url = $MINICONDA_URL + $filename
105101

106102
$basedir = $pwd.Path + "\"

tooling/scripts/install-python.sh

-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ for var in "$@"; do
9191
2.7.3)
9292
install 2.7.3 python2.7.3
9393
;;
94-
3.4)
95-
install 3.4.9 python3.4
96-
;;
9794
3.5)
9895
install 3.5.6 python3.5
9996
;;

tooling/src/hypothesistooling/__main__.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ def run_tox(task, version):
368368

369369

370370
PY27 = "2.7.14"
371-
PY34 = "3.4.8"
372371
PY35 = "3.5.5"
373372
PY36 = "3.6.5"
374373
PY37 = "3.7.0"
@@ -384,7 +383,7 @@ def install_core():
384383

385384
ALIASES = {PYPY2: "pypy", PYPY3: "pypy3"}
386385

387-
for n in [PY27, PY34, PY35, PY36, PY37]:
386+
for n in [PY27, PY35, PY36, PY37]:
388387
major, minor, patch = n.split(".")
389388
ALIASES[n] = "python%s.%s" % (major, minor)
390389

@@ -403,11 +402,6 @@ def check_py27():
403402
run_tox("py27-full", PY27)
404403

405404

406-
@python_tests
407-
def check_py34():
408-
run_tox("py34-full", PY34)
409-
410-
411405
@python_tests
412406
def check_py35():
413407
run_tox("py35-full", PY35)

0 commit comments

Comments
 (0)