mirror of
https://github.com/google/re2.git
synced 2025-10-20 12:55:57 +08:00
Revert "Make the extension work for Python 3.8+."
This reverts commit 3a9939d2ae
.
Reason for revert: pybind11 doesn't support `Py_LIMITED_API`;
as per https://github.com/pybind/pybind11/issues/1755, it has
probably never worked and it will probably never work.
Change-Id: Ie603151d31ad07a77d469f0050270d416fe8d21b
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61872
Reviewed-by: Paul Wankadia <junyer@google.com>
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
This commit is contained in:
27
.github/workflows/python.yml
vendored
27
.github/workflows/python.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
type: number
|
type: number
|
||||||
jobs:
|
jobs:
|
||||||
wheel-linux:
|
wheel-linux:
|
||||||
name: Linux ${{ matrix.os }}, ${{ matrix.arch.name }}
|
name: Linux ${{ matrix.os }}, ${{ matrix.arch.name }}, Python ${{ matrix.ver }}
|
||||||
runs-on: ${{ matrix.arch.runs-on }}
|
runs-on: ${{ matrix.arch.runs-on }}
|
||||||
container:
|
container:
|
||||||
image: quay.io/pypa/${{ matrix.os }}_${{ matrix.arch.python-name }}
|
image: quay.io/pypa/${{ matrix.os }}_${{ matrix.arch.python-name }}
|
||||||
@@ -19,16 +19,17 @@ jobs:
|
|||||||
- { name: X64, python-name: x86_64, runs-on: [ubuntu-latest] }
|
- { name: X64, python-name: x86_64, runs-on: [ubuntu-latest] }
|
||||||
- { name: ARM64, python-name: aarch64, runs-on: [self-hosted, linux, arm64] }
|
- { name: ARM64, python-name: aarch64, runs-on: [self-hosted, linux, arm64] }
|
||||||
os: [manylinux2014, manylinux_2_28]
|
os: [manylinux2014, manylinux_2_28]
|
||||||
|
ver: ['3.8', '3.9', '3.10', '3.11']
|
||||||
env:
|
env:
|
||||||
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
# TODO(junyer): Use `v2` whenever a new release is tagged.
|
# TODO(junyer): Use `v2` whenever a new release is tagged.
|
||||||
- uses: bazelbuild/setup-bazelisk@6244971d4f7ba9aca943c2f3ede2bbd813fcca51
|
- uses: bazelbuild/setup-bazelisk@6244971d4f7ba9aca943c2f3ede2bbd813fcca51
|
||||||
- name: Prepare Python environment
|
- name: Prepare Python ${{ matrix.ver }} environment
|
||||||
run: |
|
run: |
|
||||||
ln -sf /usr/local/bin/python3.8 /usr/local/bin/python
|
ln -sf /usr/local/bin/python${{ matrix.ver }} /usr/local/bin/python
|
||||||
ln -sf /usr/local/bin/python3.8 /usr/local/bin/python3
|
ln -sf /usr/local/bin/python${{ matrix.ver }} /usr/local/bin/python3
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install --upgrade build wheel auditwheel
|
python -m pip install --upgrade build wheel auditwheel
|
||||||
python -m pip install --upgrade absl-py
|
python -m pip install --upgrade absl-py
|
||||||
@@ -57,7 +58,7 @@ jobs:
|
|||||||
path: python/google_re2-*.whl
|
path: python/google_re2-*.whl
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
wheel-macos:
|
wheel-macos:
|
||||||
name: macOS ${{ matrix.os }}, ${{ matrix.arch.name }}
|
name: macOS ${{ matrix.os }}, ${{ matrix.arch.name }}, Python ${{ matrix.ver }}
|
||||||
runs-on: macos-${{ matrix.os }}
|
runs-on: macos-${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -66,6 +67,7 @@ jobs:
|
|||||||
- { name: X64, bazel-name: x86_64, python-name: x86_64 }
|
- { name: X64, bazel-name: x86_64, python-name: x86_64 }
|
||||||
- { name: ARM64, bazel-name: arm64, python-name: arm64 }
|
- { name: ARM64, bazel-name: arm64, python-name: arm64 }
|
||||||
os: [11, 12, 13]
|
os: [11, 12, 13]
|
||||||
|
ver: ['3.8', '3.9', '3.10', '3.11']
|
||||||
env:
|
env:
|
||||||
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BAZEL_CPU: darwin_${{ matrix.arch.bazel-name }}
|
BAZEL_CPU: darwin_${{ matrix.arch.bazel-name }}
|
||||||
@@ -79,8 +81,8 @@ jobs:
|
|||||||
- uses: bazelbuild/setup-bazelisk@6244971d4f7ba9aca943c2f3ede2bbd813fcca51
|
- uses: bazelbuild/setup-bazelisk@6244971d4f7ba9aca943c2f3ede2bbd813fcca51
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: ${{ matrix.ver }}
|
||||||
- name: Prepare Python environment
|
- name: Prepare Python ${{ matrix.ver }} environment
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install --upgrade build wheel delocate
|
python -m pip install --upgrade build wheel delocate
|
||||||
@@ -105,7 +107,7 @@ jobs:
|
|||||||
path: python/google_re2-*.whl
|
path: python/google_re2-*.whl
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
wheel-windows:
|
wheel-windows:
|
||||||
name: Windows, ${{ matrix.arch.name }}
|
name: Windows, ${{ matrix.arch.name }}, Python ${{ matrix.ver }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -113,6 +115,7 @@ jobs:
|
|||||||
arch:
|
arch:
|
||||||
- { name: X86, bazel-name: x64_x86, python-name: win32 }
|
- { name: X86, bazel-name: x64_x86, python-name: win32 }
|
||||||
- { name: X64, bazel-name: x64, python-name: win_amd64 }
|
- { name: X64, bazel-name: x64, python-name: win_amd64 }
|
||||||
|
ver: ['3.8', '3.9', '3.10', '3.11']
|
||||||
env:
|
env:
|
||||||
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BAZEL_CPU: ${{ matrix.arch.bazel-name }}_windows
|
BAZEL_CPU: ${{ matrix.arch.bazel-name }}_windows
|
||||||
@@ -132,9 +135,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: ${{ matrix.ver }}
|
||||||
architecture: ${{ env.architecture }}
|
architecture: ${{ env.architecture }}
|
||||||
- name: Prepare Python environment
|
- name: Prepare Python ${{ matrix.ver }} environment
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install --upgrade build wheel delvewheel
|
python -m pip install --upgrade build wheel delvewheel
|
||||||
@@ -167,8 +170,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.x'
|
||||||
- name: Prepare Python environment
|
- name: Prepare Python 3.x environment
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install --upgrade build wheel
|
python -m pip install --upgrade build wheel
|
||||||
|
@@ -2,10 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// The extension works for Python 3.8+.
|
|
||||||
// See https://docs.python.org/3/c-api/stable.html for background.
|
|
||||||
#define Py_LIMITED_API 0x03080000
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
@@ -74,9 +74,6 @@ def options():
|
|||||||
bdist_wheel['plat_name'] = os.environ['PLAT_NAME']
|
bdist_wheel['plat_name'] = os.environ['PLAT_NAME']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
# The extension works for Python 3.8+.
|
|
||||||
# See https://docs.python.org/3/c-api/stable.html for background.
|
|
||||||
bdist_wheel['py_limited_api'] = 'cp38'
|
|
||||||
return {'bdist_wheel': bdist_wheel}
|
return {'bdist_wheel': bdist_wheel}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user