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

Redo vendoring based on pypi.org/project/vendoring/ #49752

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/resources/testdriver* @web-platform-tests/wpt-core-team
/resources/testharness* @web-platform-tests/wpt-core-team

# Prevent accidentally touching tools/third_party
/tools/third_party/ @web-platform-tests/wpt-core-team
# Prevent accidentally touching tools/third_party*
/tools/third_party*/ @web-platform-tests/wpt-core-team

# Require a review for Dockerfile
tools/docker/Dockerfile @web-platform-tests/wpt-core-team @web-platform-tests/admins
Expand Down
27 changes: 1 addition & 26 deletions tools/localpaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,7 @@

sys.path.insert(0, os.path.join(here))
sys.path.insert(0, os.path.join(here, "wptserve"))
sys.path.insert(0, os.path.join(here, "third_party", "pywebsocket3"))
sys.path.insert(0, os.path.join(here, "third_party", "atomicwrites"))
sys.path.insert(0, os.path.join(here, "third_party", "attrs", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "html5lib"))
sys.path.insert(0, os.path.join(here, "third_party", "zipp"))
sys.path.insert(0, os.path.join(here, "third_party", "exceptiongroup", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "more-itertools"))
sys.path.insert(0, os.path.join(here, "third_party", "packaging"))
sys.path.insert(0, os.path.join(here, "third_party", "pathlib2"))
sys.path.insert(0, os.path.join(here, "third_party", "pluggy", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "py"))
sys.path.insert(0, os.path.join(here, "third_party", "pytest"))
sys.path.insert(0, os.path.join(here, "third_party", "pytest", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "pytest-asyncio"))
sys.path.insert(0, os.path.join(here, "third_party", "six"))
sys.path.insert(0, os.path.join(here, "third_party", "typing_extensions", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "webencodings"))
sys.path.insert(0, os.path.join(here, "third_party", "h2", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "hpack", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "hyperframe", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "certifi"))
sys.path.insert(0, os.path.join(here, "third_party", "hyper"))
sys.path.insert(0, os.path.join(here, "third_party", "websockets", "src"))
sys.path.insert(0, os.path.join(here, "third_party", "iniconfig", "src"))
if sys.version_info < (3, 8):
sys.path.insert(0, os.path.join(here, "third_party", "importlib_metadata"))
sys.path.insert(0, os.path.join(here, "third_party"))
sys.path.insert(0, os.path.join(here, "webdriver"))
sys.path.insert(0, os.path.join(here, "wptrunner"))
sys.path.insert(0, os.path.join(here, "webtransport"))
Expand Down
21 changes: 21 additions & 0 deletions tools/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.vendoring]
destination = "third_party/"
requirements = "requirements_vendor.txt"
namespace = ""
patches-dir = "third_party_patches"
protected-files = [
"README.md",
]

[tool.vendoring.license.fallback-urls]
atomicwrites = "https://raw.githubusercontent.com/untitaker/python-atomicwrites/refs/tags/1.1.5/LICENSE"
webencodings = "https://raw.githubusercontent.com/gsnedders/python-webencodings/refs/tags/v0.5.1/LICENSE"

[tool.vendoring.transformations]
drop = [
"*.dist-info",
"*__mypyc*.so",
"bin/",
"tomli/*.so",
"websockets/speedups.*.so",
]
18 changes: 18 additions & 0 deletions tools/requirements_vendor.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This lists all the packages we use directly; these are unpinned here as we
# can rely on the existing pinned versions in requirements_vendor.txt to
# control when we do upgrades. It also makes this easier to audit, as
# everything here should see actual usage outside of third_party.

atomicwrites
h2
hpack
html5lib
hyperframe
# tooltool is referenced (by path) in tools/wpt/android.py
mozilla-tooltool-client @ git+https://github.com/mozilla-releng/tooltool.git@c1bda97eda1ec5246aa73a358c5e1d47e222380c#subdirectory=client
packaging
pytest-asyncio
pytest
pywebsocket3
six
websockets
55 changes: 55 additions & 0 deletions tools/requirements_vendor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --universal --python-version 3.8 requirements_vendor.in -o requirements_vendor.txt

