-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 85fcd0d
Showing
77 changed files
with
10,177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
root = true | ||
[*.py] | ||
max_line_length = 88 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- mode: conf-toml -*- | ||
|
||
[flake8] | ||
# For integration with `black`. Adapted from | ||
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html. | ||
max-line-length = 88 | ||
|
||
select = C,E,F,W,B,B950 | ||
|
||
# E501 is the line-length check; we ignore it because B950 (above) | ||
# adds a line-length check that aligns better with `black`'s behavior, | ||
# i.e. it sometimes allows lines a bit above the max length. | ||
extend-ignore = E203,E501 | ||
|
||
exclude = __ext__,config_schema.py | ||
|
||
[pep8] | ||
|
||
exclude = __ext__,config_schema.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: validate | ||
on: | ||
pull_request: | ||
branches: [master] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libasound2-dev | ||
version: 1.0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.7" | ||
cache: "pip" | ||
- run: pip install -r requirements.txt | ||
- run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
__pycache__/ | ||
/user.py | ||
|
||
/__ext__/System_MIDIRemoteScripts/ | ||
|
||
# Markers for Makefile tasks which would otherwise have no artifacts. | ||
/.make.* | ||
|
||
# Generated set files and project metadata. | ||
/tests/modeStep_tests_project/Backup | ||
/tests/modeStep_tests_project/*.als | ||
!/tests/modeStep_tests_project/_base.als |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
3.7.16 | ||
|
||
# This is the python version that should be used when running dev | ||
# commands. Live's built-in python version (as of v11.3.13) is 3.7.3, | ||
# but that version doesn't have readily-available builds for e.g. M1 | ||
# machines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Testing | ||
|
||
Tests work by opening Live, impersonating the MIDI output of the | ||
SoftStep, and checking the messages that Live sends back. | ||
|
||
To get this working, you need to configure a "modeStep" control | ||
surface to use "modeStep test" as its inputs and outputs. However, | ||
that source won't show up until tests are actually running, so you'll | ||
need to configure the control surface manually while you're running | ||
tests for the first time. | ||
|
||
You can add the test control surface in addition to the main SSCOM | ||
control surface, if you don't want to deal with switching the | ||
input/output when you want to run tests. | ||
|
||
To run tests, use: | ||
|
||
```shell | ||
make test | ||
``` | ||
|
||
For debug output: | ||
|
||
```shell | ||
DEBUG=1 make test | ||
``` | ||
|
||
## Linting and type checks | ||
|
||
Before submitting a PR, make sure the following are passing: | ||
|
||
```shell | ||
make lint # Validates code style | ||
make check # Validates types | ||
``` | ||
|
||
Some lint errors can be fixed automatically with: | ||
|
||
```shell | ||
make fix | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
SYSTEM_MIDI_REMOTE_SCRIPTS_DIR := /Applications/Ableton\ Live\ 11\ Suite.app/Contents/App-Resources/MIDI\ Remote\ Scripts | ||
TEST_PROJECT_DIR = tests/modeStep_tests_project | ||
|
||
.PHONY: deps | ||
deps: __ext__/System_MIDIRemoteScripts/.make.decompile .make.pip-install | ||
|
||
.PHONY: lint | ||
lint: .make.pip-install | ||
ruff format --check . | ||
ruff check . | ||
|
||
.PHONY: fix | ||
fix: .make.pip-install | ||
ruff format . | ||
ruff check --fix . | ||
|
||
.PHONY: check | ||
check: .make.pip-install __ext__/System_MIDIRemoteScripts/.make.decompile | ||
pyright . | ||
|
||
.PHONY: test | ||
test: .make.pip-install $(TEST_PROJECT_DIR)/default.als $(TEST_PROJECT_DIR)/overrides.als $(TEST_PROJECT_DIR)/standalone.als | ||
pytest | ||
|
||
.PHONY: img | ||
img: .make.pip-install | ||
cd img && python generate.py | ||
|
||
# Set files with different configurations for testing. | ||
$(TEST_PROJECT_DIR)/%.als: .make.pip-install $(TEST_PROJECT_DIR)/create_set.py | ||
python $(TEST_PROJECT_DIR)/create_set.py $* | ||
|
||
__ext__/System_MIDIRemoteScripts/.make.decompile: $(SYSTEM_MIDI_REMOTE_SCRIPTS_DIR) | .make.pip-install | ||
rm -rf $(@D)/ | ||
mkdir -p $(@D)/ableton/ | ||
# decompyle3 works for most files, and the ones where it doesn't don't | ||
# matter for our purposes. | ||
decompyle3 -r -o $(@D)/ableton/ $(SYSTEM_MIDI_REMOTE_SCRIPTS_DIR)/ableton/ | ||
|
||
touch $@ | ||
|
||
.make.pip-install: requirements.txt .python-version | ||
pip install -r requirements.txt | ||
touch .make.pip-install |
Oops, something went wrong.