Skip to content

Commit 46be066

Browse files
committed
Make CD part
* add dependabot, yamllint
1 parent 5e32006 commit 46be066

File tree

7 files changed

+146
-80
lines changed

7 files changed

+146
-80
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/pythonpackage.yml

Lines changed: 64 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ jobs:
181181
max-parallel: 8
182182
matrix:
183183
WINDOWS:
184-
- { ARCH: 'x86', WINDOWS: 'win32' }
185-
- { ARCH: 'x64', WINDOWS: 'win64' }
184+
- {ARCH: 'x86', WINDOWS: 'win32'}
185+
- {ARCH: 'x64', WINDOWS: 'win64'}
186186
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
187187
name: "Cython based python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
188188

@@ -256,78 +256,66 @@ jobs:
256256
run: |
257257
twine check dist/*
258258
259-
# DeployWindows:
260-
# needs: [TestLinux, TestWindows]
261-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
262-
# runs-on: windows-latest
263-
# strategy:
264-
# max-parallel: 6
265-
# matrix:
266-
# WINDOWS:
267-
# - { ARCH: 'x86', WINDOWS: 'win32' }
268-
# - { ARCH: 'x64', WINDOWS: 'win64' }
269-
# python-version: [3.7, 3.8, 3.9]
270-
# name: "Release for python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
271-
#
272-
# steps:
273-
# - uses: actions/checkout@v2
274-
# - name: Set up Python ${{ matrix.python-version }}
275-
# uses: actions/setup-python@v2
276-
# with:
277-
# python-version: ${{ matrix.python-version }}
278-
# architecture: ${{ matrix.WINDOWS.ARCH }}
279-
# - name: Install dependencies
280-
# run: |
281-
# python -m pip install --upgrade pip wheel
282-
# pip install --upgrade -r build_requirements.txt
283-
# pip install --upgrade twine
284-
# - name: Build package
285-
# run: |
286-
# python setup.py sdist bdist_wheel clean
287-
# - name: Deploy
288-
# env:
289-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
290-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
291-
# run: |
292-
# twine upload --skip-existing dist/*
259+
build_wheels:
260+
name: Build wheels on ${{ matrix.os }}
261+
needs: [ TestScript, TestLinux, TestWindows ]
262+
# build only on push: heavy job
263+
if: github.event_name == 'push'
264+
runs-on: ${{ matrix.os }}
265+
strategy:
266+
fail-fast: false
267+
matrix:
268+
os: [ "ubuntu-latest", "macos-latest" ]
269+
270+
steps:
271+
- uses: actions/checkout@v4
272+
with:
273+
fetch-depth: 0 # need for setuptools_scm
274+
275+
# Used to host cibuildwheel
276+
- uses: actions/[email protected]
277+
with:
278+
python-version: "3.11"
279+
280+
- name: Set up QEMU
281+
if: runner.os == 'Linux'
282+
uses: docker/setup-qemu-action@v3
283+
with:
284+
platforms: all
285+
286+
- name: Build wheels
287+
uses: pypa/[email protected]
288+
env:
289+
# configure cibuildwheel to build native archs ('auto'), and some
290+
# emulated ones
291+
CIBW_ARCHS_LINUX: auto aarch64
292+
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
293+
294+
- uses: actions/upload-artifact@v3
295+
with:
296+
path: ./wheelhouse/*.whl
297+
name: wheels
298+
retention-days: 3
299+
300+
upload_pypi:
301+
needs: [ Build, build_wheels, Metadata ]
302+
# upload to PyPI on every tag
303+
if: github.event_name == 'push' && github.ref_type == 'tag'
304+
# alternatively, to publish when a GitHub Release is created, use the following rule:
305+
# if: github.event_name == 'release' && github.event.action == 'published'
306+
runs-on: ubuntu-latest
307+
environment:
308+
name: pypi
309+
url: https://pypi.org/p/threaded
310+
permissions:
311+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
312+
steps:
313+
- uses: actions/download-artifact@v3
314+
with:
315+
# unpacks default artifact into dist/
316+
# if `name: wheels` is omitted, the action will create extra parent dir
317+
name: wheels
318+
path: dist
293319

294-
# DeployManyLinux:
295-
# needs: [ TestLinux, TestWindows ]
296-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
297-
# runs-on: ubuntu-latest
298-
# container:
299-
# image: ${{ matrix.MANYLINUX.CONTAINER }}
300-
# env:
301-
# PYTHONDONTWRITEBYTECODE: 1
302-
# strategy:
303-
# matrix:
304-
# PYTHON: [ "cp37-cp37m", "cp38-cp38", "cp39-cp39" ]
305-
# MANYLINUX:
306-
# - NAME: manylinux2010_x86_64
307-
# CONTAINER: "quay.io/pypa/manylinux2010_x86_64"
308-
# - NAME: manylinux2014_x86_64
309-
# CONTAINER: "quay.io/pypa/manylinux2014_x86_64"
310-
# name: "${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
311-
# steps:
312-
# - uses: actions/checkout@v2
313-
# - name: Install main dependencies
314-
# run: |
315-
# /opt/python/${{ matrix.PYTHON }}/bin/python -m pip install -U pip wheel setuptools
316-
# /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade -r build_requirements.txt
317-
# /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade twine
318-
# - name: Build package
319-
# run: /opt/python/${{ matrix.PYTHON }}/bin/python setup.py bdist_wheel clean
320-
# - name: Bundle external shared libraries into the wheels
321-
# run: |
322-
# for whl in dist/*.whl; do
323-
# echo "Repairing $whl..."
324-
# auditwheel repair "$whl" -w dist/
325-
# done
326-
# - name: Cleanup OS specific wheels
327-
# run: rm -fv dist/*-linux_*.whl
328-
# - name: Deploy
329-
# env:
330-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
331-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
332-
# run: |
333-
# twine upload --skip-existing dist/*
320+
- name: Publish package distributions to PyPI
321+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/yamllint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint YAML
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.yml"
7+
- "**.yaml"
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
cache: 'pip'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip yamllint
22+
- name: Lint YAML files
23+
run: yamllint . -f github

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ __pycache__/
9898
# Distribution / packaging
9999
.Python
100100
build/
101+
wheelhouse/
101102
develop-eggs/
102103
dist/
103104
downloads/

.pyup.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.yamllint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
3+
yaml-files:
4+
- '*.yaml'
5+
- '*.yml'
6+
- '.yamllint'
7+
8+
rules:
9+
line-length:
10+
max: 120
11+
allow-non-breakable-inline-mappings: true
12+
level: warning
13+
indentation:
14+
indent-sequences: consistent
15+
brackets:
16+
max-spaces-inside: 1
17+
level: warning
18+
document-end: disable
19+
document-start: disable
20+
truthy: disable
21+
braces: enable
22+
colons:
23+
level: warning
24+
commas:
25+
level: warning
26+
comments:
27+
level: warning
28+
comments-indentation:
29+
level: warning
30+
empty-lines: enable
31+
empty-values: disable
32+
float-values: disable
33+
hyphens: enable
34+
key-duplicates: enable
35+
key-ordering: disable
36+
new-line-at-end-of-file: disable
37+
new-lines: enable
38+
octal-values: disable
39+
quoted-strings: disable
40+
trailing-spaces: enable

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ universal = 0
4848
[tool.setuptools_scm]
4949
write_to = "threaded/_version.py"
5050

51+
[tool.cibuildwheel]
52+
# Disable building PyPy wheels on all platforms
53+
# Disable musllinux as not popular platform
54+
skip = ["pp*", "*-musllinux_*"]
55+
before-build = "pip install -U pip cython -r CI_REQUIREMENTS.txt"
56+
build-frontend = { name = "build", args = ["--no-isolation"] }
57+
5158
[tool.black]
5259
line-length = 120
5360
safe = true

0 commit comments

Comments
 (0)