# This file was then modified to remove all markers, as we want to make
# sure everything is always available when it is needed.

atomicwrites==1.1.5 # Update license in pyproject.toml when this changes.
# via -r requirements_vendor.in
colorama==0.4.6
# via pytest
exceptiongroup==1.2.1
# via pytest
h2==4.1.0
# via -r requirements_vendor.in
hpack==4.0.0
# via
# -r requirements_vendor.in
# h2
html5lib==1.1
# via -r requirements_vendor.in
hyperframe==6.0.1
# via
# -r requirements_vendor.in
# h2
iniconfig==1.1.1
# via pytest
mozilla-tooltool-client @ git+https://github.com/mozilla-releng/tooltool.git@c1bda97eda1ec5246aa73a358c5e1d47e222380c#subdirectory=client
# via -r requirements_vendor.in
packaging==21.3
# via
# -r requirements_vendor.in
# pytest
pluggy==1.5.0
# via pytest
pyparsing==3.1.4
# via packaging
pytest==8.2.1
# via
# -r requirements_vendor.in
# pytest-asyncio
pytest-asyncio==0.19.0
# via -r requirements_vendor.in
pywebsocket3==4.0.2
# via -r requirements_vendor.in
six==1.16.0
# via
# -r requirements_vendor.in
# html5lib
# pywebsocket3
tomli==2.2.1
# via pytest
webencodings==0.5.1 # Update license in pyproject.toml when this changes.
# via html5lib
websockets==12.0
# via -r requirements_vendor.in
40 changes: 40 additions & 0 deletions tools/third_party/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
third_party
===========

Within this directory are various bits of vendored Python code.

This mostly exists so Mozilla don't need to deal with updating their
CI-accessible partial PyPI mirror.

Unless strictly necessary, dependencies of WPT tooling should be
registered as with any normal Python code, via requirements.txt files
and/or via installation metadata.

See https://github.com/web-platform-tests/rfcs/issues/82 for
background.


How do I use this?
------------------

Within our Python code, `third_party` should appear within the module
search path. You should not have to think about this.

To update what is vendored, see `requirements_vendor.txt`. Note that
dependencies are not automatically vendored and must be explicitly
listed. Everything must be pure Python, with no build step, and with
no extension modules.

There is some configuration in `pyproject.toml`, too.

Note there are patches in `third_party_patches`, but these should be
used sparingly.

The vendoring itself is done by the
[vendoring](https://pypi.org/project/vendoring/) tool, which once
installed can be invoked from `tools` with `vendoring sync`. This will
delete the entirety of `third_party` and re-vendor everything based on
the config.

Proposed additions should go via the
[WPT RFC process](https://github.com/web-platform-tests/rfcs).
16 changes: 16 additions & 0 deletions tools/third_party/_pytest/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '8.2.1'
__version_tuple__ = version_tuple = (8, 2, 1)
File renamed without changes.
1 change: 1 addition & 0 deletions tools/third_party/atomicwrites.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from atomicwrites import *
9 changes: 0 additions & 9 deletions tools/third_party/atomicwrites/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions tools/third_party/atomicwrites/.travis.yml

This file was deleted.

11 changes: 0 additions & 11 deletions tools/third_party/atomicwrites/CONTRIBUTING.rst

This file was deleted.

6 changes: 0 additions & 6 deletions tools/third_party/atomicwrites/MANIFEST.in

This file was deleted.

2 changes: 0 additions & 2 deletions tools/third_party/atomicwrites/Makefile

This file was deleted.

102 changes: 0 additions & 102 deletions tools/third_party/atomicwrites/README.rst

This file was deleted.

18 changes: 0 additions & 18 deletions tools/third_party/atomicwrites/appveyor.yml

This file was deleted.

Loading