Skip to content

Commit d2133e6

Browse files
committed
Fix MANIFEST, declare license properly.
Also publish pre-built wheels.
1 parent 1cbe1fd commit d2133e6

File tree

5 files changed

+99
-48
lines changed

5 files changed

+99
-48
lines changed

.github/workflows/build_and_test.yml

Lines changed: 79 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -48,57 +48,90 @@ jobs:
4848

4949
# Steps represent a sequence of tasks that will be executed as part of the job
5050
steps:
51-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
52-
- uses: actions/checkout@v4
53-
54-
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v5
56-
with:
57-
python-version: ${{ matrix.python-version }}
58-
59-
- name: Install dependencies
60-
run: |
61-
python -m pip install --upgrade pip
62-
pip install setuptools wheel
63-
shell: bash
64-
65-
- name: build
66-
run: CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build sdist
67-
shell: bash
68-
69-
- name: install
70-
run: pip install dist/*.gz
71-
shell: bash
72-
73-
- name: test
74-
run: |
75-
python -m unittest discover -v -s tests -p '*.py'
76-
shell: bash
77-
78-
publish_wheels:
51+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
52+
- uses: actions/checkout@v4
53+
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install --upgrade build setuptools wheel
63+
shell: bash
64+
65+
- name: build
66+
run: CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build sdist
67+
shell: bash
68+
69+
- name: install
70+
run: pip install dist/*.gz
71+
shell: bash
72+
73+
- name: test
74+
run: |
75+
python -m unittest discover -v -s tests -p '*.py'
76+
shell: bash
77+
78+
python_wheels:
7979
needs: build_and_test_python
80-
if: github.event_name == 'release' && github.event.action == 'created'
8180
runs-on: ubuntu-latest
81+
container:
82+
image: quay.io/pypa/manylinux_2_28:latest
83+
env:
84+
PY_VER: ${{ matrix.python-version }}
85+
BASE_IMAGE: quay.io/pypa/manylinux_2_28:latest
8286
environment:
8387
name: pypi
8488
url: https://pypi.org/p/asyncproxy
8589
permissions:
8690
id-token: write
91+
continue-on-error: true
92+
strategy:
93+
matrix:
94+
python-version: ['3.9', '3.11', '3.12']
8795
steps:
88-
- uses: actions/checkout@v4
89-
90-
- name: Set up Python
91-
uses: actions/setup-python@v5
92-
with:
93-
python-version: '3.12'
94-
95-
- name: Install dependencies
96-
run: |
97-
python -m pip install --upgrade pip
98-
pip install setuptools wheel
99-
100-
- name: build
101-
run: python setup.py build sdist
102-
103-
- name: Publish package distributions to PyPI
104-
uses: pypa/gh-action-pypi-publish@release/v1
96+
- name: Install git
97+
run: |
98+
yum install -y git redhat-lsb-core gnupg2 wget ca-certificates yum-utils jq
99+
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
100+
yum install -y docker-ce-cli
101+
102+
- uses: actions/checkout@v4
103+
104+
- name: Set up Python
105+
run: sh -x scipts/build/install_depends_yum.sh
106+
107+
- name: Install dependencies
108+
run: sh -x scipts/build/install_depends_wheels.sh
109+
110+
- name: Set up QEMU
111+
uses: docker/setup-qemu-action@v3
112+
113+
- name: Set dynamic environment
114+
id: set-env
115+
run: |
116+
PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
117+
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
118+
sort -u | grep -v unknown | paste -sd ','`"
119+
BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
120+
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
121+
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
122+
BUILD_IMAGE="${{ inputs.ghcr-repo }}:rtp.io-${{ inputs.rtpp-tag }}-${GIT_BRANCH}"
123+
echo "Platforms: ${PLATFORMS}"
124+
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
125+
echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT
126+
echo "build-image=${BUILD_IMAGE}" >> $GITHUB_OUTPUT
127+
echo "git-branch=${GIT_BRANCH}" >> $GITHUB_OUTPUT
128+
129+
- name: build
130+
run: |
131+
python${PY_VER} setup.py build sdist
132+
python${PY_VER} -m build --wheel
133+
auditwheel repair dist/*.whl --wheel-dir dist/
134+
135+
- name: Publish package distributions to PyPI
136+
if: github.event_name == 'release' && github.event.action == 'created'
137+
uses: pypa/gh-action-pypi-publish@release/v1

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include src/Symbol.map src/asp_iostats.h src/asp_sock.So src/asp_sock.c src/asp_sock.h src/asyncproxy.So src/asyncproxy.c src/asyncproxy.h
1+
include src/Symbol.map src/asp_iostats.h src/asp_sock.c src/asp_sock.h src/asyncproxy.c src/asyncproxy.h
22
include README.md
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
python${PY_VER} -m ensurepip --upgrade
6+
python${PY_VER} -m pip install --upgrade pip
7+
python${PY_VER} -m pip install --upgrade build setuptools wheel auditwheel
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ "${PY_VER}" = "3.9" ]
6+
then
7+
PY_VER="3${PY_VER#3.}"
8+
dnf module enable python${PY_VER} -y
9+
fi
10+
11+
dnf install -y python${PY_VER} python${PY_VER}-devel

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def get_ex_mod():
6363
'packages':['asyncproxy',],
6464
'package_dir':{'asyncproxy':'python'},
6565
'ext_modules': get_ex_mod(),
66+
'license': 'BSD-2-Clause',
6667
'classifiers': [
67-
'License :: OSI Approved :: BSD License',
6868
'Operating System :: POSIX',
6969
'Programming Language :: C',
7070
'Programming Language :: Python'

0 commit comments

Comments
 (0)