From f9745b8089fa2645be7b8823c979f5192df3eec7 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 31 Aug 2022 13:24:17 -0400 Subject: [PATCH] fix: drop support for python 3.6 (#145) * fix: drop support for python 3.6 * workaround setuptools editable install issue --- .appveyor.yml | 78 ---------------------------- .github/workflows/presubmit.yml | 5 +- README.md | 2 +- mypy.ini | 2 +- noxfile.py | 6 +-- scripts/manylinux/build.sh | 4 +- scripts/manylinux/build_on_centos.sh | 5 +- scripts/manylinux/check.sh | 6 +-- scripts/osx/build.sh | 24 +++++---- scripts/osx/check.sh | 50 +++++++++--------- scripts/windows/test.bat | 5 -- setup.cfg | 3 +- 12 files changed, 56 insertions(+), 134 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 76edf9ab..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -image: Visual Studio 2017 - -# We always use a 64-bit machine, but can build x86 distributions -# with the TARGET_ARCH variable. -platform: - - x64 - -environment: - matrix: - - CMAKE_GENERATOR: "Visual Studio 15 2017" - PYTHON35: "C:\\Python35" - PYTHON36: "C:\\Python36" - PYTHON37: "C:\\Python37" - - CMAKE_GENERATOR: "Visual Studio 15 2017 Win64" - PYTHON35: "C:\\Python35-x64" - PYTHON36: "C:\\Python36-x64" - PYTHON37: "C:\\Python37-x64" - -matrix: - fast_finish: true - -install: - # Fetch submodules - - git submodule update --init --recursive - - cmake --version - - # Make sure Python environments are up to date. - # Pin wheel to 0.26.0 to avoid Windows ABI tag for built wheel - # For context: https://github.com/pypa/wheel/issues/161 and - # https://github.com/pypa/wheel/issues/171 - - "%PYTHON35%\\python -m pip install --upgrade pip wheel==0.26.0" - - "%PYTHON36%\\python -m pip install --upgrade pip wheel==0.26.0" - - "%PYTHON37%\\python -m pip install --upgrade pip wheel==0.26.0" - - # Set up environment - - git submodule update --init --recursive - - set BUILD_DIR=%APPVEYOR_BUILD_FOLDER%\crc32c\build - - set CRC32C_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\usr - -build_script: - # First, build libcrc32c - - mkdir %BUILD_DIR% - - cd %BUILD_DIR% - - cmake - -G "%CMAKE_GENERATOR%" - -DCMAKE_BUILD_TYPE=Release - -DCRC32C_BUILD_TESTS=no - -DCRC32C_BUILD_BENCHMARKS=no - -DBUILD_SHARED_LIBS=yes - -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes - -DCMAKE_INSTALL_PREFIX:PATH=%CRC32C_INSTALL_PREFIX% - .. - - cmake --build . --config RelWithDebInfo --target install - - dir %CRC32C_INSTALL_PREFIX% /b /s - - # Build wheels (requires CRC32C_INSTALL_PREFIX is set) - - cd %APPVEYOR_BUILD_FOLDER% - - "%PYTHON35%\\python -m pip wheel ." - - "%PYTHON36%\\python -m pip wheel ." - - "%PYTHON37%\\python -m pip wheel ." - -test_script: - # Install the wheel with pip - - "%PYTHON35%\\python -m pip install --no-index --find-links=. google-crc32c" - - "%PYTHON36%\\python -m pip install --no-index --find-links=. google-crc32c" - - "%PYTHON37%\\python -m pip install --no-index --find-links=. google-crc32c" - # Install pytest with pip - - "%PYTHON35%\\python -m pip install pytest" - - "%PYTHON36%\\python -m pip install pytest" - - "%PYTHON37%\\python -m pip install pytest" - # Run the tests - - "%PYTHON35%/python -m pytest tests" - - "%PYTHON36%/python -m pytest tests" - - "%PYTHON37%/python -m pytest tests" - -artifacts: - - path: 'google_crc32c*win*.whl' diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 17ba5d13..52c44c76 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -14,12 +14,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.6" + python-version: "3.9" - name: Install nox run: | python -m ensurepip python -m pip install nox - name: Run mypy + env: + # workaround for https://github.com/pypa/setuptools/issues/3557 + SETUPTOOLS_ENABLE_FEATURES: legacy-editable run: | nox -s mypy diff --git a/README.md b/README.md index 3cf27035..adf13671 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ C toolchain. # Currently Published Wheels -Wheels are currently published for Python 3.6, 3.7, 3.8, 3.9, 3.10, and +Wheels are currently published for Python 3.7, 3.8, 3.9, 3.10, 3.11 and pypy-3.7 for multiple architectures. For information on building your own, please view [BUILDING.md](BUILDING.md). diff --git a/mypy.ini b/mypy.ini index 19d08026..8efb6f72 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.6 +python_version = 3.9 exclude = tests/unit/resources/ diff --git a/noxfile.py b/noxfile.py index 1e146a42..c03ba807 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ HERE = os.path.dirname(__file__) -@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def build_libcrc32c(session): session.env["PY_BIN"] = f"python{session.python}" session.env["REPO_ROOT"] = HERE @@ -39,7 +39,7 @@ def build_libcrc32c(session): raise Exception("Unsupported") -@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def check(session): session.install("pytest") session.install("--no-index", f"--find-links={HERE}/wheels", "google-crc32c") @@ -49,7 +49,7 @@ def check(session): session.run("python", f"{HERE}/scripts/check_crc32c_extension.py", *session.posargs) -@nox.session(python="3.6") +@nox.session(python="3.9") def mypy(session): """Verify type hints are mypy compatible.""" session.install("-e", ".") diff --git a/scripts/manylinux/build.sh b/scripts/manylinux/build.sh index 6dfb4582..31e18b7b 100755 --- a/scripts/manylinux/build.sh +++ b/scripts/manylinux/build.sh @@ -27,8 +27,8 @@ git submodule update --init --recursive # Note: PyPA's support for the 'manylinux1' image ends on 2022-01-01. # See: https://github.com/pypa/manylinux/issues/994 -# No 3.10 support for 'manylinux1'. -if [[ "${BUILD_PYTHON}" != "3.10"* ]]; then +# No 3.1* support for 'manylinux1'. +if [[ "${BUILD_PYTHON}" != "3.1"* ]]; then docker pull quay.io/pypa/manylinux1_x86_64 docker run \ --rm \ diff --git a/scripts/manylinux/build_on_centos.sh b/scripts/manylinux/build_on_centos.sh index efc027f6..e6d2871d 100755 --- a/scripts/manylinux/build_on_centos.sh +++ b/scripts/manylinux/build_on_centos.sh @@ -45,10 +45,7 @@ if [[ -z ${BUILD_PYTHON} ]]; then # Collect all target Python versions. for PYTHON_BIN in /opt/python/*/bin; do # H/T: https://stackoverflow.com/a/229606/1068170 - if [[ "${PYTHON_BIN}" == *"36"* ]]; then - PYTHON_VERSIONS="${PYTHON_VERSIONS} ${PYTHON_BIN}" - continue - elif [[ "${PYTHON_BIN}" == *"37"* ]]; then + if [[ "${PYTHON_BIN}" == *"37"* ]]; then PYTHON_VERSIONS="${PYTHON_VERSIONS} ${PYTHON_BIN}" continue elif [[ "${PYTHON_BIN}" == *"38"* ]]; then diff --git a/scripts/manylinux/check.sh b/scripts/manylinux/check.sh index 8e042ec5..a069ff9d 100755 --- a/scripts/manylinux/check.sh +++ b/scripts/manylinux/check.sh @@ -21,11 +21,11 @@ echo "CHECKING ON LINUX" VERSION=$(awk "/version \= ([0-9.]+)/" setup.cfg) PACKAGE_VERSION=${VERSION:10} WHEEL_FILE="wheels/google_crc32c-${PACKAGE_VERSION}-cp36-cp36m-manylinux1_x86_64.whl" -PYTHON=python3.6 +PYTHON=python3.7 -# Using pyenv, set 3.6.1 as a local python version. +# Using pyenv, set 3.7.13 as a local python version. # pyenv versions -pyenv local 3.6.1 +pyenv local 3.7.13 # Make sure we can create a virtual environment. ${PYTHON} -m pip install --upgrade setuptools pip wheel diff --git a/scripts/osx/build.sh b/scripts/osx/build.sh index 64af4b02..bccfb838 100755 --- a/scripts/osx/build.sh +++ b/scripts/osx/build.sh @@ -24,10 +24,11 @@ SCRIPTS_DIR=$(dirname ${OSX_DIR}) export REPO_ROOT=$(dirname ${SCRIPTS_DIR}) # NOTE: These are the Python.org versions of Python. -PYTHON36="/Library/Frameworks/Python.framework/Versions/3.6/bin" PYTHON37="/Library/Frameworks/Python.framework/Versions/3.7/bin" PYTHON38="/Library/Frameworks/Python.framework/Versions/3.8/bin" PYTHON39="/Library/Frameworks/Python.framework/Versions/3.9/bin" +PYTHON310="/Library/Frameworks/Python.framework/Versions/3.10/bin" +PYTHON311="/Library/Frameworks/Python.framework/Versions/3.11/bin" # Build and install `libcrc32c` export PY_BIN="${PY_BIN:-python3}" @@ -38,11 +39,6 @@ git submodule update --init --recursive ${OSX_DIR}/build_c_lib.sh -# Build wheel for Python 3.6. -export PY_BIN="python3.6" -export PY_TAG="cp36-cp36m" -${OSX_DIR}/build_python_wheel.sh - # Build wheel for Python 3.7. export PY_BIN="python3.7" export PY_TAG="cp37-cp37m" @@ -54,12 +50,20 @@ export PY_BIN="python3.8" export PY_TAG="cp38-cp38" ${OSX_DIR}/build_python_wheel.sh -# TODO: As of 2020-12-11, 3.9 is not available on our CI # Build wheel for Python 3.9. -#export PY_BIN="python3.9" -#export PY_TAG="cp39-cp39" -#${OSX_DIR}/build_python_wheel.sh +export PY_BIN="python3.9" +export PY_TAG="cp39-cp39" +${OSX_DIR}/build_python_wheel.sh +# Build wheel for Python 3.10. +export PY_BIN="python3.10" +export PY_TAG="cp310-cp310" +${OSX_DIR}/build_python_wheel.sh + +# Build wheel for Python 3.11. +export PY_BIN="python3.11" +export PY_TAG="cp311-cp311" +${OSX_DIR}/build_python_wheel.sh # Clean up. rm -fr ${CRC32C_INSTALL_PREFIX} diff --git a/scripts/osx/check.sh b/scripts/osx/check.sh index fc0c6847..10d7b270 100755 --- a/scripts/osx/check.sh +++ b/scripts/osx/check.sh @@ -28,13 +28,11 @@ export REPO_ROOT=$(dirname ${SCRIPTS_DIR}) ls ${REPO_ROOT}/wheels # NOTE: These are the Python.org versions of Python. -PYTHON36="/Library/Frameworks/Python.framework/Versions/3.6/bin" PYTHON37="/Library/Frameworks/Python.framework/Versions/3.7/bin" PYTHON38="/Library/Frameworks/Python.framework/Versions/3.8/bin" - -# PYTHON37="/users/crwilcox/.pyenv/versions/3.7.2/bin" -# PYTHON36="/users/crwilcox/.pyenv/versions/3.6.6/bin" -# PYTHON35="/users/crwilcox/.pyenv/versions/3.5.6/bin" +PYTHON39="/Library/Frameworks/Python.framework/Versions/3.9/bin" +PYTHON310="/Library/Frameworks/Python.framework/Versions/3.10/bin" +PYTHON311="/Library/Frameworks/Python.framework/Versions/3.11/bin" # Make sure we have an updated `pip`. curl https://bootstrap.pypa.io/get-pip.py | ${PYTHON37}/python3 @@ -44,17 +42,6 @@ ${PYTHON37}/python3 -m pip install --upgrade delocate LISTDEPS_CMD="${PYTHON37}/delocate-listdeps --all --depending" VIRTUALENV_CMD="${PYTHON37}/python3 -m venv" - -${PYTHON36}/python3 -m venv venv36 -curl https://bootstrap.pypa.io/get-pip.py | venv36/bin/python3 -WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp36-cp36m-macosx_10_9_x86_64.whl -venv36/bin/pip install ${WHL} -venv36/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py -venv36/bin/pip install pytest -venv36/bin/py.test ${REPO_ROOT}/tests -${LISTDEPS_CMD} ${WHL} -rm -fr venv36 - ${PYTHON37}/python3 -m venv venv37 curl https://bootstrap.pypa.io/get-pip.py | venv37/bin/python3 WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp37-cp37m-macosx_10_9_x86_64.whl @@ -75,11 +62,26 @@ venv38/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py ${LISTDEPS_CMD} ${WHL} rm -fr venv38 -# TODO: As of 2020-12-11, 3.9 is not available on our CI -# ${PYTHON39}/python3 -m venv venv39 -# curl https://bootstrap.pypa.io/get-pip.py | venv39/bin/python3 -# WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp39-cp39-macosx_10_9_x86_64.whl -# venv37/bin/pip install ${WHL} -# venv37/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py -# ${LISTDEPS_CMD} ${WHL} -# rm -fr venv39 +${PYTHON39}/python3 -m venv venv39 +curl https://bootstrap.pypa.io/get-pip.py | venv39/bin/python3 +WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp39-cp39-macosx_10_9_x86_64.whl +venv39/bin/pip install ${WHL} +venv39/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py +${LISTDEPS_CMD} ${WHL} +rm -fr venv39 + +${PYTHON310}/python3 -m venv venv310 +curl https://bootstrap.pypa.io/get-pip.py | venv310/bin/python3 +WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp310-cp310-macosx_10_9_x86_64.whl +venv310/bin/pip install ${WHL} +venv310/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py +${LISTDEPS_CMD} ${WHL} +rm -fr venv310 + +${PYTHON311}/python3 -m venv venv311 +curl https://bootstrap.pypa.io/get-pip.py | venv311/bin/python3 +WHL=${REPO_ROOT}/wheels/google_crc32c-${PACKAGE_VERSION}-cp311-cp311-macosx_10_9_x86_64.whl +venv311/bin/pip install ${WHL} +venv311/bin/python ${REPO_ROOT}/scripts/check_crc32c_extension.py +${LISTDEPS_CMD} ${WHL} +rm -fr venv311 diff --git a/scripts/windows/test.bat b/scripts/windows/test.bat index be6d363b..dc169a5c 100644 --- a/scripts/windows/test.bat +++ b/scripts/windows/test.bat @@ -19,12 +19,7 @@ if "%PYTHON_VERSION%"=="" ( set PYTHON_VERSION=3.9 ) -if "%PYTHON_VERSION%"=="3.10-dev" ( - set PYTHON_VERSION=3.10 -) - @rem update python deps and build wheels (requires CRC32C_INSTALL_PREFIX is set) -@rem FOR %%V IN (3.5-64,3.5-32,3.6-64,3.6-32,3.7-64,3.7-32) DO ( @REM FOR %%V IN (3.9-64,3.9-32) DO ( FOR %%V IN (%PYTHON_VERSION%-32, %PYTHON_VERSION%-64) DO ( py -%%V -m pip install --no-index --find-links=wheels google-crc32c --force-reinstall diff --git a/setup.cfg b/setup.cfg index 1ec2cb29..46c181d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,6 @@ classifiers = License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -39,7 +38,7 @@ classifiers = [options] zip_safe = True -python_requires = >=3.6 +python_requires = >=3.7 [options.extras_require] testing = pytest