-
Notifications
You must be signed in to change notification settings - Fork 179
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
chore(python): clean up python deps to add anyio #8228
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #8228 +/- ##
==========================================
+ Coverage 74.78% 74.91% +0.13%
==========================================
Files 1661 1695 +34
Lines 44316 44918 +602
Branches 4433 4513 +80
==========================================
+ Hits 33140 33652 +512
- Misses 10423 10501 +78
- Partials 753 765 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup!
@@ -9,11 +9,13 @@ runs: | |||
steps: | |||
- shell: bash | |||
run: | | |||
[[ "${OSTYPE}" =~ "linux" ]] && sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install -y --no-install-recommends libsystemd-dev || echo "do nothing and avoid pipefail" | |||
if [[ "${OSTYPE}" =~ "linux" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change made because the install of libsystemd-dev
was failing in our Linux CI builds, which causes the later pipenv sync
to fail somewhat obscurely when trying to install systemd-python
.
The failure (GH Actions logs are gone, don't know why) looked a lot like the justification for adding this sed
in the first place: some Microsoft owned entry in the list was causing apt
to error out. So, I made two changes:
- Removed the
sed ... /etc/apt/sources.list
since it didn't appear to be doing anything - Moved from an
... && ... || ...
chain to an explicitif
block so:- This step continues to be skipped without prejudice on macOS and Windows
- This step fails loudly (rather than silently) on Linux builds if something goes wrong with
apt-get install
I'm pretty sure this was flakiness on the server end (there were 500s and 409s in the logs), so I don't think these changes fixed anything. However, I still thing they're sensible changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
ENV TZ=Etc/UTC | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
RUN apt-get update && apt-get install --yes python3 pip pkg-config libsystemd-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than adding apt-get install ... libsystemd-dev
, I'm not sure why I needed to make any of these changes to get the Docker build working. Someone please check my work! With the changes, I can successfully build and run the server + emulator images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good to me; would bet that pkg-config
is a runtime configuration dep for libsystemd-dev, and the timezone stuff is Eternal Docker Containers Aren't Good At Being General Purpose Computing Environments worries
@@ -30,7 +30,7 @@ def get_version(): | |||
|
|||
VERSION = get_version() | |||
|
|||
DISTNAME = "robotserver" | |||
DISTNAME = "robot_server" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing to match actual name used in import
statement in the source
@@ -19,10 +21,6 @@ pytest-cov = "<2.11.0" | |||
pytest-aiohttp = "*" | |||
twine = ">=1.12.0" | |||
wheel = "==0.30.0" | |||
coverage = "==4.4.2" | |||
colorama = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not add the atomicwrites
and colorama
deps to update server because this particular project is not able to run cross-platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke-tested by running a protocol on a robot, toggling random switches, etc. Seems to work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍾
Overview
The CPX team has run into too many walls with asyncio, so we're bringing in anyio so we can have:
It's been a while since we've added a fresh Python dep to the robot, and our dependencies are fairly messy at this point. I took the opportunity to try to clean things up and make sure each of these was aligned for all of our Python projects:
buildroot/package/python-***
Changes require accompanying buildroot PR: Opentrons/buildroot#131
Changelog
api
androbot-server
api/Pipfile
*
depedencies in the PipfilesPipfile
andsetup.py
setup.py
andConfig.in
Dockerfile
to ensure everything still works after missing deps were added toapi/setup.py
Review requests
Please check a box and sign off if you complete one of these tests)
Dockerfile
changes are sensible (@amitlissack 👍'd this PR after I asked him to look at the Dockerfile)This PR (or rather, the companion PR over at Opentrons/buildroot#131) adds a new dependency that can be really helpful for some quick smoke testing of Python dependencies:
importlib_metadata
. With the OS build of this branch loaded on your robot: SSH in and load apython
REPL:You can also try out
anyio
specifically in the REPL using anyio's hello world exampleRisk assessment
High, changes to production dependencies (when combined with BR PR)