Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# 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
tyteen4a03 committed Nov 11, 2024
2 parents 76dc03f + aed0536 commit dbe3f02
Show file tree
Hide file tree
Showing 32 changed files with 1,336 additions and 277 deletions.
20 changes: 13 additions & 7 deletions .gitchangelog.rc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ignore_regexps = [
r'@wip', r'!wip',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
r'^([cC]i)\s*:',
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
r'^$', ## ignore commits with empty messages
]
Expand All @@ -85,16 +86,17 @@ section_regexps = [
('New', [
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Features', [
r'^([nN]ew|[fF]eat)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Changes', [
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Fix', [
('Fixes', [
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),

('Other', None ## Match all lines
),

]


Expand Down Expand Up @@ -150,7 +152,9 @@ subject_process = (strip |
##
## Tags that will be used for the changelog must match this regexp.
##
tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
#tag_filter_regexp = r'^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'
#tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
tag_filter_regexp = r'.*?$' # accept funky tag strings


## ``unreleased_version_label`` is a string or a callable that outputs a string
Expand All @@ -160,7 +164,9 @@ tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
#unreleased_version_label = "(unreleased)"
unreleased_version_label = lambda: swrap(
["git", "describe", "--tags"],
shell=False)
shell=False,
)


## ``output_engine`` is a callable
##
Expand Down Expand Up @@ -227,7 +233,7 @@ include_merge = True
## Outputs directly to standard output
## (This is the default)
##
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start())
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start(), flags)
##
## Creates a callable that will parse given file for the given
## regex pattern and will insert the output in the file.
Expand All @@ -242,7 +248,7 @@ include_merge = True
## take care of everything and might be more complex. Check the README
## for a complete copy-pastable example.
##
# publish = FileInsertIntoFirstRegexMatch(
# publish = FileInsertAtFirstRegexMatch(
# "CHANGELOG.rst",
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
# idx=lambda m: m.start(1)
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ on:

jobs:
python_wheels:
name: Python wheels for ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
PYTHONIOENCODING: utf-8
PIP_DOWNLOAD_CACHE: ${{ github.workspace }}/../.pip_download_cache
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -38,21 +40,16 @@ jobs:
pip install tox tox-gh-actions
- name: Install Ubuntu build deps
if: runner.os == 'Linux'
run: |
sudo apt-get -qq update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y -s ppa:nerdboy/embedded
sudo apt-get install -y pybind11-dev libre2-dev ninja-build
sudo apt-get install -y libre2-dev
- name: Test in place
- name: Test using pip install
run: |
tox -e dev
#
# - name: Build dist pkgs
# run: |
# tox -e deploy
#
# - name: Check wheel
tox
env:
PLATFORM: ${{ matrix.os }}

# - name: Build sdist and wheel pkgs
# run: |
# tox -e check
# tox -e build,check
68 changes: 68 additions & 0 deletions .github/workflows/conda-dev.yml
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 .
88 changes: 49 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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/
Loading

0 comments on commit dbe3f02

Please sign in to comment.