Skip to content

Commit d4c4b85

Browse files
committed
chore: drop Python 2 support, require 3.6+
1 parent fdc222c commit d4c4b85

File tree

6 files changed

+12
-100
lines changed

6 files changed

+12
-100
lines changed

.appveyor.yml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ environment:
99
PYTHONWARNINGS: ignore:DEPRECATION
1010
MSSdk: 1
1111
matrix:
12-
- PYTHON: 27
1312
- PYTHON: 36
1413
install:
1514
- cmd: '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%'

.github/workflows/pip.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
platform: [windows-latest, macos-latest, ubuntu-latest]
16-
python-version: ["2.7", "3.5", "3.8", "3.9"]
16+
python-version: ["3.6", "3.10"]
1717

1818
runs-on: ${{ matrix.platform }}
1919

@@ -27,22 +27,6 @@ jobs:
2727
- name: Add requirements
2828
run: python -m pip install --upgrade wheel setuptools
2929

30-
# Eventually Microsoft might have an action for setting up
31-
# MSVC, but for now, this action works:
32-
- name: Prepare compiler environment for Windows 🐍 2.7
33-
if: matrix.python-version == 2.7 && runner.os == 'Windows'
34-
uses: ilammy/msvc-dev-cmd@v1
35-
with:
36-
arch: x64
37-
38-
# This makes two environment variables available in the following step(s)
39-
- name: Set Windows 🐍 2.7 environment variables
40-
if: matrix.python-version == 2.7 && runner.os == 'Windows'
41-
shell: bash
42-
run: |
43-
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
44-
echo "MSSdk=1" >> $GITHUB_ENV
45-
4630
- name: Build and install
4731
run: pip install --verbose .
4832

.github/workflows/wheels.yml

+3-50
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ on:
1010
types:
1111
- published
1212

13-
env:
14-
CIBW_TEST_COMMAND: python {project}/tests/test.py
15-
CIBW_ARCHS_MACOS: auto universal2
16-
CIBW_TEST_SKIP: "*universal2:arm64"
17-
18-
1913
jobs:
2014
build_sdist:
2115
name: Build SDist
@@ -45,11 +39,9 @@ jobs:
4539
steps:
4640
- uses: actions/checkout@v2
4741

48-
- uses: pypa/cibuildwheel@v1.12.0
42+
- uses: pypa/cibuildwheel@v2.2.0
4943
env:
50-
# Python 2.7 on Windows requires a workaround for C++11 support,
51-
# built separately below
52-
CIBW_SKIP: cp27-win*
44+
CIBW_ARCHS_MACOS: auto universal2
5345

5446
- name: Verify clean directory
5547
run: git diff --exit-code
@@ -61,48 +53,9 @@ jobs:
6153
path: wheelhouse/*.whl
6254

6355

64-
# Windows 2.7 (requires workaround for MSVC 2008 replacement)
65-
build_win27_wheels:
66-
name: Py 2.7 wheels on Windows
67-
runs-on: windows-latest
68-
69-
steps:
70-
- uses: actions/checkout@v2
71-
with:
72-
submodules: true
73-
74-
- uses: ilammy/msvc-dev-cmd@v1
75-
76-
- name: Build 64-bit wheel
77-
uses: pypa/[email protected]
78-
env:
79-
CIBW_BUILD: cp27-win_amd64
80-
DISTUTILS_USE_SDK: 1
81-
MSSdk: 1
82-
83-
- uses: ilammy/msvc-dev-cmd@v1
84-
with:
85-
arch: x86
86-
87-
- name: Build 32-bit wheel
88-
uses: pypa/[email protected]
89-
env:
90-
CIBW_BUILD: cp27-win32
91-
DISTUTILS_USE_SDK: 1
92-
MSSdk: 1
93-
94-
- name: Verify clean directory
95-
run: git diff --exit-code
96-
shell: bash
97-
98-
- uses: actions/upload-artifact@v2
99-
with:
100-
path: wheelhouse/*.whl
101-
102-
10356
upload_all:
10457
name: Upload if release
105-
needs: [build_wheels, build_win27_wheels, build_sdist]
58+
needs: [build_wheels, build_sdist]
10659
runs-on: ubuntu-latest
10760
if: github.event_name == 'release' && github.event.action == 'published'
10861

README.md

+2-31
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,15 @@ python_example
2727
[appveyor-badge]: https://travis-ci.org/pybind/python_example.svg?branch=master&status=passed
2828

2929
An example project built with [pybind11](https://github.com/pybind/pybind11).
30+
This requires Python 3.6+; for older versions of Python, check the commit
31+
history.
3032

3133
Installation
3234
------------
3335

34-
**On Unix (Linux, OS X)**
35-
3636
- clone this repository
3737
- `pip install ./python_example`
3838

39-
**On Windows (Requires Visual Studio 2015)**
40-
41-
- For Python 3.5+:
42-
- clone this repository
43-
- `pip install ./python_example`
44-
- For Python 2.7:
45-
46-
Pybind11 requires a C++11 compliant compiler (i.e. Visual Studio 2015 on
47-
Windows). Running a regular `pip install` command will detect the version
48-
of the compiler used to build Python and attempt to build the extension
49-
with it. We must force the use of Visual Studio 2015.
50-
51-
- clone this repository
52-
- `"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64`
53-
- `set DISTUTILS_USE_SDK=1`
54-
- `set MSSdk=1`
55-
- `pip install ./python_example`
56-
57-
Note that this requires the user building `python_example` to have registry edition
58-
rights on the machine, to be able to run the `vcvarsall.bat` script.
59-
6039
CI Examples
6140
-----------
6241

@@ -65,14 +44,6 @@ binary "wheels" for all platforms is illustrated in the "wheels.yml" file,
6544
using [`cibuildwheel`][]. You can also see a basic recipe for building and
6645
testing in `pip.yml`, and `conda.yml` has an example of a conda recipe build.
6746

68-
Windows Python 2.7 runtime requirements
69-
----------------------------
70-
71-
On Windows, the Visual C++ 2015 redistributable packages are a runtime
72-
requirement for this project if you build for Python 2.7 (newer versions of
73-
Python include this redistributable). It can be found
74-
[here](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
75-
7647

7748
Building the documentation
7849
--------------------------

pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
requires = [
33
"setuptools>=42",
44
"wheel",
5-
"pybind11>=2.7.0",
5+
"pybind11>=2.8.0",
66
]
77

88
build-backend = "setuptools.build_meta"
9+
10+
[tool.cibuildwheel]
11+
test-command = "python {project}/tests/test.py"
12+
test-skip = "*universal2:arm64"

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
# level" feature, but in the future it may provide more features.
4040
cmdclass={"build_ext": build_ext},
4141
zip_safe=False,
42+
python_requires=">=3.6",
4243
)

0 commit comments

Comments
 (0)