Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New installer #430

Merged
merged 129 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
e96c85d
installer starting from scratch, modern pyproject.toml
toomanybrians Jul 26, 2022
a2ca956
Got it building on a mac (not running yet though)
toomanybrians Jul 26, 2022
69b5c75
clean up
toomanybrians Jul 26, 2022
8b9eb99
updated dependencies
toomanybrians Jul 28, 2022
4bb2822
version bump to 0.56.0-dev3
toomanybrians Jul 30, 2022
ad18d8e
initial commit of github workflow to build wheels
toomanybrians Jul 30, 2022
b419947
move github workflow to proper location
toomanybrians Jul 30, 2022
d35af10
update github builds
toomanybrians Jul 30, 2022
bc3993e
CIBW WIP
toomanybrians Jul 30, 2022
e6e4242
CIBW WIP
toomanybrians Jul 30, 2022
ecca024
cibw WIP
toomanybrians Jul 30, 2022
610213e
cibw wip
toomanybrians Jul 31, 2022
7250e9b
cibw wip
toomanybrians Jul 31, 2022
8ed2bf1
cibw wip
toomanybrians Jul 31, 2022
3a5d809
cibw wip
toomanybrians Jul 31, 2022
efcef4d
cibw trying macos arm64
toomanybrians Jul 31, 2022
189232d
cleaned up package spec format in pyproject.toml
toomanybrians Jul 31, 2022
c7e033a
frist attempt at self-hosted runner
toomanybrians Aug 2, 2022
5629ffb
yeah I did that backwards
toomanybrians Aug 2, 2022
f51841b
attempt linux runner
toomanybrians Aug 3, 2022
be224e9
adding windows build support (hard coded WIP)
toomanybrians Aug 4, 2022
9093958
use dynamic paths on win32 setup
toomanybrians Aug 5, 2022
5112b19
update prereq installs
toomanybrians Aug 5, 2022
83f2727
fix windows build tags
toomanybrians Aug 5, 2022
3dc9f15
change pip command format
toomanybrians Aug 5, 2022
f25a46f
fixed python versions for github runners
toomanybrians Aug 5, 2022
c01278b
add windows build deps
toomanybrians Aug 5, 2022
ed88fab
windows try using the dev cmd env
toomanybrians Aug 5, 2022
5b5b641
removing defaults
toomanybrians Aug 5, 2022
59d892d
change win setup paths to posix style
toomanybrians Aug 5, 2022
a4d6510
try adding all win32 libs to build system
toomanybrians Aug 5, 2022
140fde0
try removing concat path sep
toomanybrians Aug 5, 2022
a240ef1
searching for SDL2.h
toomanybrians Aug 5, 2022
fbeb3da
searching #2
toomanybrians Aug 5, 2022
6ba2be9
wip
toomanybrians Aug 5, 2022
c6e53e5
still trying to figure out paths
toomanybrians Aug 5, 2022
d3f493b
going nuclear to find these libraries on github win runners
toomanybrians Aug 6, 2022
a73bfaa
trying again
toomanybrians Aug 6, 2022
e1c51e5
3rd time
toomanybrians Aug 6, 2022
8734619
4th? time
toomanybrians Aug 6, 2022
f31be4c
5th try!
toomanybrians Aug 6, 2022
df20cc1
I've lost count....
toomanybrians Aug 6, 2022
ce5f3d9
install SDL then search and find where it is
toomanybrians Aug 6, 2022
0cce222
narrowing down...
toomanybrians Aug 6, 2022
67cdd46
list environment vars in pip step
toomanybrians Aug 6, 2022
14a604c
I feel like I just rolled my own pkg-config for windows
toomanybrians Aug 6, 2022
50a5743
see why I can't get pip to run on github
toomanybrians Aug 6, 2022
b3ea1fe
added pip to the build-system list so we can hopefully access it from…
toomanybrians Aug 6, 2022
b4a3e32
changing SDL finding technique based on kivy's setup
toomanybrians Aug 7, 2022
f5e951b
remove pip from pyproject.toml
toomanybrians Aug 7, 2022
5847429
re-enable mac and ubuntu builds
toomanybrians Aug 7, 2022
6e76395
ok for real this time
toomanybrians Aug 7, 2022
c9a468e
move old setup files
toomanybrians Aug 8, 2022
a2e307a
remove old pip test installs
toomanybrians Aug 8, 2022
ddf5c68
little cleanup and newer version of psutil
toomanybrians Aug 8, 2022
6c848b8
version bump & fix
toomanybrians Aug 8, 2022
0820695
fix SDL2 case
toomanybrians Aug 8, 2022
b451009
isolating linux builds for troubleshooting
toomanybrians Aug 8, 2022
e1f4dd1
log sdl2 pkg-config flags
toomanybrians Aug 8, 2022
356e0fa
move linux lib install step location
toomanybrians Aug 8, 2022
6694d21
remove sudo from linux container apt gets
toomanybrians Aug 8, 2022
cbe91f9
switch linux docker install command to yum
toomanybrians Aug 8, 2022
f1ca9fc
removing unneeded packages
toomanybrians Aug 8, 2022
0d0bcdc
list available yum packages
toomanybrians Aug 8, 2022
a39831a
updating yum package names
toomanybrians Aug 8, 2022
cf71eeb
correct gstreamer package name
toomanybrians Aug 8, 2022
4de473b
re-enabling github windows & mac builds
toomanybrians Aug 8, 2022
b84c218
new setup cleanup
toomanybrians Aug 9, 2022
bdd849b
added python 3.7 builds
toomanybrians Aug 9, 2022
340b528
fix 3.7 build updates
toomanybrians Aug 9, 2022
3105bd2
disabled gstreamer audio test
toomanybrians Aug 9, 2022
567fc99
Update test_Text.py
toomanybrians Aug 9, 2022
4e78dd9
add tests and pypi publishing
toomanybrians Aug 9, 2022
5455754
make sdist
toomanybrians Aug 9, 2022
435bef9
use cibw test runner
toomanybrians Aug 9, 2022
ca05617
change cibw test folder
toomanybrians Aug 9, 2022
4838991
update sdist build environment
toomanybrians Aug 9, 2022
df7840e
update sdist env and cibw test command
toomanybrians Aug 9, 2022
8e9fe6c
Update build_wheels.yml
toomanybrians Aug 9, 2022
700b559
let's try everything from the docker
toomanybrians Aug 9, 2022
b0d3948
trying to understand the cibw test environment
toomanybrians Aug 9, 2022
08a14e6
trying different test commands
toomanybrians Aug 9, 2022
1c18da0
readme update - mock is now built in to python
toomanybrians Aug 9, 2022
2211f18
attempt idiomatic test launch
toomanybrians Aug 9, 2022
7335634
switch back to separate tests per platform
toomanybrians Aug 9, 2022
3331f1a
update apt-get in sdist build
toomanybrians Aug 9, 2022
26d0e91
fix test path
toomanybrians Aug 9, 2022
01a1147
add more logging to try to figure out what's up with the tests
toomanybrians Aug 9, 2022
5ae9e4a
increase duration of failing test to see if that works
toomanybrians Aug 9, 2022
eeaea10
move cibw tests to pyproject.toml for multiline error catching
toomanybrians Aug 9, 2022
49bc40e
remove windows from toml tests
toomanybrians Aug 9, 2022
8a8e43d
remove test experiments
toomanybrians Aug 9, 2022
6cb18f3
rolling my own testing since I can't figure out cibw's
toomanybrians Aug 9, 2022
e61f53e
remove old cibw tests
toomanybrians Aug 9, 2022
ed5b815
fix apt-get test package names
toomanybrians Aug 9, 2022
b987f56
don't fail fast on tests
toomanybrians Aug 9, 2022
e47b879
fix gstreamer lib name
toomanybrians Aug 9, 2022
5908ae5
working out the test installation paths
toomanybrians Aug 9, 2022
02a2d33
change test path
toomanybrians Aug 9, 2022
d33bbca
let tests download packages from pypi
toomanybrians Aug 9, 2022
eff07e4
change github action wiring
toomanybrians Aug 9, 2022
db5cb4e
allow tests to work with prerelease versions too
toomanybrians Aug 9, 2022
98bbb78
oh, so we have to change every ref, not just one?
toomanybrians Aug 9, 2022
89a2a92
fix version file
toomanybrians Aug 9, 2022
eed92da
apparently we can't set the max version of python?
toomanybrians Aug 9, 2022
3b20222
set max python version with comma
toomanybrians Aug 9, 2022
a3e13d9
make text tests more durable
toomanybrians Aug 10, 2022
b9b7f9d
removed outdated build scripts :(
toomanybrians Aug 10, 2022
b0edfbb
added integration tests via docker (temp)
toomanybrians Aug 10, 2022
d178c11
Merge branch 'new-installer' of https://github.com/missionpinball/mpf…
toomanybrians Aug 10, 2022
93209dd
integration test wait until wheels are built
toomanybrians Aug 10, 2022
4df71e4
build trigger
toomanybrians Aug 10, 2022
61f4e0e
consolidate and clean up GH build file
toomanybrians Aug 10, 2022
34433cf
lots of github action rework
toomanybrians Aug 10, 2022
a7e14f8
syntax error
toomanybrians Aug 10, 2022
7736144
syntax error #2
toomanybrians Aug 10, 2022
baf3ed8
Merge branch 'new-installer' of https://github.com/missionpinball/mpf…
toomanybrians Aug 10, 2022
6a0aa69
change the way tests are determined
toomanybrians Aug 10, 2022
5233ab7
fix up test run commands
toomanybrians Aug 10, 2022
1f39767
harden text tests
toomanybrians Aug 10, 2022
6357dad
update artifact name
toomanybrians Aug 10, 2022
a906291
fix SDL2 checks
toomanybrians Aug 10, 2022
b564cee
clean up libraries list
toomanybrians Aug 10, 2022
d031af6
update method names
toomanybrians Aug 10, 2022
0a0cc86
move mac brew install into container
toomanybrians Aug 10, 2022
06c968d
trying to solidify mac cloud builds
toomanybrians Aug 10, 2022
1f58511
version bump for pypi testing
toomanybrians Aug 12, 2022
927534d
added coveralls
toomanybrians Aug 15, 2022
d04b026
updated readme
toomanybrians Aug 15, 2022
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
200 changes: 200 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# GitHub Workflow to build, test, and upload wheels

# TODO: Implement GitHub's caching to speed up builds
# TODO: Decide on specific versions of dependencies, and our locking strategy
# TODO: Implement ARM-based macOS builds on a self-hosted runner
# TODO: Raspberry Pi builds
# TODO: Linting

name: Wheel Builder

on: [push, pull_request]

jobs:
build_wheels:
name: Build for ${{ matrix.cibw-build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
python-version: 3.7
cibw-build: cp37-win_amd64
- os: windows-latest
python-version: 3.8
cibw-build: cp38-win_amd64
- os: windows-latest
python-version: 3.9
cibw-build: cp39-win_amd64
- os: ubuntu-latest
python-version: 3.7
cibw-build: cp37-manylinux_x86_64
- os: ubuntu-latest
python-version: 3.8
cibw-build: cp38-manylinux_x86_64
- os: ubuntu-latest
python-version: 3.9
cibw-build: cp39-manylinux_x86_64
# - os: macos-latest # Github hosted and self-hosted ARM runners are not yet available, so I'll just build locally for now.
# python-version: 3.8
# cibw-build: cp38-macosx_arm64
# - os: macos-latest
# python-version: 3.9
# cibw-build: cp39-macosx_arm64
- os: macos-latest
python-version: 3.7
cibw-build: cp37-macosx_x86_64
- os: macos-latest
python-version: 3.8
cibw-build: cp38-macosx_x86_64
- os: macos-latest
python-version: 3.9
cibw-build: cp39-macosx_x86_64

steps:
- name: Checkout MPF-MC
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run cibuildwheel
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_BEFORE_ALL_LINUX: > # This is done here and not as its own step as this runs inside the cibw containered environment
yum install -y SDL2.x86_64 SDL2-devel.x86_64 SDL2_image.x86_64 SDL2_image-devel.x86_64
SDL2_mixer.x86_64 SDL2_mixer-devel.x86_64 gstreamer1.x86_64 gstreamer1-devel.x86_64 &&
python -m pip install --upgrade pip &&
pip install --upgrade setuptools wheel build &&
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
CIBW_BEFORE_ALL_MACOS: >
brew install SDL2 SDL2_mixer SDL2_image SDL2_ttf gstreamer
CIBW_BEFORE_ALL: >
python -m pip install --upgrade pip &&
pip install --upgrade setuptools wheel build &&
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
CIBW_BUILD: ${{ matrix.cibw-build }}
CIBW_BUILD_VERBOSITY: 3
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: mpf-mc_wheels
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- name: Check out MPF-MC
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build SDist
run: >
sudo apt-get update &&
sudo apt-get -y install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad
gstreamer1.0-plugins-ugly libgstreamer1.0-dev &&
pip install --upgrade setuptools wheel build &&
python -m build --sdist
- name: Upload SDist
uses: actions/upload-artifact@v3
with:
name: mpf-mc_wheels
path: dist/*.tar.gz

test_wheels:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
needs: [build_wheels]
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
python-version: 3.9
run-tests: true
runs-on: ${{ matrix.os }}
env:
DISPLAY: ':99.0'
steps:
- name: Install runtime libraries on macOS
if: runner.os == 'macOS'
run: brew install SDL2 SDL2_mixer gstreamer
- name: Install runtime libraries on Linux
if: runner.os == 'linux'
run: |
sudo apt-get update
sudo apt-get -y install libsdl2-2.0 libsdl2-mixer-2.0 gstreamer-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly xvfb
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install runtime dependencies via pip
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel coveralls prospector==1.3.1
- name: Download the newly-built wheel
uses: actions/download-artifact@v3
with:
name: mpf-mc_wheels
path: dist
- name: Clone & install MPF # try to find a matching version before we default to dev
run: >
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
- name: Install MPF-MC from new wheel
run: pip install --pre --find-links=dist mpf-mc
- name: Run tests # Can't figure out how to run tests on mac or windows, but I guess that's ok? At least we test the wheel installs? TODO?
if: ${{ matrix.run-tests }} # controlled via the matrix:include: section above
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX
coverage3 run --concurrency=thread -m unittest discover mpfmc.tests
coverage3 run -a --concurrency=thread -m unittest discover mpfmc.integration

- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}-${{ matrix.os }}
COVERALLS_PARALLEL: true

publish_to_pypi: # only if this release has a tag and is a push from us (e.g. not a pull request)
name: Publish to PYPI
needs: [test_wheels, make_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: mpf-mc_wheels
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

coveralls:
name: Finalize Coveralls
needs: test_wheels
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ build_scripts/wheels

# editor tmp
.*.swp

.vscode
157 changes: 0 additions & 157 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Mission Pinball Framework - Media Controller (mpf-mc)
=====================================================

<img align="right" height="146" src="mpfmc/icons/mpfmc-logo.png"/>
<img align="right" height="146" src="https://missionpinball.org/images/mpfmc-logo.png"/>

This package is for the "Media Controller" for the Mission Pinball Framework (MPF).

Expand All @@ -11,17 +11,16 @@ sound, including the DMD, Color DMD, RGB LED DMD, and/or onscreen or LCD display
to drive a DMD and sound even if you don't have an on-screen LCD window. Don't worry--you can run this headless and/or
in a console-only environment for those cases.)

This package (mpf-mc) is MPF's "in box" media controller which is based on Kivy and Python 3. It leverages OpenGL and the
GPU of the computer it's running on. There's also [another media controller option based on Unity 3D](https://github.com/missionpinball/unity-bcp-server) you can use instead.
This package (mpf-mc) is MPF's "in box" media controller which is based on Kivy and Python. It leverages OpenGL and the
GPU of the computer it's running on. There are other media controller projects (at various levels of completeness) you can use with MPF built on Unity, Godot, Rust, and others.

MPF-MC can run on Windows, OS X, and Linux. It can run on the same machine as the core MPF engine, or it can be a
MPF-MC runs on Windows, Mac, Linux, and Raspberry Pi. It can run on the same machine as the core MPF engine, or it can be a
separate machine. It runs as a separate process from MPF, so it works well on a multi-core computer.

The MPF project homepage is here : http://missionpinball.org

[![Coverage Status](https://coveralls.io/repos/missionpinball/mpf-mc/badge.svg?branch=dev&service=github)](https://coveralls.io/github/missionpinball/mpf-mc?branch=dev)
[![Build Status](https://travis-ci.org/missionpinball/mpf-mc.svg?branch=dev)](https://travis-ci.org/missionpinball/mpf-mc)
[![Code Health](https://landscape.io/github/missionpinball/mpf-mc/dev/landscape.svg?style=flat)](https://landscape.io/github/missionpinball/mpf-mc/dev)
[![Test & Build Status](https://github.com/missionpinball/mpf-mc/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/missionpinball/mpf-mc/actions/workflows/build_wheels.yml)

Installation, Documentation, and Examples
-----------------------------------------
Expand Down
Loading