Skip to content

Commit

Permalink
Bug 1689501 [wpt PR 27379] - [python3] Remove Python 2 tasks from the…
Browse files Browse the repository at this point in the history
… CI, a=testonly

Automatic update from web-platform-tests
[python3] Bring py3-flake8.ini up-to-date with py27-flake8.ini

--
[taskcluster] Remove python2 tasks from Taskcluster CI

Step 3 of https://github.com/web-platform-tests/rfcs/blob/master/rfcs/py_3.md

--
[Azure Pipelines] Remove Python 2 from Azure Pipelines CI

Step 3 of https://github.com/web-platform-tests/rfcs/blob/master/rfcs/py_3.md

--
[python3] Update the bare minimum docs for dropping Py2 support

There are probably references still remaining to Python 2, but this
should remove the most egregious cases.

--

wpt-commits: a3e8c672b0f5c63f0023d0f69871785788f85c2d, 7abcd71cdc84a5d17047079a1daceb04edb2da3e, 6b197f497940666c041294367adf52eddb2faa25, cc214bb6cd8a525ea104c7311e9f2f3b0cb65fbd
wpt-pr: 27379
  • Loading branch information
stephenmcgruer authored and moz-wptsync-bot committed Feb 2, 2021
1 parent e6f8d2f commit 475d2a3
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 249 deletions.
126 changes: 0 additions & 126 deletions testing/web-platform/tests/.azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,6 @@ jobs:
displayName: 'Run tests (Safari Technology Preview)'
- template: tools/ci/azure/publish_logs.yml

- job: tools_unittest_mac
displayName: 'tools/ unittests: macOS'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.tools_unittest']
pool:
vmImage: 'macOS-10.15'
variables:
HYPOTHESIS_PROFILE: ci
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
- template: tools/ci/azure/checkout.yml
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/
toxenv: py27

- job: tools_unittest_mac_py36
displayName: 'tools/ unittests: macOS + Python 3.6'
dependsOn: decision
Expand Down Expand Up @@ -167,24 +149,6 @@ jobs:
directory: tools/
toxenv: py38

- job: wptrunner_unittest_mac
displayName: 'tools/wptrunner/ unittests: macOS'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.wptrunner_unittest']
pool:
vmImage: 'macOS-10.15'
variables:
HYPOTHESIS_PROFILE: ci
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
- template: tools/ci/azure/checkout.yml
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wptrunner/
toxenv: py27

- job: wptrunner_unittest_mac_py36
displayName: 'tools/wptrunner/ unittests: macOS + Python 3.6'
dependsOn: decision
Expand Down Expand Up @@ -217,32 +181,6 @@ jobs:
directory: tools/wptrunner/
toxenv: py38

- job: wpt_integration_mac
displayName: 'tools/wpt/ tests: macOS'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.wpt_integration']
pool:
vmImage: 'macOS-10.15'
variables:
HYPOTHESIS_PROFILE: ci
steps:
# full checkout required
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
- template: tools/ci/azure/install_chrome.yml
- template: tools/ci/azure/install_firefox.yml
- template: tools/ci/azure/update_hosts.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/update_manifest.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wpt/
toxenv: py27

- job: wpt_integration_mac_py36
displayName: 'tools/wpt/ tests: macOS + Python 3.6'
dependsOn: decision
Expand Down Expand Up @@ -283,24 +221,6 @@ jobs:
directory: tools/wpt/
toxenv: py38

- job: tools_unittest_win
displayName: 'tools/ unittests: Windows'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.tools_unittest']
pool:
vmImage: 'windows-2019'
variables:
HYPOTHESIS_PROFILE: ci
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
- template: tools/ci/azure/checkout.yml
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/
toxenv: py27

- job: tools_unittest_win_py36
displayName: 'tools/ unittests: Windows + Python 3.6'
dependsOn: decision
Expand Down Expand Up @@ -337,24 +257,6 @@ jobs:
directory: tools/
toxenv: py38

- job: wptrunner_unittest_win
displayName: 'tools/wptrunner/ unittests: Windows'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.wptrunner_unittest']
pool:
vmImage: 'windows-2019'
variables:
HYPOTHESIS_PROFILE: ci
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
- template: tools/ci/azure/checkout.yml
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wptrunner/
toxenv: py27

