diff options
-rw-r--r-- | .github/workflows/ci.yaml | 195 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | c/_cffi_backend.c | 2 | ||||
-rw-r--r-- | c/test_c.py | 2 | ||||
-rw-r--r-- | cffi/__init__.py | 4 | ||||
-rw-r--r-- | cffi/_embedding.h | 2 | ||||
-rw-r--r-- | doc/source/conf.py | 4 | ||||
-rw-r--r-- | doc/source/installation.rst | 8 | ||||
-rw-r--r-- | doc/source/whatsnew.rst | 17 | ||||
-rw-r--r-- | setup.py | 11 | ||||
-rw-r--r-- | testing/cffi0/test_version.py | 1 |
12 files changed, 231 insertions, 19 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b26dfec --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,195 @@ +on: push + +jobs: + sdist: + runs-on: ubuntu-20.04 + steps: + - name: clone repo + uses: actions/checkout@v2 + + - name: build sdist + run: | + rm -rf dist/ + python -m pip install build + python -m build --sdist + + - name: upload sdist artifact + uses: actions/upload-artifact@v2 + with: + path: dist + if-no-files-found: error + + linux: + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - spec: cp27-manylinux_x86_64 + cibw_version: cibuildwheel<2.0 # py2.7 is not supported on CIBW 2.0+ + manylinux_img: manylinux1 # build really old Pythons on manylinux1 + - spec: cp36-manylinux_x86_64 + manylinux_img: manylinux1 # build really old Pythons on manylinux1 + - spec: cp37-manylinux_x86_64 + - spec: cp38-manylinux_x86_64 + - spec: cp39-manylinux_x86_64 + - spec: cp310-manylinux_x86_64 + - spec: cp27-manylinux_i686 + cibw_version: cibuildwheel<2.0 # py2.7 is not supported on CIBW 2.0+ + manylinux_img: manylinux1 # build really old Pythons on manylinux1 + - spec: cp36-manylinux_i686 + manylinux_img: manylinux1 # build really old Pythons on manylinux1 + - spec: cp37-manylinux_i686 + - spec: cp38-manylinux_i686 + - spec: cp39-manylinux_i686 + - spec: cp310-manylinux_i686 + steps: + - name: clone repo + uses: actions/checkout@v2 + + - name: build/test wheels + env: + CIBW_ARCHS_LINUX: auto + CIBW_BUILD: ${{ matrix.spec }} + CIBW_BEFORE_BUILD: | + set -eux && \ + curl -L -O https://github.com/libffi/libffi/archive/v3.4.2.tar.gz && \ + tar zxf v3.4.2.tar.gz && cd libffi-3.4.2 && \ + ./autogen.sh && \ + ./configure --without-gcc-arch --disable-docs && \ + make && \ + make install && \ + ldconfig + # TODO: update default to '' once CIBW 2.1.3 ships: https://github.com/pypa/cibuildwheel/pull/829 + CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_img || 'manylinux2010' }} + CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_img || 'manylinux2010' }} + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: python -m pytest {project}/c {project}/testing + run: | + python -m pip install --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" + + # actually build libyaml + wheel (using env tweaks above) + python -m cibuildwheel --output-dir dist . + + + - name: upload artifacts + uses: actions/upload-artifact@v2 + with: + path: dist + if-no-files-found: error + + + macos: + defaults: + run: + shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} + runs-on: ${{ matrix.runs_on || 'macos-10.15' }} + strategy: + matrix: + include: + # build for x86_64 under the default hosted macOS 10.x x86_64 runner + - spec: cp27-macosx_x86_64 + cibw_version: cibuildwheel<2.0 # py2.7 is not supported on CIBW 2.0+ + - spec: cp36-macosx_x86_64 + - spec: cp37-macosx_x86_64 + - spec: cp38-macosx_x86_64 + - spec: cp39-macosx_x86_64 + - spec: cp310-macosx_x86_64 + # build for arm64 under a hacked macOS 12 self-hosted x86_64-on-arm64 runner until arm64 is fully supported + # FIXME: ? cp38-macosx_arm64 requires special handling and fails some test_zdist tests under cibw 2.1.2, skip it (so Apple's XCode python3 won't have a wheel) + - spec: cp39-macosx_arm64 + deployment_target: '11.0' + runs_on: [self-hosted, macOS] + run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} + sdkroot: macosx11.3 + + - spec: cp310-macosx_arm64 + deployment_target: '11.0' + runs_on: [self-hosted, macOS] + run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} + sdkroot: macosx11.3 + steps: + - name: clone repo + uses: actions/checkout@v2 + + - name: build wheel prereqs + run: | + /usr/bin/pip3 install --user --upgrade "${{ matrix.cibw_version || 'cibuildwheel' }}" + brew uninstall --ignore-dependencies libffi || true + + - name: build/test wheels + env: + CIBW_BUILD: ${{ matrix.spec }} + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: pip install pip --upgrade; cd {project}; pytest + run: | + if [[ -n "${{ matrix.deployment_target || '' }}" ]] + then + export MACOSX_DEPLOYMENT_TARGET="${{ matrix.deployment_target || '' }}" + fi + + if [[ -n "${{ matrix.sdkroot || '' }}" ]] + then + export SDKROOT="${{ matrix.sdkroot || '' }}" + fi + + /usr/bin/python3 -m cibuildwheel --output-dir dist + + - name: upload artifacts + uses: actions/upload-artifact@v2 + with: + path: dist + if-no-files-found: error + + windows: + runs-on: windows-2016 + strategy: + matrix: + include: + - spec: cp27-win_amd64 + cibw_version: cibuildwheel==1.10 # last release with proper py2.7 Windows support + - spec: cp36-win_amd64 + - spec: cp37-win_amd64 + - spec: cp38-win_amd64 + - spec: cp39-win_amd64 + - spec: cp310-win_amd64 + - spec: cp27-win32 + cibw_version: cibuildwheel==1.10 # last release with proper py2.7 Windows support + - spec: cp36-win32 + - spec: cp37-win32 + - spec: cp38-win32 + - spec: cp39-win32 + - spec: cp310-win32 + steps: + - name: clone repo + uses: actions/checkout@v2 + + # HACK: MS killed this SDK support package and removed downloads, as did chocolatey, install from a private archive + - name: install Windows Python 2.7 SDK + run: | + $msiPath = Join-Path ([IO.Path]::GetTempPath()) 'VCForPython27.msi' + [Net.WebClient]::new().DownloadFile('https://raw.githubusercontent.com/nitzmahone/VCPython27/master/VCForPython27.msi', $msiPath) + Start-Process -FilePath msiexec.exe -Wait -ArgumentList @( + '/i', + $msiPath, + '/qn', + '/norestart' + ) + shell: powershell + if: ${{ contains(matrix.spec, 'cp27') }} + + - name: build/test wheels + env: + CIBW_BUILD: ${{ matrix.spec }} + run: | + python -m pip install --upgrade pip + pip install "${{ matrix.cibw_version || 'cibuildwheel'}}" + # FIXME: /testing takes ~45min on Windows and has some failures... + # CIBW_TEST_REQUIRES=pytest CIBW_TEST_COMMAND='python -m pytest {project}/c {project}/testing' cibuildwheel --output-dir dist . + CIBW_TEST_REQUIRES=pytest CIBW_TEST_COMMAND='python -m pytest {project}/c' cibuildwheel --output-dir dist . + shell: bash + + - name: upload artifacts + uses: actions/upload-artifact@v2 + with: + path: dist + if-no-files-found: error diff --git a/MANIFEST.in b/MANIFEST.in index e9fdd6a..b8ca2e0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ recursive-include cffi *.py *.h -recursive-include c *.c *.h *.asm *.py win64.obj +recursive-include c *.c *.h *.asm *.py win64.obj ffi.lib recursive-include testing *.py *.c *.h recursive-include doc *.py *.rst Makefile *.bat recursive-include demo py.cleanup *.py embedding_test.c manual.c @@ -8,7 +8,7 @@ in the doc/ subdirectory. Download -------- -[Download page](https://bitbucket.org/cffi/cffi/downloads) +[Download page](https://foss.heptapod.net/pypy/cffi/-/tags) Contact ------- diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 3e0351b..ffecbf9 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -2,7 +2,7 @@ #include <Python.h> #include "structmember.h" -#define CFFI_VERSION "1.14.6" +#define CFFI_VERSION "1.15.0" #ifdef MS_WIN32 #include <windows.h> diff --git a/c/test_c.py b/c/test_c.py index cd8def7..654584d 100644 --- a/c/test_c.py +++ b/c/test_c.py @@ -17,7 +17,7 @@ from _cffi_backend import __version__ # ____________________________________________________________ import sys -assert __version__ == "1.14.6", ("This test_c.py file is for testing a version" +assert __version__ == "1.15.0", ("This test_c.py file is for testing a version" " of cffi that differs from the one that we" " get from 'import _cffi_backend'") if sys.version_info < (3,): diff --git a/cffi/__init__.py b/cffi/__init__.py index cdc26f0..82a9618 100644 --- a/cffi/__init__.py +++ b/cffi/__init__.py @@ -5,8 +5,8 @@ from .api import FFI from .error import CDefError, FFIError, VerificationError, VerificationMissing from .error import PkgConfigError -__version__ = "1.14.6" -__version_info__ = (1, 14, 6) +__version__ = "1.15.0" +__version_info__ = (1, 15, 0) # The verifier module file names are based on the CRC32 of a string that # contains the following version number. It may be older than __version__ diff --git a/cffi/_embedding.h b/cffi/_embedding.h index 7410231..e863d85 100644 --- a/cffi/_embedding.h +++ b/cffi/_embedding.h @@ -224,7 +224,7 @@ static int _cffi_initialize_python(void) if (f != NULL && f != Py_None) { PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME - "\ncompiled with cffi version: 1.14.6" + "\ncompiled with cffi version: 1.15.0" "\n_cffi_backend module: ", f); modules = PyImport_GetModuleDict(); mod = PyDict_GetItemString(modules, "_cffi_backend"); diff --git a/doc/source/conf.py b/doc/source/conf.py index 0b13937..33e8c11 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -45,9 +45,9 @@ copyright = u'2012-2018, Armin Rigo, Maciej Fijalkowski' # built documents. # # The short X.Y version. -version = '1.14' +version = '1.15' # The full version, including alpha/beta/rc tags. -release = '1.14.6' +release = '1.15.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/installation.rst b/doc/source/installation.rst index b587a97..6d55eb5 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -52,13 +52,13 @@ Download and Installation: * https://pypi.python.org/pypi/cffi -* Checksums of the "source" package version 1.14.6: +* Checksums of the "source" package version 1.15.0: - - MD5: 5c118a18ea897df164dbff67a32876fc + - MD5: f3a3f26cd3335fc597479c9475da0a0b - - SHA1: 35bb24955834ecb5b7173e625fa95b02d638fcfd + - SHA1: 9c51c29e35510adf7f94542e1f8e05611930b07b - - SHA256: c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd + - SHA256: 920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954 * Or grab the most current version from the `Heptapod page`_: ``hg clone https://foss.heptapod.net/pypy/cffi`` diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index ff09168..aa7f2fe 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -2,6 +2,23 @@ What's New ====================== +v1.15.0 +======= + +* Fixed MANIFEST.in to include missing file for Windows arm64 support + +* Fixed Linux wheel build to use gcc default ISA for libffi + +* Updated setup.py Python trove specifiers to currently-tested Python versions + +* CPython 3.10 support (including wheels) + +* MacOS arm64 support (including wheels) + +* Initial Windows arm64 support + +* Misc. doc and test updates + v1.14.6 ======= @@ -186,7 +186,7 @@ Contact `Mailing list <https://groups.google.com/forum/#!forum/python-cffi>`_ """, - version='1.14.6', + version='1.15.0', packages=['cffi'] if cpython else [], package_data={'cffi': ['_cffi_include.h', 'parse_c_type.h', '_embedding.h', '_cffi_errors.h']} @@ -224,14 +224,13 @@ Contact classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'License :: OSI Approved :: MIT License', diff --git a/testing/cffi0/test_version.py b/testing/cffi0/test_version.py index d380b98..facb84c 100644 --- a/testing/cffi0/test_version.py +++ b/testing/cffi0/test_version.py @@ -18,6 +18,7 @@ def test_version(): version_info = '.'.join(str(i) for i in cffi.__version_info__) version_info = version_info.replace('.beta.', 'b') version_info = version_info.replace('.plus', '+') + version_info = version_info.replace('.rc', 'rc') assert v == version_info #v = BACKEND_VERSIONS.get(v, v) assert v == _cffi_backend.__version__ |