forked from andreasvc/pyre2
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
# Conflicts: # .github/workflows/ci.yml # .github/workflows/main.yml # .github/workflows/release.yml # CMakeLists.txt # Makefile # README.rst # pyproject.toml # requirements-cibw.txt # setup.cfg # setup.py # tox.ini
- Loading branch information
Showing
32 changed files
with
1,336 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: CondaDev | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Test on Python ${{ matrix.python-version }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ['ubuntu-22.04', 'macos-13'] | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
PYTHONIOENCODING: utf-8 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: conda-incubator/setup-miniconda@v3 | ||
env: | ||
PY_VER: ${{ matrix.python-version }} | ||
with: | ||
activate-environment: pyre2 | ||
channels: conda-forge | ||
allow-softlinks: true | ||
channel-priority: flexible | ||
show-channel-urls: true | ||
|
||
- name: Cache conda packages | ||
id: cache | ||
uses: actions/cache@v4 | ||
env: | ||
# Increase this value to reset cache and rebuild the env during the PR | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: /home/runner/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('environment.devenv.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- | ||
- name: Configure condadev environment | ||
shell: bash -el {0} | ||
env: | ||
PY_VER: ${{ matrix.python-version }} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda install conda-devenv | ||
conda devenv | ||
- name: Build and test | ||
shell: bash -el {0} | ||
env: | ||
PY_VER: ${{ matrix.python-version }} | ||
run: | | ||
source activate pyre2 | ||
python -m pip install .[test] -vv | ||
python -m pytest -v . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,33 @@ name: Build | |
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
#push: | ||
#branches: | ||
#- master | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} for Python | ||
cibw_wheels: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, macos-latest, windows-latest] | ||
include: | ||
- os: "ubuntu-22.04" | ||
arch: "x86_64" | ||
- os: "ubuntu-22.04" | ||
arch: "aarch64" | ||
- os: "macos-13" | ||
arch: "x86_64" | ||
macosx_deployment_target: "13.0" | ||
- os: "macos-14" | ||
arch: "arm64" | ||
macosx_deployment_target: "14.0" | ||
- os: "windows-latest" | ||
arch: "auto64" | ||
triplet: "x64-windows" | ||
- os: "windows-latest" | ||
arch: "auto32" | ||
triplet: "x86-windows" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -26,43 +41,39 @@ jobs: | |
with: | ||
python-version: '3.12' | ||
|
||
- name: Prepare compiler environment for Windows | ||
if: runner.os == 'Windows' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
arch: amd64 | ||
|
||
- name: Install cibuildwheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements-cibw.txt | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* | ||
CIBW_ARCHS_MACOS: "universal2" | ||
CIBW_ARCHS_LINUX: "auto64" | ||
CIBW_ARCHS_WINDOWS: "auto64" | ||
CIBW_SKIP: "*musllinux*" | ||
# configure cibuildwheel to build native archs ('auto'), and some | ||
# emulated ones, plus cross-compile on macos | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686" | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_MANYLINUX_I686_IMAGE: manylinux2010 | ||
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* | ||
CIBW_SKIP: "*musllinux* *i686" | ||
CIBW_BEFORE_ALL_LINUX: > | ||
yum -y -q --enablerepo=extras install epel-release | ||
&& yum install -y re2-devel ninja-build | ||
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}" | ||
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build | ||
CIBW_BEFORE_ALL_MACOS: > | ||
brew install re2 pybind11 ninja | ||
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.15 | ||
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install delocate && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}" | ||
brew install re2 pybind11 | ||
# macos target should be at least 10.13 to get full c++17 | ||
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }} | ||
CIBW_BEFORE_ALL_WINDOWS: > | ||
vcpkg install re2:x64-windows | ||
vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }} | ||
&& vcpkg integrate install | ||
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' | ||
CIBW_TEST_COMMAND: python -c "import re2" | ||
run: | | ||
python -m cibuildwheel --output-dir wheelhouse | ||
CIBW_TEST_REQUIRES: "" | ||
CIBW_TEST_COMMAND: "" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-${{ matrix.os }} | ||
name: wheels-${{ matrix.os }}-${{ matrix.arch }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
|
@@ -78,28 +89,27 @@ jobs: | |
|
||
- name: Build sdist | ||
run: | | ||
pip install pep517 | ||
python -m pep517.build -s . | ||
pip install build | ||
python -m build -s . | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-source | ||
path: dist/*.tar.gz | ||
|
||
check_artifacts: | ||
needs: [build_sdist, build_wheels] | ||
needs: [build_sdist, cibw_wheels] | ||
defaults: | ||
run: | ||
shell: bash | ||
name: Check artifacts are correct | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: dist-* | ||
merge-multiple: true | ||
path: dist | ||
# note wheels should be in subdirectory <upload_name> | ||
path: artifacts | ||
|
||
# note wheels should be in subdirectories named <artifact_name> | ||
- name: Check number of downloaded artifacts | ||
run: ls -R | ||
run: ls -l artifacts/ |
Oops, something went wrong.