-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from hpyproject/fa/prepare_0.9
Prepare next release (version 0.9.0).
- Loading branch information
Showing
8 changed files
with
286 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
--- | ||
name: Release to PyPI | ||
name: Publish to PyPI | ||
|
||
# manually trigger this workflow | ||
on: | ||
release: | ||
types: [created] | ||
|
||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The Git tag to create or test a release for. Official releases should always be made from an existing tag.' | ||
required: true | ||
type: string | ||
official: | ||
description: 'If true, publish to official PyPI and create GitHub release. Otherwise publish only to test PyPI.' | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build source package | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
# HPy requires at least Python 3.8; we mostly work with >=3.10 | ||
python-version: '>=3.10' | ||
|
||
- name: Install/Upgrade Python dependencies | ||
run: python -m pip install --upgrade pip wheel | ||
run: python -m pip install --upgrade pip wheel 'setuptools>=60.2' | ||
|
||
- name: Build and install Python source package | ||
run: | | ||
|
@@ -23,12 +39,14 @@ jobs: | |
- name: Run tests | ||
run: | | ||
pip install pytest pytest-xdist | ||
make | ||
pip install pytest pytest-xdist filelock | ||
pytest -n auto test/ | ||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
retention-days: 5 | ||
|
||
|
||
build_bdist: | ||
|
@@ -37,46 +55,87 @@ jobs: | |
strategy: | ||
matrix: | ||
# Windows tests fail when built as a binary wheel for some reason | ||
os: [ubuntu-latest, macos-latest] # windows-latest | ||
# 'macos-12' doesn't pass the tests | ||
os: [ubuntu-latest, macos-11] # windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
|
||
# setup Python for cibuildwheel | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
# for other architectures, see: https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation | ||
- name: Build wheels for CPython | ||
uses: pypa/cibuildwheel@v2.1.1 | ||
uses: pypa/cibuildwheel@v2.12.3 | ||
env: | ||
CIBW_BUILD: 'cp*' # no PyPI builds | ||
CIBW_SKIP: 'cp310-*' # 3.10 builds are broken | ||
CIBW_ARCHS: 'auto64' # only 64-bit | ||
CIBW_TEST_REQUIRES: pytest pytest-xdist | ||
CIBW_TEST_COMMAND: pytest -n auto {project}/test/ | ||
|
||
- uses: actions/upload-artifact@v2 | ||
# cibuildwheel automatically reads 'python_requires' from 'setup.py' | ||
CIBW_BUILD: 'cp*' # no PyPy builds | ||
CIBW_ARCHS_LINUX: "x86_64" # only Intel 64-bit | ||
CIBW_ARCHS_MACOS: "x86_64" # only Intel 64-bit | ||
CIBW_TEST_REQUIRES: pytest pytest-xdist filelock setuptools>=60.2 | ||
# only copy test dir to current working dir | ||
CIBW_TEST_COMMAND: cp -R {project}/test ./ && pytest --basetemp=.tmpdir --ignore=test/hpy_devel -n auto ./test/ | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
retention-days: 5 | ||
|
||
upload_pypi: | ||
name: Publish packages to PyPI | ||
# only publish packages once everything is successful | ||
needs: [build_bdist, build_sdist] | ||
name: Publish packages to (Test) PyPI | ||
needs: [build_sdist, build_bdist] | ||
runs-on: ubuntu-latest | ||
# don't do this action on forks by default | ||
if: github.event_name == 'push' && github.repository == 'hpyproject/hpy' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Upload to Test PyPI | ||
uses: pypa/[email protected] | ||
if: ${{ !inputs.official }} | ||
with: | ||
verbose: true | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/[email protected] | ||
if: ${{ inputs.official }} | ||
with: | ||
verbose: true | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
create_gh_release: | ||
needs: [upload_pypi] | ||
runs-on: ubuntu-latest | ||
# don't do this action on forks by default | ||
if: github.event_name == 'push' && github.repository == 'hpyproject/hpy' | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_api_token }} | ||
# uncomment the following to upload to test.pypi.org | ||
# repository_url: https://test.pypi.org/legacy/ | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
# consider tags in form '*.*.*rc*' to indicate a pre-release | ||
prerelease: ${{ contains(github.ref, 'rc') }} | ||
draft: ${{ !inputs.official }} | ||
tag_name: ${{ inputs.tag }} |
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,5 @@ | ||
HPy Dict | ||
======== | ||
|
||
.. autocmodule:: autogen/public_api.h | ||
:members: HPyDict_Check, HPyDict_New, HPyDict_Keys, HPyDict_Copy |
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ between the modes. | |
hpy-call | ||
hpy-field | ||
hpy-global | ||
hpy-dict | ||
hpy-gil | ||
hpy-err | ||
builder | ||
|
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
Oops, something went wrong.