Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5725bc4
configure the release to PyPI
achille-roussel Feb 13, 2024
07d8cd9
fix github workflow
achille-roussel Feb 13, 2024
bacb69e
fix github workflow permissions
achille-roussel Feb 13, 2024
41b21bc
fix github workflow permissions (2)
achille-roussel Feb 13, 2024
0083142
add build step to workflow
achille-roussel Feb 13, 2024
e1c6a81
fix syntax error in pypi.yml
achille-roussel Feb 13, 2024
40d39cb
fix syntax error in pypi.yml (2)
achille-roussel Feb 13, 2024
52ff5ba
use manylinux
achille-roussel Feb 13, 2024
009b05b
remove unsupported files
achille-roussel Feb 13, 2024
2a6105c
sudo
achille-roussel Feb 13, 2024
1d01c6e
build wheels for amd64 and arm64
achille-roussel Feb 13, 2024
13e122f
try a cibuildwheel
achille-roussel Feb 13, 2024
5c4fc4e
fix syntax error in pypi.yml
achille-roussel Feb 13, 2024
af2c2ad
fix artifact upload
achille-roussel Feb 13, 2024
6da1517
try to fix the build once more
achille-roussel Feb 13, 2024
2f97277
make python version explicit
achille-roussel Feb 13, 2024
0a01a5c
fix artifact upload name
achille-roussel Feb 13, 2024
bc3789f
fix creation of pypi archive
achille-roussel Feb 13, 2024
ce77d26
specify python version to create archive
achille-roussel Feb 13, 2024
fd517af
couple more fixes and cleanup
achille-roussel Feb 13, 2024
42f0009
enable git versioning
achille-roussel Feb 13, 2024
044a8f9
upgrade setup-python to v5
achille-roussel Feb 13, 2024
b5b909b
fix artifact names
achille-roussel Feb 13, 2024
9bbba79
commit
achille-roussel Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: PyPI

on:
- push:
tags:
- 'v*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
archive:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.11'
- run: python -m pip install build
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: archive
path: dist/*.tar.gz

build:
name: build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-13
- macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.11'
- run: python -m pip install build cibuildwheel==2.16.5
- run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl

release:
needs:
- archive
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dispatch-functions
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: '*'
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 12 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test

on: [push]
on:
- push

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
Expand All @@ -10,28 +15,28 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.11", "3.12"]
python: ['3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache: pip
- run: make dev
- run: make test

format:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.12"]
python: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache: pip
- run: make dev
- run: make fmt-check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
.proto
.coverage
.coverage-html
dist/
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: install test typecheck unittest dev fmt fmt-check generate clean update-proto coverage
.PHONY: install test typecheck unittest dev fmt fmt-check generate clean update-proto coverage build check push push-test

PYTHON := python

Expand Down Expand Up @@ -50,8 +50,18 @@ generate: .proto/dispatch-sdk
$(MAKE) fmt

clean:
rm -rf .proto
rm -rf .coverage
rm -rf .coverage-html
$(RM) -rf dist .proto .coverage .coverage-html
find . -type f -name '*.pyc' -exec rm {} \;
find . -type d -name '__pycache__' -exec rm -r {} \;

build:
$(PYTHON) -m build

check:
twine check dist/*

push:
twine upload dist/*

push-test:
twine upload -r testpypi dist/*
35 changes: 18 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,33 @@ requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "dispatch-sdk"
name = "dispatch-functions"
description = "Python SDK for Dispatch Stateful Functions"
readme = "README.md"
dynamic = ["version"]
requires-python = ">= 3.11"
# TODO: relax dependency versions
dependencies = [
"grpcio==1.60.0",
"protobuf==4.24.0",
"types-protobuf==4.24.0.20240129",
"grpc-stubs",
"http_message_signatures==0.4.4"
"grpcio >= 1.60.0",
"protobuf >= 4.24.0",
"types-protobuf >= 4.24.0.20240129",
"grpc-stubs >= 1.53.0.5",
"http-message-signatures >= 0.4.4"
]

[project.optional-dependencies]
dev = [
"black==24.1.0",
"isort==5.13.2",
"mypy==1.8.0",
"fastapi==0.109.0",
"httpx==0.26.0",
"coverage==7.4.1",
"requests==2.31.0",
"types-requests==2.31.0.20240125"
"black >= 24.1.0",
"isort >= 5.13.2",
"mypy >= 1.8.0",
"fastapi >= 0.109.0",
"httpx >= 0.26.0",
"coverage >= 7.4.1",
"requests >= 2.31.0",
"types-requests >= 2.31.0.20240125"
]

[tool.setuptools.dynamic]
version = {attr = "dispatch.__version__"}
[tool.setuptools-git-versioning]
enabled = true

[tool.isort]
profile = "black"
Expand Down
2 changes: 0 additions & 2 deletions src/dispatch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@
"poll",
"exit",
]

__version__ = "0.0.1"