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

Move away from depending on 'py' requirement #14867

Closed
wants to merge 1 commit into from

Conversation

janbrasna
Copy link
Contributor

@janbrasna janbrasna commented Jul 23, 2024

One-line summary

The py package is explicitly required, but no package directly depends on it.

EDIT: Some pytest-* plugins (at least in the versions used here) do require py.* imports, but fail to declare py as dependency (because pytest<v7.2.0 did that for them) — they'd need to be updated or removed first.

Significant changes and points to review

What turned out as a blocker is pytest's removal of py in 7.2.0 and vendoring just the useful bits left its plugins without explicit py dependency but still relying on e.g. py.xml broken from that point on, so only those still maintained and updating/replacing their dependencies will continue working with newer releases (or will need a py version explicitly required and pinned like here now, until updated). But that upgrade is currently blocked: #14013 (also see #14316 for more issues in version compatibility), truth is replacing Selenium with Playwright might happen faster than this.

TODO:

  • pytest-selenium moved from py.xml to html in 4.0.2 but that has caused some regressions here.
  • pytest-parallel is unmaintained and may need replacing with pytest-xdist (which is actually not that ideal for selenium fwiw…)

Issue / Bugzilla link

Resolves #14851

Testing

make build && make test && make run

Just to verify the legacy entrypoints still work (they are equivalent):
(docker-compose run test) pytest bedrock/firefox
is the same as
(docker-compose run test) py.test bedrock/firefox

@janbrasna
Copy link
Contributor Author

Oh crap it's the pytest-selenium that needs updating beyond 4.0.2 — but that's blocked right now #14013

(and also unmaintained pytest-parallel might be the same case…)

Yea that felt too easy;)

@robhudson
Copy link
Member

pytest-selenium is hopefully going away soon-ish with the switch to playwright \o/

@stevejalim stevejalim added the WIP 🚧 Pull request is still work in progress label Jul 24, 2024
@janbrasna janbrasna changed the title Remove 'py' from requirements Move away from depending on 'py' requirement Jul 24, 2024
@alexgibson alexgibson added the Backend Server stuff yo label Jul 29, 2024
@janbrasna
Copy link
Contributor Author

TL;DR — pytest-xdist was here before, and replaced with pytest-parallel (that is now no longer maintained to update for the missing dependency or vendor just what's necessary to allow us to remove py) in the past via #9565 so that's not the way forward I guess.

Not sure how crucial is to set multiple workers (in integration tests), but any change would have more surface than I'm able to support with this change.

Closing here, feel free to wontifx #14851 as well if you don't feel it's worth it.
(Hint, it's not, the CVE is related to some unused SVN code, so it's not ever caller for this use case.)

@janbrasna janbrasna closed this Nov 10, 2024
@janbrasna janbrasna deleted the del/py-requirements branch November 10, 2024 14:35
@janbrasna janbrasna mentioned this pull request Nov 10, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Server stuff yo WIP 🚧 Pull request is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove py dependency?
4 participants