- job: wptrunner_unittest_win_py36
displayName: 'tools/wptrunner/ unittests: Windows + Python 3.6'
dependsOn: decision
Expand Down Expand Up @@ -389,34 +291,6 @@ jobs:
directory: tools/wptrunner/
toxenv: py38

- job: wpt_integration_win
displayName: 'tools/wpt/ tests: Windows'
dependsOn: decision
condition: dependencies.decision.outputs['test_jobs.wpt_integration']
pool:
vmImage: 'windows-2019'
variables:
HYPOTHESIS_PROFILE: ci
steps:
# full checkout required
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7.x'
# currently just using the outdated Chrome/Firefox on the VM rather than
# figuring out how to install Chrome Dev channel on Windows
# - template: tools/ci/azure/install_chrome.yml
# - template: tools/ci/azure/install_firefox.yml
- template: tools/ci/azure/update_hosts.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/update_manifest.yml
parameters:
pyflag: --py2
- template: tools/ci/azure/tox_pytest.yml
parameters:
directory: tools/wpt/
toxenv: py27

- job: wpt_integration_win_py36
displayName: 'tools/wpt/ tests: Windows + Python 3.6'
dependsOn: decision
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ The tests are designed to be run from your local computer.
Running the tests requires `python`, `pip` and `virtualenv`, as well as updating
the system `hosts` file.

Python 3 is supported and preferred, but for now it is still possible to use
Python 2.7 if necessary.
WPT requires Python 3.6 or higher.

The required setup is different depending on your operating system.

Expand Down Expand Up @@ -45,10 +44,10 @@ See also [additional setup required to run Safari](safari.md).

### Windows Setup

