Skip to content

RFC 68: Make local imports in Python file handlers root-relative#68

Merged
stephenmcgruer merged 2 commits intomasterfrom
smcgruer/python-file-handlers
Nov 17, 2020
Merged

RFC 68: Make local imports in Python file handlers root-relative#68
stephenmcgruer merged 2 commits intomasterfrom
smcgruer/python-file-handlers

Conversation

@stephenmcgruer
Copy link
Contributor

Implementation CL: web-platform-tests/wpt#26328

@stephenmcgruer stephenmcgruer changed the title RFC ??: Make local imports in Python file handlers root-relative RFC 68: Make local imports in Python file handlers root-relative Nov 10, 2020
Copy link
Contributor

@jgraham jgraham left a comment

Choose a reason for hiding this comment

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

This isn't lovely, but we haven't found a better alternative so far.

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

A little annoying, but looking forward to the py3-only future.

@stephenmcgruer stephenmcgruer merged commit ba0fece into master Nov 17, 2020
@stephenmcgruer stephenmcgruer deleted the smcgruer/python-file-handlers branch November 17, 2020 15:28
stephenmcgruer added a commit to web-platform-tests/wpt that referenced this pull request Nov 17, 2020
This changes handlers.py to no longer play with `sys.path` and `sys.modules`, and instead require python file handlers import helper functions with root-relative paths. `__init__.py` files are added as required.

Changing this did require changing imports in multiple tests; this can be reverted once we get to Py3-only (and pep 420) and can remove the root `__init__.py`.

Docs and tests are updated as appropriate.

See web-platform-tests/rfcs#68
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 20, 2020
…lpers via root path, a=testonly

Automatic update from web-platform-tests
Require Python file handers to import helpers via root path (#26328)

This changes handlers.py to no longer play with `sys.path` and `sys.modules`, and instead require python file handlers import helper functions with root-relative paths. `__init__.py` files are added as required.

Changing this did require changing imports in multiple tests; this can be reverted once we get to Py3-only (and pep 420) and can remove the root `__init__.py`.

Docs and tests are updated as appropriate.

See web-platform-tests/rfcs#68
--

wpt-commits: b595c93ddffcb048f85ee0313fa44d822b1889e4
wpt-pr: 26328
aosmond pushed a commit to aosmond/gecko that referenced this pull request Nov 22, 2020
…lpers via root path, a=testonly

Automatic update from web-platform-tests
Require Python file handers to import helpers via root path (#26328)

This changes handlers.py to no longer play with `sys.path` and `sys.modules`, and instead require python file handlers import helper functions with root-relative paths. `__init__.py` files are added as required.

Changing this did require changing imports in multiple tests; this can be reverted once we get to Py3-only (and pep 420) and can remove the root `__init__.py`.

Docs and tests are updated as appropriate.

See web-platform-tests/rfcs#68
--

wpt-commits: b595c93ddffcb048f85ee0313fa44d822b1889e4
wpt-pr: 26328
bhearsum pushed a commit to mozilla-releng/staging-firefox that referenced this pull request May 1, 2025
…lpers via root path, a=testonly

Automatic update from web-platform-tests
Require Python file handers to import helpers via root path (#26328)

This changes handlers.py to no longer play with `sys.path` and `sys.modules`, and instead require python file handlers import helper functions with root-relative paths. `__init__.py` files are added as required.

Changing this did require changing imports in multiple tests; this can be reverted once we get to Py3-only (and pep 420) and can remove the root `__init__.py`.

Docs and tests are updated as appropriate.

See web-platform-tests/rfcs#68
--

wpt-commits: b595c93ddffcb048f85ee0313fa44d822b1889e4
wpt-pr: 26328
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.

4 participants