Skip to content

Commit 30e8f2e

Browse files
committed
Build: Remove support for Python 2.7 and Py3 < 3.8.
1 parent 0c0df1b commit 30e8f2e

File tree

4 files changed

+7
-46
lines changed

4 files changed

+7
-46
lines changed

.github/workflows/ci.yml

+4-18
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fail-fast: false
3737

3838
matrix:
39-
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
39+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
4040

4141
include:
4242
- python-version: "3.14-dev"
@@ -49,21 +49,9 @@ jobs:
4949

5050
- name: Set up Python
5151
uses: actions/setup-python@v5
52-
if: startsWith(matrix.python-version, '3.')
5352
with:
5453
python-version: ${{ matrix.python-version }}
5554

56-
- name: Set up Python2 (Linux)
57-
if: matrix.python-version == '2.7' && startsWith(matrix.os, 'ubuntu')
58-
run: |
59-
sudo ln -fs python2 /usr/bin/python
60-
sudo apt-get update
61-
sudo apt-get install python-setuptools python2-dev
62-
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
63-
sudo python2 get-pip.py
64-
ls -l /usr/bin/pip* /usr/local/bin/pip*
65-
which pip
66-
6755
- name: Install Dependency
6856
run: |
6957
python -m pip install -U pip setuptools && python -m pip install -r requirements.txt
@@ -77,7 +65,7 @@ jobs:
7765
run: make testslow
7866

7967
- name: Running benchmark
80-
if: startsWith(matrix.python-version, '3.') && matrix.python-version != '3.5'
68+
if: startsWith(matrix.python-version, '3.')
8169
run: |
8270
python benchmark/telco_fractions.py -n 250
8371
python benchmark/microbench.py create pydigits
@@ -154,10 +142,8 @@ jobs:
154142
fail-fast: false
155143

156144
matrix:
157-
#os: [macos-10.15, windows-latest]
158-
#os: [macos-10.15, macOS-M1]
159-
os: [macos-latest, windows-latest]
160-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
145+
os: [macos-13, windows-latest]
146+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
161147

162148
include:
163149
- python-version: "3.14-dev"

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ChangeLog
44
1.19 (2024-??-??)
55
-----------------
66

7+
* Support for Python 2.7 as well as 3.7 and earlier has been discontinued.
8+
79
* Generally use ``.as_integer_ratio()`` in the constructor if available.
810
https://github.com/python/cpython/pull/120271
911

setup.py

-27
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,6 @@
4747
ext_modules = cythonize(
4848
ext_modules, compiler_directives=compiler_directives, force=force_rebuild)
4949

50-
# Fix compiler warning due to missing pragma-push in Cython 3.0.9.
51-
for ext in ext_modules:
52-
for source_file in ext.sources:
53-
with open(source_file, 'rb') as f:
54-
lines = f.readlines()
55-
if b'Generated by Cython 3.0.9' not in lines[0]:
56-
continue
57-
58-
modified = False
59-
temp_file = source_file + ".tmp"
60-
with open(temp_file, 'wb') as f:
61-
last_was_push = False
62-
for line in lines:
63-
if b'#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"' in line and not last_was_push:
64-
f.write(b"#pragma GCC diagnostic push\n")
65-
modified = True
66-
last_was_push = b'#pragma GCC diagnostic push' in line
67-
f.write(line)
68-
69-
if modified:
70-
print("Fixed Cython 3.0.9 generated source file " + source_file)
71-
os.unlink(source_file)
72-
os.rename(temp_file, source_file)
73-
else:
74-
os.unlink(temp_file)
75-
7650
if cythonize is None:
7751
for ext_module in ext_modules:
7852
ext_module.sources[:] = [m.replace('.pyx', '.c') for m in ext_module.sources]
@@ -121,7 +95,6 @@
12195
"Intended Audience :: Developers",
12296
"Operating System :: OS Independent",
12397
"Programming Language :: Python",
124-
"Programming Language :: Python :: 2",
12598
"Programming Language :: Python :: 3",
12699
"Programming Language :: Cython",
127100
"Topic :: Scientific/Engineering :: Mathematics",

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,35,36,37,38,39,310,311,312}
2+
envlist = py{37,38,39,310,311,312,313}
33

44
[testenv]
55
platform =

0 commit comments

Comments
 (0)