From 17ca17ea0e7447d5500250ce64f0b0f88b3e1f8d Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Wed, 6 Oct 2021 13:19:30 -0700 Subject: [PATCH 1/3] Support 3.10 wheel --- .github/workflows/ci.yml | 2 ++ .../build-wheels-manylinux2014-aarch64.sh | 3 +++ .../build-wheels-manylinux2014-x86_64.sh | 3 +++ continuous-delivery/build-wheels-osx.sh | 1 + continuous-delivery/build-wheels-win32.bat | 1 + continuous-delivery/build-wheels-win64.bat | 1 + setup.py | 17 ++++++++++++++++- 7 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf20b18c..79b6a45d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - cp37-cp37m - cp38-cp38 - cp39-cp39 + - cp310-cp310 steps: - name: Build ${{ env.PACKAGE_NAME }} run: | @@ -53,6 +54,7 @@ jobs: - cp37-cp37m - cp38-cp38 - cp39-cp39 + - cp310-cp310 steps: # Only aarch64 needs this, but it doesn't hurt anything - name: Install qemu/docker diff --git a/continuous-delivery/build-wheels-manylinux2014-aarch64.sh b/continuous-delivery/build-wheels-manylinux2014-aarch64.sh index abf1f2e74..09d112db9 100755 --- a/continuous-delivery/build-wheels-manylinux2014-aarch64.sh +++ b/continuous-delivery/build-wheels-manylinux2014-aarch64.sh @@ -16,6 +16,9 @@ auditwheel repair --plat manylinux2014_aarch64 dist/awscrt-*cp38*.whl /opt/python/cp39-cp39/bin/python setup.py sdist bdist_wheel auditwheel repair --plat manylinux2014_aarch64 dist/awscrt-*cp39*.whl +/opt/python/cp310-cp310/bin/python setup.py sdist bdist_wheel +auditwheel repair --plat manylinux2014_aarch64 dist/awscrt-*cp310*.whl + rm dist/*.whl cp -rv wheelhouse/* dist/ diff --git a/continuous-delivery/build-wheels-manylinux2014-x86_64.sh b/continuous-delivery/build-wheels-manylinux2014-x86_64.sh index 3a8f29f5f..3e7641398 100755 --- a/continuous-delivery/build-wheels-manylinux2014-x86_64.sh +++ b/continuous-delivery/build-wheels-manylinux2014-x86_64.sh @@ -16,6 +16,9 @@ auditwheel repair --plat manylinux2014_x86_64 dist/awscrt-*cp38*.whl /opt/python/cp39-cp39/bin/python setup.py sdist bdist_wheel auditwheel repair --plat manylinux2014_x86_64 dist/awscrt-*cp39*.whl +/opt/python/cp310-cp310/bin/python setup.py sdist bdist_wheel +auditwheel repair --plat manylinux2014_x86_64 dist/awscrt-*cp310*.whl + rm dist/*.whl cp -rv wheelhouse/* dist/ diff --git a/continuous-delivery/build-wheels-osx.sh b/continuous-delivery/build-wheels-osx.sh index bf1f053d8..d79ce0f0c 100755 --- a/continuous-delivery/build-wheels-osx.sh +++ b/continuous-delivery/build-wheels-osx.sh @@ -10,5 +10,6 @@ export MACOSX_DEPLOYMENT_TARGET="10.9" /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 setup.py sdist bdist_wheel /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 setup.py sdist bdist_wheel /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 setup.py sdist bdist_wheel +/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 setup.py sdist bdist_wheel #now you just need to run twine (that's in a different script) diff --git a/continuous-delivery/build-wheels-win32.bat b/continuous-delivery/build-wheels-win32.bat index afe9352d0..83e1393f1 100644 --- a/continuous-delivery/build-wheels-win32.bat +++ b/continuous-delivery/build-wheels-win32.bat @@ -5,6 +5,7 @@ "C:\Program Files (x86)\Python37-32\python.exe" setup.py sdist bdist_wheel || goto error "C:\Program Files (x86)\Python38-32\python.exe" setup.py sdist bdist_wheel || goto error "C:\Program Files (x86)\Python39-32\python.exe" setup.py sdist bdist_wheel || goto error +"C:\Program Files (x86)\Python310-32\python.exe" setup.py sdist bdist_wheel || goto error goto :EOF diff --git a/continuous-delivery/build-wheels-win64.bat b/continuous-delivery/build-wheels-win64.bat index b0b6a7a19..f48b756cf 100644 --- a/continuous-delivery/build-wheels-win64.bat +++ b/continuous-delivery/build-wheels-win64.bat @@ -4,6 +4,7 @@ "C:\Program Files\Python37\python.exe" setup.py sdist bdist_wheel || goto error "C:\Program Files\Python38\python.exe" setup.py sdist bdist_wheel || goto error "C:\Program Files\Python39\python.exe" setup.py sdist bdist_wheel || goto error +"C:\Program Files\Python310\python.exe" setup.py sdist bdist_wheel || goto error goto :EOF diff --git a/setup.py b/setup.py index eef396bfe..de081614c 100644 --- a/setup.py +++ b/setup.py @@ -223,6 +223,21 @@ def run(self): super().run() +cmdclass = {'build_ext': awscrt_build_ext} + +if sys.version_info > (3,) and platform.python_implementation() == "CPython": + try: + import wheel.bdist_wheel + except ImportError: + pass + else: + class BDistWheel(wheel.bdist_wheel.bdist_wheel): + def finalize_options(self): + self.py_limited_api = "cp3{}".format(sys.version_info[1]) + wheel.bdist_wheel.bdist_wheel.finalize_options(self) + cmdclass['bdist_wheel'] = BDistWheel + + def awscrt_ext(): # fetch the CFLAGS/LDFLAGS from env extra_compile_args = os.environ.get('CFLAGS', '').split() @@ -302,7 +317,7 @@ def _load_version(): ], python_requires='>=3.6', ext_modules=[awscrt_ext()], - cmdclass={'build_ext': awscrt_build_ext}, + cmdclass=cmdclass, test_suite='test', tests_require=[ 'boto3' From cb5d54a7d4b5b708ba806ccd799386b00ddc75c1 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Wed, 6 Oct 2021 13:40:31 -0700 Subject: [PATCH 2/3] remove 3.10 for manylinux1 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79b6a45d2..2aa52cfc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,6 @@ jobs: - cp37-cp37m - cp38-cp38 - cp39-cp39 - - cp310-cp310 steps: - name: Build ${{ env.PACKAGE_NAME }} run: | From a25f4fd7a0f03095e4cb2509010eba41d13d84ad Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Wed, 6 Oct 2021 14:47:22 -0700 Subject: [PATCH 3/3] I don't think we need that --- setup.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/setup.py b/setup.py index de081614c..eef396bfe 100644 --- a/setup.py +++ b/setup.py @@ -223,21 +223,6 @@ def run(self): super().run() -cmdclass = {'build_ext': awscrt_build_ext} - -if sys.version_info > (3,) and platform.python_implementation() == "CPython": - try: - import wheel.bdist_wheel - except ImportError: - pass - else: - class BDistWheel(wheel.bdist_wheel.bdist_wheel): - def finalize_options(self): - self.py_limited_api = "cp3{}".format(sys.version_info[1]) - wheel.bdist_wheel.bdist_wheel.finalize_options(self) - cmdclass['bdist_wheel'] = BDistWheel - - def awscrt_ext(): # fetch the CFLAGS/LDFLAGS from env extra_compile_args = os.environ.get('CFLAGS', '').split() @@ -317,7 +302,7 @@ def _load_version(): ], python_requires='>=3.6', ext_modules=[awscrt_ext()], - cmdclass=cmdclass, + cmdclass={'build_ext': awscrt_build_ext}, test_suite='test', tests_require=[ 'boto3'