Skip to content

Commit 8b91fb1

Browse files
authored
Merge pull request #119 from SpotlightKid/feat/modernize
Modernize project structure and build system
2 parents 366568f + eca3e0e commit 8b91fb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1988
-2048
lines changed

.appveyor.yml

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

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
ignore = E116, E265, E266, E731, W504
3+
max-line-length = 100
4+
exclude = docs,.tox,.git

.github/workflows/main.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build sdist and wheel and publish to PyPI and TestPyPI
2+
3+
#on: [push, pull_request]
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build_sdist:
14+
name: Build sdist
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- uses: actions/checkout@v3
19+
with:
20+
submodules: true
21+
22+
- name: Install ninja
23+
run: pipx install ninja
24+
25+
- name: Build sdist
26+
run: pipx run build --sdist
27+
28+
- name: Check metadata
29+
run: pipx run twine check --strict dist/*
30+
31+
- uses: actions/upload-artifact@v3
32+
with:
33+
path: dist/*.tar.gz
34+
35+
build_wheels:
36+
name: Build wheels on ${{ matrix.os }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
os: [ubuntu-latest, windows-latest, macos-latest]
41+
steps:
42+
43+
- uses: actions/checkout@v3
44+
with:
45+
submodules: true
46+
47+
- name: Build wheels
48+
uses: pypa/[email protected]
49+
50+
- uses: actions/upload-artifact@v3
51+
with:
52+
path: wheelhouse/*.whl
53+
54+
build_arch_wheels:
55+
name: Build wheels on Linux ${{ matrix.arch }}
56+
runs-on: ubuntu-20.04
57+
strategy:
58+
matrix:
59+
arch: [aarch64]
60+
steps:
61+
62+
- uses: actions/checkout@v3
63+
with:
64+
submodules: true
65+
66+
- uses: docker/setup-qemu-action@v2
67+
with:
68+
platforms: all
69+
70+
- uses: pypa/[email protected]
71+
env:
72+
CIBW_ARCHS: ${{ matrix.arch }}
73+
74+
- name: Verify clean directory
75+
run: git diff --exit-code
76+
shell: bash
77+
78+
- name: Upload wheels
79+
uses: actions/upload-artifact@v3
80+
with:
81+
path: wheelhouse/*.whl
82+
83+
upload_pypi:
84+
needs: [build_arch_wheels, build_wheels, build_sdist]
85+
runs-on: ubuntu-latest
86+
environment: PyPI release
87+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
88+
steps:
89+
90+
- uses: actions/download-artifact@v3
91+
with:
92+
# unpacks default artifact into dist/
93+
# if `name: artifact` is omitted, the action will create extra parent dir
94+
name: artifact
95+
path: dist
96+
97+
- name: Publish distribution to Test PyPI
98+
uses: pypa/[email protected]
99+
with:
100+
skip_existing: true
101+
user: __token__
102+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
103+
repository_url: https://test.pypi.org/legacy/
104+
105+
- name: Publish distribution to PyPI
106+
if: startsWith(github.ref, 'refs/tags/v')
107+
uses: pypa/[email protected]
108+
with:
109+
user: __token__
110+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build sdist and wheel and publish to PyPI and TestPyPI
2+
3+
#on: [push, pull_request]
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build_sdist:
14+
name: Build sdist
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- uses: actions/checkout@v3
19+
with:
20+
submodules: true
21+
22+
- name: Install ninja
23+
run: pipx install ninja
24+
25+
- name: Build sdist
26+
run: pipx run build --sdist
27+
28+
- name: Check metadata
29+
run: pipx run twine check --strict dist/*
30+
31+
- uses: actions/upload-artifact@v3
32+
with:
33+
path: dist/*.tar.gz
34+
35+
build_wheels:
36+
name: Build wheels on ${{ matrix.os }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
os: [ubuntu-latest, windows-latest, macos-latest]
41+
steps:
42+
43+
- uses: actions/checkout@v3
44+
with:
45+
submodules: true
46+
47+
# Used to host cibuildwheel
48+
- uses: actions/setup-python@v4
49+
with:
50+
python-version: '3.11'
51+
52+
- name: Build wheels
53+
uses: pypa/[email protected]
54+
# to supply options, put them in 'env', like:
55+
# env:
56+
# CIBW_SOME_OPTION: value
57+
58+
- uses: actions/upload-artifact@v3
59+
with:
60+
path: wheelhouse/*.whl
61+
62+
build_arch_wheels:
63+
name: Build wheels on Linux ${{ matrix.arch }}
64+
runs-on: ubuntu-20.04
65+
strategy:
66+
matrix:
67+
arch: [aarch64]
68+
steps:
69+
70+
- uses: actions/checkout@v3
71+
with:
72+
submodules: true
73+
74+
- uses: docker/setup-qemu-action@v2
75+
with:
76+
platforms: all
77+
78+
- uses: pypa/[email protected]
79+
env:
80+
CIBW_ARCHS: ${{ matrix.arch }}
81+
82+
- name: Verify clean directory
83+
run: git diff --exit-code
84+
shell: bash
85+
86+
- name: Upload wheels
87+
uses: actions/upload-artifact@v3
88+
with:
89+
path: wheelhouse/*.whl
90+
91+
upload_pypi:
92+
needs: [build_arch_wheels, build_wheels, build_sdist]
93+
runs-on: ubuntu-latest
94+
environment: PyPI release
95+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
96+
steps:
97+
98+
- uses: actions/download-artifact@v3
99+
with:
100+
# unpacks default artifact into dist/
101+
# if `name: artifact` is omitted, the action will create extra parent dir
102+
name: artifact
103+
path: dist
104+
105+
- name: Publish distribution to Test PyPI
106+
uses: pypa/[email protected]
107+
with:
108+
skip_existing: true
109+
user: __token__
110+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
111+
repository_url: https://test.pypi.org/legacy/
112+
113+
- name: Publish distribution to PyPI
114+
if: startsWith(github.ref, 'refs/tags/v')
115+
uses: pypa/[email protected]
116+
with:
117+
user: __token__
118+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ src/_rtmidi.cpp
88
# C extensions
99
*.so
1010

11-
# Generated documentation
12-
#INSTALL.rst
13-
1411
# Packages
1512
*.egg
1613
*.egg-info
1714
dist/
18-
build/
15+
wheelhouse/
1916
*.eggs/
2017
eggs/
2118
parts/
@@ -49,6 +46,8 @@ output/*/index.html
4946

5047
# Sphinx
5148
docs/_build
49+
# docs build artifact
50+
rtmidi/version.py
5251

5352
# Geany project
5453
python-rtmidi.geany

.travis.yml

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

0 commit comments

Comments
 (0)