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

build(python): configure setuptools to use legacy editable installs #11341

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/workflows/api-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- 'shared-data/**/*'
- '!shared-data/js/**'
- 'hardware/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/api-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
Expand All @@ -22,6 +24,8 @@ on:
- 'shared-data/**/*'
- '!shared-data/js/**/*'
- 'hardware/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/api-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/g-code-testing-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
paths:
- 'Makefile'
- 'g-code-testing/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/g-code-testing-lint-test.yaml'
- '.github/actions/python/**'
branches:
Expand All @@ -19,6 +21,10 @@ on:
paths:
- 'Makefile'
- 'g-code-testing/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/g-code-testing-lint-test.yaml'
- '.github/actions/python/**'
workflow_dispatch:

defaults:
Expand Down
36 changes: 20 additions & 16 deletions .github/workflows/hardware-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
paths:
- 'Makefile'
- 'hardware/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/hardware-lint-test.yaml'
- '.github/actions/python/**'
branches:
Expand All @@ -20,6 +22,8 @@ on:
paths:
- 'Makefile'
- 'hardware/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/hardware-lint-test.yaml'
- '.github/actions/python/**'

Expand Down Expand Up @@ -53,28 +57,28 @@ jobs:
with:
project: 'hardware'

# TODO(amit, 2022-03-08): Enable once ot3 emulation is ready
# - name: Setup SocketCan
# run: |
# sudo apt-get update
# sudo apt-get install linux-modules-extra-$(uname -r)
# sudo modprobe vcan
#
# - name: Run OT-3 Emulator
# uses: Opentrons/[email protected]
# with:
# ot3-firmware-commit-id: latest
# modules-commit-id: latest
# TODO(amit, 2022-03-08): Enable once ot3 emulation is ready
# - name: Setup SocketCan
# run: |
# sudo apt-get update
# sudo apt-get install linux-modules-extra-$(uname -r)
# sudo modprobe vcan
#
# - name: Run OT-3 Emulator
# uses: Opentrons/[email protected]
# with:
# ot3-firmware-commit-id: latest
# modules-commit-id: latest

- name: Lint
run: make -C hardware lint

- name: Test
run: make -C hardware test-cov
# TODO(amit, 2022-03-08): Enable once ot3 emulation is ready
# env:
# CAN_CHANNEL: vcan0
# run: make -C hardware test-with-emulator
# TODO(amit, 2022-03-08): Enable once ot3 emulation is ready
# env:
# CAN_CHANNEL: vcan0
# run: make -C hardware test-with-emulator

- name: Code Coverage
uses: 'codecov/codecov-action@v2'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/notify-server-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- '.github/workflows/notify-server-lint-test.yaml'
- 'api/**/*'
- 'hardware/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/actions/python/**/*'
branches:
- 'edge'
Expand All @@ -25,6 +27,9 @@ on:
- 'notify-server/**/*'
- 'api/**/*'
- 'hardware/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/actions/python/**/*'
workflow_dispatch:

defaults:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/robot-server-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- '!shared-data/js/**/*'
- 'robot-server/**/*'
- 'notify-server/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/robot-server-test-lint.yaml'
- '.github/actions/python/**'
branches:
Expand All @@ -31,6 +33,10 @@ on:
- '!shared-data/js/**/*'
- 'robot-server/**/*'
- 'notify-server/**/*'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/robot-server-test-lint.yaml'
- '.github/actions/python/**'
workflow_dispatch:

defaults:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
paths:
- 'Makefile'
- 'shared-data/*/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/shared-data-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
Expand All @@ -21,6 +23,8 @@ on:
paths:
- 'Makefile'
- 'shared-data/*/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/shared-data-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-server-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
paths:
- 'update-server/**/*'
- 'Makefile'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/update-server-lint-test.yaml'
- '.github/actions/python/**'
branches: # ignore any release-related thing (handled elsewhere)
Expand All @@ -19,6 +21,8 @@ on:
paths:
- 'update-server/**/*'
- 'Makefile'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/update-server-lint-test.yaml'
- '.github/actions/python/**'
workflow_dispatch:
Expand Down
4 changes: 4 additions & 0 deletions scripts/python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ OT_PYTHON ?= python
# https://pipenv.pypa.io/en/latest/basics/#specifying-versions-of-python
OT_VIRTUALENV_VERSION ?= 3.7

# Use legacy editable installs to avoid breaking mypy type-checking
# when using newer versions of setuptools
export SETUPTOOLS_ENABLE_FEATURES := legacy-editable

pipenv_envvars := $(and $(CI),PIPENV_IGNORE_VIRTUALENVS=1)
pipenv := $(pipenv_envvars) $(OT_PYTHON) -m pipenv
python := $(pipenv) run python
Expand Down