Skip to content

Commit

Permalink
Merge pull request #705 from Webperf-se/python-3.13
Browse files Browse the repository at this point in the history
Bump Python 3.12 to 3.13
  • Loading branch information
7h3Rabbit authored Nov 8, 2024
2 parents d9c21b6 + 4dd5669 commit c9454b5
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-404.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-a11y-statement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/regression-test-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
run: |
version=$(docker run ${{ env.TEST_TAG }} python --version)
echo "Python version: $version"
if [[ "$version" != "Python 3.12"* ]]; then
echo "Error: Default python version is not 3.12 based, was we unable to change default version?"
if [[ "$version" != "Python 3.13"* ]]; then
echo "Error: Default python version is not 3.13 based, was we unable to change default version?"
exit 1
fi
- name: Check if webperf_core help command works
Expand Down Expand Up @@ -86,6 +86,10 @@ jobs:
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 1 -r -i sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
fi
if [[ "$testresult" != *"Performance:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
Expand Down Expand Up @@ -114,6 +118,10 @@ jobs:
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 4 -r -i sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
fi
if [[ "$testresult" != *"Standards:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
Expand All @@ -133,6 +141,10 @@ jobs:
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 5 -r -i sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
fi
if [[ "$testresult" != *"Integrity & Security:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
Expand Down Expand Up @@ -179,6 +191,10 @@ jobs:
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 10 -r -i sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
fi
if [[ "$testresult" != *"A11y:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
Expand Down Expand Up @@ -243,6 +259,10 @@ jobs:
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 22 -r -i sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
fi
if [[ "$testresult" != *"Overall:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-pa11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-sitespeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-standard-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-tracking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-webbkoll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test-ylt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Setup dependencies using pip
run: pip install -r requirements.txt
Expand Down
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ RUN add-apt-repository ppa:deadsnakes/ppa -y

RUN apt update

RUN apt install -y python3.12 python3.12-venv
RUN apt install -y python3.13 python3.13-venv

RUN apt install -y python3-pip

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 311
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 311

RUN update-alternatives --config python3

RUN apt install -y python3.12-distutils

RUN wget https://bootstrap.pypa.io/get-pip.py

RUN python3.12 get-pip.py
RUN python3.13 get-pip.py

RUN apt -y autoremove

Expand All @@ -64,13 +62,13 @@ USER sitespeedio

RUN npm install --omit=dev

RUN python3.12 -m pip install -r requirements.txt --break-system-packages && \
python3.12 -m pip install --upgrade pip --break-system-packages && \
python3.12 -m pip install --upgrade setuptools --break-system-packages && \
python3.12 -m pip install pyssim Pillow image --break-system-packages
RUN python3.13 -m pip install -r requirements.txt --break-system-packages && \
python3.13 -m pip install --upgrade pip --break-system-packages && \
python3.13 -m pip install --upgrade setuptools --break-system-packages && \
python3.13 -m pip install pyssim Pillow image --break-system-packages

RUN python3.12 default.py --setting tests.lighthouse.disable-sandbox=true --setting tests.sitespeed.xvfb=true --save-setting settings.json
RUN python3.13 default.py --setting tests.lighthouse.disable-sandbox=true --setting tests.sitespeed.xvfb=true --save-setting settings.json

ENTRYPOINT []

CMD ["python3.12", "default.py -h"]
CMD ["python3.13", "default.py -h"]
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Locate your pygettext.py file:
```locate pygettext.py```

It might be as follows:
```/Library/Frameworks/Python.framework/Versions/3.8/share/doc/python3.8/examples/Tools/i18n/pygettext.py```
```/Library/Frameworks/Python.framework/Versions/3.13/share/doc/python3.13/examples/Tools/i18n/pygettext.py```

### References

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This method is best if you want to test/verify private websites like acceptance
it is also best/fastest when wanting to contribute with new tests, translations or other stuff.

## How to setup
- [Download and install Python 3.12 (or later)](https://www.python.org/downloads/) if you don't have it installed already.
- [Download and install Python 3.13 (or later)](https://www.python.org/downloads/) if you don't have it installed already.
- [Fork webperf-core repository](https://github.com/Webperf-se/webperf_core/fork?fragment=1) or [download webperf-core](https://github.com/Webperf-se/webperf_core/archive/refs/heads/main.zip) to your machine.
- Open the Terminal (Macos & Linux) or Command Prompt (Windows).
- Navigate to where you downloaded (and unpacked) the source code. If you don’t know how to navigate in Terminal/CMD, read the [Windows guide](https://www.digitalcitizen.life/command-prompt-how-use-basic-commands) or [under Step 5 for Mac / Linux](https://computers.tutsplus.com/tutorials/navigating-the-terminal-a-gentle-introduction--mac-3855).
Expand Down
2 changes: 1 addition & 1 deletion tools/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def check_python():
return

version = packaging.version.Version(version)
repo_version = packaging.version.Version("3.12")
repo_version = packaging.version.Version("3.13")
if version.major is not repo_version.major:
print('\t- Python:', 'WARNING: wrong major version')
return
Expand Down

0 comments on commit c9454b5

Please sign in to comment.