Skip to content

Commit

Permalink
Merge pull request #4 from lilatomic/cicd/cythonize
Browse files Browse the repository at this point in the history
Cicd/cythonize
  • Loading branch information
lilatomic authored Oct 8, 2023
2 parents cc00954 + 7daab4b commit e6add51
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 6,979 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: ["ubuntu-20.04"]
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
include:
- platform: "ubuntu-18.04"
python-version: "2.7"
# - platform: "ubuntu-18.04"
# python-version: "3.4"
- platform: "ubuntu-18.04"
python-version: "3.6"
platform: ["ubuntu-22.04"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -36,8 +29,9 @@ jobs:
- name: Install dependencies
run: |
python --version
python -m pip install --upgrade pip setuptools wheel
pip install coverage[toml] virtualenv tox tox-gh-actions
pip install coverage[toml] virtualenv tox tox-gh-actions cython
- name: Test with tox
run: tox
Expand All @@ -46,7 +40,7 @@ jobs:

# from https://github.com/codecov/codecov-action
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest]
python-version: ["2.7", "3.6", "3.10"]
platform: ["ubuntu-22.04"]
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -29,8 +29,9 @@ jobs:
- name: Install dependencies
run: |
python --version
python -m pip install --upgrade pip setuptools wheel
pip install virtualenv tox tox-gh-actions
pip install virtualenv tox tox-gh-actions cython
- name: Test Lint
run: tox -e lint,radon
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ MANIFEST
*.egg-info
*.swp
*~

# autogenerated cython files
**/_*.c

# htmlcov
htmlcov
.coverage
coverage.xml

.idea
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM quay.io/pypa/manylinux_2_28_x86_64

RUN yum install -y keyutils-libs-devel
RUN <<-EOF
python_versions=("38" "39" "310" "311")
for version in "${python_versions[@]}"; do
PYBIN="/opt/python/cp$version-cp$version/bin"
"${PYBIN}/pip" install cython
done
EOF

COPY buildwheels.sh /bin/
ENTRYPOINT ["/bin/buildwheels.sh"]
CMD ["manylinux_2_28_x86_64"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include AUTHORS ChangeLog INSTALL LICENSE README.rst TODO
include keyutils/_keyutils.c
include keyutils/_keyutils.c keyutils/_keyutils.pyx
20 changes: 20 additions & 0 deletions buildwheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e -u -x
python_versions=("38" "39" "310" "311")
PLAT="$1"

function repair_wheel {
wheel="$1"
if ! auditwheel show "$wheel"; then
echo "Skipping non-platform wheel $wheel"
else
auditwheel repair "$wheel" --plat "$PLAT" -w /io/dist/
fi
}

# Compile wheels
for version in "${python_versions[@]}"; do
PYBIN="/opt/python/cp$version-cp$version/bin"
"${PYBIN}/pip" wheel /io/ --no-deps -w dist/
repair_wheel dist/*-cp$version-cp$version*whl
done
Loading

0 comments on commit e6add51

Please sign in to comment.