Skip to content

Commit

Permalink
.github/workflows/release: use pypa/cibuildwheel.
Browse files Browse the repository at this point in the history
  • Loading branch information
amirouche committed Nov 23, 2023
1 parent a9c5f93 commit 18b2f89
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 59 deletions.
64 changes: 22 additions & 42 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
name: Release
name: Build

on: workflow_dispatch


env:
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ github.head_ref || github.ref_name }}

O
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- run: gh repo clone amirouche/asyncio-foundationdb -- --branch $BRANCH --depth 1
- run: cd asyncio-foundationdb && git fetch --tags
- run: cd asyncio-foundationdb && gh release create --draft $(git tag --points-at HEAD)

check-build-release:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version:
- 3.9
- "3.10"
- "3.11"
# - "3.12" # it is still early, first released 2023-09-19.
- pypy-3.8
- pypy-3.9
os:
- ubuntu-latest
os: [ubuntu-22.04, windows-2019, macOS-11]

runs-on: ${{ matrix.os }}
name: ${{ matrix.python-version }} on ${{ matrix.os }}
needs: create-release
steps:
- run: gh repo clone amirouche/asyncio-foundationdb -- --branch $BRANCH --depth 1
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: python --version
- run: cd asyncio-foundationdb && sudo make init-foundationdb
- run: cd asyncio-foundationdb && ./venv python
- run: cd asyncio-foundationdb && ./venv make init
- run: cd asyncio-foundationdb && ./venv make database-clear
- run: cd asyncio-foundationdb && ./venv python readme.py
- run: cd asyncio-foundationdb && ./venv make check
- run: cd asyncio-foundationdb && ./venv poetry config pypi-token.pypi ${{ secrets.PYPI_ASYNCIO_FOUNDATIONDB }}
- run: cd asyncio-foundationdb && ./venv poetry publish --build --skip-existing
path: ./wheelhouse/*.whl
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions ffibuild.py → found/ffibuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
ffi.cdef(f.read())


def build(*args, **kwargs):
def main(*args, **kwargs):
ffi.compile(verbose=True)


if __name__ == "__main__":
build()
if __name__ == '__main__':
main()
5 changes: 0 additions & 5 deletions found/vnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,3 @@ async def delete_expected(tx):
out = await found.transactional(db, query_title_by_slug)

assert not out


def uvicorn(scope, receive, send):


6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help doc
PHONY: help doc

MAIN=$(shell basename $(PWD))

Expand All @@ -17,7 +17,7 @@ debian: ## Install foundationdb, requires sudo

init: ## Prepare the host sytem for development
pip install -r requirements.txt -r requirements.dev.txt
python ffibuild.py
python found/ffibuild.py
@echo "\033[95m\n\nYou may now run 'make check'.\n\033[0m"

database-clear:
Expand Down Expand Up @@ -66,5 +66,5 @@ release: ## Release package on pypi
make lock
make init
make check
python3 -m build
python3 -m build --wheel
python3 -m twine upload dist/*
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=61.0", "wheel", "cffi"]
build-backend = "setuptools.build_meta"

[project]
name = "asyncio-foundationdb"
version = "v0.12.0rc0"
version = "v0.12.0rc1"
description = "FoundationDB drivers for asyncio"
readme = "README.md"
requires-python = ">=3.10"

[console_scripts]
template = "template:__main__"
requires-python = ">=3.8"
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

0 comments on commit 18b2f89

Please sign in to comment.