Download and install [Python 2.7](https://www.python.org/downloads). The
Download and install [Python 3](https://www.python.org/downloads). The
installer includes `pip` by default.

Add `C:\Python27` and `C:\Python27\Scripts` to your `%Path%`
Add `C:\Python39` and `C:\Python39\Scripts` to your `%Path%`
[environment variable](http://www.computerhope.com/issues/ch000549.htm).

Finally, install `virtualenv`:
Expand Down
6 changes: 3 additions & 3 deletions testing/web-platform/tests/docs/writing-tests/h2tests.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Writing H2 Tests

> <b>Important:</b> The HTTP/2.0 server requires you to have Python 2.7.10+
and OpenSSL 1.0.2+. This is because HTTP/2.0 is negotiated using the
> <b>Important:</b> The HTTP/2.0 server requires you to have
OpenSSL 1.0.2+. This is because HTTP/2.0 is negotiated using the
[TLS ALPN](https://tools.ietf.org/html/rfc7301) extension, which is only supported in [OpenSSL 1.0.2](https://www.openssl.org/news/openssl-1.0.2-notes.html) and up.

These instructions assume you are already familiar with the testing
Expand Down Expand Up @@ -153,4 +153,4 @@ the HEADER and CONTINUATION frames are constructed in the same way.
Ends the stream with the given ID, or the one that request was made on if no ID given.

- <b>Parameters</b>
- <b>stream_id</b>: Id of stream to send frame on. Will use the request stream ID if None
- <b>stream_id</b>: Id of stream to send frame on. Will use the request stream ID if None
2 changes: 1 addition & 1 deletion testing/web-platform/tests/docs/writing-tests/lint-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TRAILING WHITESPACE:example/*

Similarly, you can also
use
[shell-style wildcards](https://docs.python.org/2/library/fnmatch.html) to
[shell-style wildcards](https://docs.python.org/library/fnmatch.html) to
express other filename patterns or directory-name patterns.

Finally, to ignore just one line in a file, use the following format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@ css/css-align/resources/__init__.py
This requirement will be removed once we move to Python 3, due to
[PEP 420](https://www.python.org/dev/peps/pep-0420/).

### Python3 compatibility

Even though Python3 is not fully supported at this point, some work is being
done to add compatibility for it. This is why you can see in multiple places
the use of the `six` python module which is meant to provide a set of simple
utilities that work for both generation of python (see
[docs](https://six.readthedocs.io/)). The module is vendored in
tools/third_party/six/six.py.

When an handler is added, it should be at least syntax-compatible with Python3.
You can check that by running:
```
python3 -m py_compile <path/to/handler.py>
```

## Example: Dynamic HTTP headers

The following code defines a Python handler that allows the requester to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ by default and needs to be run using `./wpt serve --h2` in order to enable it.
The HTTP/2.0 server supports handlers that work per-frame; these, along with the
API are documented in [Writing H2 Tests](h2tests).

> <b>Important:</b> The HTTP/2.0 server requires you to have Python 2.7.10+
and OpenSSL 1.0.2+. This is because HTTP/2.0 is negotiated using the
> <b>Important:</b> The HTTP/2.0 server requires you to have
OpenSSL 1.0.2+. This is because HTTP/2.0 is negotiated using the
[TLS ALPN](https://tools.ietf.org/html/rfc7301) extension, which is only
supported in
[OpenSSL 1.0.2](https://www.openssl.org/news/openssl-1.0.2-notes.html) and up.
Expand Down
5 changes: 1 addition & 4 deletions testing/web-platform/tests/tools/ci/azure/update_hosts.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
parameters:
pyflag: --py3

steps:
- script: ./wpt make-hosts-file | sudo tee -a /etc/hosts
displayName: 'Update hosts (macOS)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- powershell: |
$hostFile = "$env:systemroot\System32\drivers\etc\hosts"
Copy-Item -Path $hostFile -Destination "$hostFile.back" -Force
python wpt ${{ parameters.pyflag }} make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
python wpt make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
displayName: 'Update hosts (Windows)'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
parameters:
pyflag: --py3

steps:
# `python wpt` instead of `./wpt` is to make this work on Windows:
- script: python wpt ${{ parameters.pyflag }} manifest
- script: python wpt manifest
displayName: 'Update manifest'
84 changes: 0 additions & 84 deletions testing/web-platform/tests/tools/ci/tc/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ components:

browser-servo: {}

tox-python2:
env:
TOXENV: py27
PY_COLORS: 0

tox-python3:
env:
TOXENV: py36
Expand Down Expand Up @@ -402,20 +397,6 @@ tasks:
- update_built
command: "./tools/ci/ci_built_diff.sh"

- tools/ unittests (Python 2):
use:
- wpt-base
- trigger-pr
- tox-python2
description: >-
Unit tests for tools running under Python 2.7, excluding wptrunner
command: ./tools/ci/ci_tools_unittest.sh
env:
HYPOTHESIS_PROFILE: ci
schedule-if:
run-job:
- tools_unittest

- tools/ unittests (Python 3.6):
description: >-
Unit tests for tools running under Python 3.6, excluding wptrunner
Expand Down Expand Up @@ -447,28 +428,6 @@ tasks:
run-job:
- tools_unittest

- tools/ integration tests (Python 2):
description: >-
Integration tests for tools running under Python 2.7
use:
- wpt-base
- trigger-pr
- tox-python2
command: ./tools/ci/ci_tools_integration_test.sh
install:
- libnss3-tools
options:
oom-killer: true
browser:
- firefox
- chrome
channel: experimental
xvfb: true
hosts: true
schedule-if:
run-job:
- wpt_integration

- tools/ integration tests (Python 3.6):
description: >-
Integration tests for tools running under Python 3.6
Expand Down Expand Up @@ -515,23 +474,6 @@ tasks:
run-job:
- wpt_integration

- resources/ tests (Python 2):
description: >-
Tests for testharness.js and other files in resources/ under Python 2.7
use:
- wpt-base
- trigger-pr
- tox-python2
command: ./tools/ci/ci_resources_unittest.sh
options:
browser:
- firefox
xvfb: true
hosts: true
schedule-if:
run-job:
- resources_unittest

- resources/ tests (Python 3.6):
description: >-
Tests for testharness.js and other files in resources/ under Python 3.6
Expand Down Expand Up @@ -572,32 +514,6 @@ tasks:
run-job:
- resources_unittest

- infrastructure/ tests:
description: >-
Smoketests for wptrunner
vars:
channel: nightly
use:
- wpt-base
- trigger-pr
- browser-firefox
command: ./tools/ci/ci_wptrunner_infrastructure.sh --py2
install:
- libnss3-tools
- libappindicator1
- fonts-liberation
options:
oom-killer: true
browser:
- firefox
- chrome
channel: experimental
xvfb: true
hosts: false
schedule-if:
run-job:
- wptrunner_infrastructure

- infrastructure/ tests (Python 3):
description: >-
Smoketests for wptrunner
Expand Down
Loading

0 comments on commit 475d2a3

Please sign in to comment.