Skip to content

Commit

Permalink
Upgrade to Python 3.11 (#1246)
Browse files Browse the repository at this point in the history
* Passing corountines to wait is now forbidden

* Remove unused pytestmark

* Upgrade workflows to lint 3.9-11 and test with 3.11

* Quote Python versions

* Quote 3.11's

* Upgrade docker images to Python 3.11

* Update setup.py's with dropping 3.8

* Upgrade install-vm script to Python 3.11
  • Loading branch information
jotare authored Aug 23, 2023
1 parent cc10aa3 commit 6dd34be
Show file tree
Hide file tree
Showing 33 changed files with 97 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
cache: "pip"

- name: Install test deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -49,7 +49,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_ingest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -47,7 +47,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nucliadb_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nucliadb_node_binding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_node_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
architecture: ${{ matrix.python-architecture || 'x64' }}

- run: pip install -U twine 'black>=22.3.0,<23' typing_extensions
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- run: pip install -U twine

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_reader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -48,7 +48,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -75,7 +75,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -65,7 +65,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_telemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -50,7 +50,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nucliadb_telemetry_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Install requirements
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -48,7 +48,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nucliadb_writer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout the repository
Expand All @@ -48,7 +48,7 @@ jobs:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.11"]

steps:
- name: Checkout the repository
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Setup env
run: |
Expand All @@ -42,42 +42,42 @@ jobs:
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBUtilsTests (3.9)
check-name: NucliaDBUtilsTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for models
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBModelsTests (3.9)
check-name: NucliaDBModelsTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for client tests
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBClientTests (3.9)
check-name: NucliaDBClientTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for sdk tests
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBSDKTests (3.9)
check-name: NucliaDBSDKTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for dataset tests
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBDatasetTests (3.9)
check-name: NucliaDBDatasetTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for nucliadb tests
uses: lewagon/[email protected]
with:
ref: main
check-name: NucliaDBTests (3.9)
check-name: NucliaDBTests (3.11)
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.11

WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.node_sidecar
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9 AS builder
FROM python:3.11 AS builder

RUN mkdir -p /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rust
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9 as python_rust
FROM python:3.11 as python_rust

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.withbinding
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9 as python_rust
FROM python:3.11 as python_rust

ARG RUST_BUILD_PROFILE=release

Expand Down Expand Up @@ -39,7 +39,7 @@ RUN set -eux; \
maturin build --profile ${RUST_BUILD_PROFILE}


FROM python:3.9
FROM python:3.11
ENV TIKV_CLIENT_VERSION=0.0.3


Expand Down
Loading

2 comments on commit 6dd34be

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 6dd34be Previous: a40981d Ratio
nucliadb/tests/benchmarks/test_search.py::test_search_returns_labels 60.968364451013414 iter/sec (stddev: 0.0007288368999887676) 60.779932309336715 iter/sec (stddev: 0.0019119907918232523) 1.00
nucliadb/tests/benchmarks/test_search.py::test_search_relations 154.0769321858245 iter/sec (stddev: 0.00022233477779594728) 182.57436721258293 iter/sec (stddev: 0.0002220745559283828) 1.18

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 6dd34be Previous: b760df9 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 7221.714676511638 iter/sec (stddev: 0.000002096924228530564) 5804.479338298567 iter/sec (stddev: 1.4505330313876097e-7) 0.80

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.