Skip to content

Conversation

@SyntaxColoring
Copy link
Contributor

Overview

This deletes some old workarounds in our Python dependencies that I don't think we need anymore.

Background

Python packages can conditionally depend on each other. For example, package A might depend on package B when it's being installed on Windows, but not when it's being installed on macOS. Pipenv has, uh, fascinatingly, never accounted for this.

I guess at some point, that caused trouble for us with two of Pytest's conditional dependencies, atomicwrites and colorama; and we worked around it by naming them as dependencies, even though we don't depend on them directly.

opentrons/api/Pipfile

Lines 26 to 30 in 59645ab

# atomicwrites and colorama are pytest dependencies on windows,
# spec'd here to force lockfile inclusion
# https://github.com/pypa/pipenv/issues/4408#issuecomment-668324177
atomicwrites = { version = "==1.4.0", markers="sys_platform=='win32'" }
colorama = { version = "==0.4.4", markers="sys_platform=='win32'" }

Since then, two things have changed that I think make the workaround unnecessary:

  1. Pytest no longer uses atomicwrites on any platform (though it does still use colorama on Windows).
  2. We've switched from Pytest to uv, which has a universal, i.e. cross-platform, lockfile.

Changelog

  • Remove atomicwrites and colorama from our direct dependencies.

  • Run uv lock.

    In the lockfile, you can see that this deletes atomicwrites (because nothing needs it anymore) but keeps colorama (because uv is smart enough to see that Pytest still needs it on Windows).

  • Leave hardware-testing and abr-testing alone, since they're still using Pipenv. When we get around to migrating them to uv, we should do the same thing for them.

Test Plan and Hands on Testing

Just CI?

Review requests

None.

Risk assessment

🤷

@SyntaxColoring SyntaxColoring requested review from a team and sfoster1 January 14, 2026 22:20
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner January 14, 2026 22:20
@SyntaxColoring SyntaxColoring requested review from mjhuff and removed request for a team January 14, 2026 22:20
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.91%. Comparing base (f0770c9) to head (76c743d).
⚠️ Report is 5 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #20590      +/-   ##
==========================================
+ Coverage   56.25%   56.91%   +0.66%     
==========================================
  Files        3916     3652     -264     
  Lines      327778   306418   -21360     
  Branches    48159    45596    -2563     
==========================================
- Hits       184388   174398    -9990     
+ Misses     143171   131802   -11369     
+ Partials      219      218       -1     
Flag Coverage Δ
app 46.00% <ø> (ø)
protocol-designer 19.61% <ø> (ø)
robot-server ?
step-generation 5.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 811 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay, thank you

@SyntaxColoring
Copy link
Contributor Author

SyntaxColoring commented Jan 15, 2026

Looking into tests that are mysteriously hanging only for system-server and only in CI.

[Edit] I guess it was just flaky?

@SyntaxColoring SyntaxColoring marked this pull request as draft January 15, 2026 15:53
@SyntaxColoring SyntaxColoring marked this pull request as ready for review January 26, 2026 16:03
@SyntaxColoring SyntaxColoring merged commit 2adb372 into edge Jan 26, 2026
120 of 158 checks passed
@SyntaxColoring SyntaxColoring deleted the colorama_atomicwrites_cleanup branch January 26, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants