Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Update Python code to use Python 3.11 (#1852)

Dhruv Bhanushali8a9db25b7449
diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml
index 8693e176d..c863402c5 100644
--- a/.github/actions/setup-env/action.yml
+++ b/.github/actions/setup-env/action.yml
@@ -35,7 +35,7 @@ runs:
# Ensure that it matches `python_version` field in the following files:
# - `automations/python/Pipfile`
# - `dead_links/Pipfile`
- python-version: "3.10"
+ python-version: "3.11"
cache: pipenv
cache-dependency-path: |
**/Pipfile.lock
diff --git a/.github/workflows/label_pr.yml b/.github/workflows/label_pr.yml
index ac08dcbb9..d42a65679 100644
--- a/.github/workflows/label_pr.yml
+++ b/.github/workflows/label_pr.yml
@@ -20,17 +20,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- - name: Setup Python
- uses: actions/setup-python@v4
+ - name: Setup CI env
+ uses: ./.github/actions/setup-env
with:
- python-version: "3.10"
-
- - name: Install dependencies
- working-directory: ./automations/python
- run: |
- python -m pip install --user --upgrade pip
- python -m pip install --user pipenv
- pipenv install --deploy
+ setup_nodejs: false # Node.js is not needed to run Python automations.
+ install_recipe: "automations/python/install"
- name: Label PR
working-directory: ./automations/python
diff --git a/.github/workflows/label_sync.yml b/.github/workflows/label_sync.yml
index 2a726bed8..29b7bdf9f 100644
--- a/.github/workflows/label_sync.yml
+++ b/.github/workflows/label_sync.yml
@@ -18,17 +18,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- - name: Setup Python
- uses: actions/setup-python@v4
+ - name: Setup CI env
+ uses: ./.github/actions/setup-env
with:
- python-version: "3.10"
-
- - name: Install dependencies
- working-directory: ./automations/python
- run: |
- python -m pip install --user --upgrade pip
- python -m pip install --user pipenv
- pipenv install --deploy
+ setup_nodejs: false # Node.js is not needed to run Python automations.
+ install_recipe: "automations/python/install"
- name: Sync standard labels
working-directory: ./automations/python
diff --git a/.github/workflows/pr_project_automation.yml b/.github/workflows/pr_project_automation.yml
index 7b06de307..1484ed582 100644
--- a/.github/workflows/pr_project_automation.yml
+++ b/.github/workflows/pr_project_automation.yml
@@ -18,17 +18,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- - name: Setup Python
- uses: actions/setup-python@v4
+ - name: Setup CI env
+ uses: ./.github/actions/setup-env
with:
- python-version: "3.10"
-
- - name: Install dependencies
- working-directory: ./automations/python
- run: |
- python -m pip install --user --upgrade pip
- python -m pip install --user pipenv
- pipenv install --deploy
+ setup_nodejs: false # Node.js is not needed to run Python automations.
+ install_recipe: "automations/python/install"
- name: Clear PRs in "Merged!"
working-directory: ./automations/python
diff --git a/.github/workflows/project_automation.yml b/.github/workflows/project_automation.yml
index 6b88d628a..894b78d2a 100644
--- a/.github/workflows/project_automation.yml
+++ b/.github/workflows/project_automation.yml
@@ -18,17 +18,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- - name: Setup Python
- uses: actions/setup-python@v4
+ - name: Setup CI env
+ uses: ./.github/actions/setup-env
with:
- python-version: "3.10"
-
- - name: Install dependencies
- working-directory: ./automations/python
- run: |
- python -m pip install --user --upgrade pip
- python -m pip install --user pipenv
- pipenv install --deploy
+ setup_nodejs: false # Node.js is not needed to run Python automations.
+ install_recipe: "automations/python/install"
- name: Move stale issues from "In progress"
working-directory: ./automations/python
diff --git a/api/Pipfile b/api/Pipfile
index c7ae311c2..d4d15f740 100644
--- a/api/Pipfile
+++ b/api/Pipfile
@@ -57,4 +57,4 @@ wsgi-basic-auth = "~=1.1"
aiohttp = "~=3.8"
[requires]
-python_version = "3.10"
+python_version = "3.11"
diff --git a/api/Pipfile.lock b/api/Pipfile.lock
index 1882e6611..2415d8ac5 100644
--- a/api/Pipfile.lock
+++ b/api/Pipfile.lock
@@ -1,11 +1,11 @@
{
"_meta": {
"hash": {
- "sha256": "70080a6ea26a4245d350cef65f995ea770e2842ff0f349e2821f98ae1d62e5d3"
+ "sha256": "748e04b0c54a2fa281cab86a784f3723a5591ef1f54c6a93f9b5aeba76628b7e"
},
"pipfile-spec": 6,
"requires": {
- "python_version": "3.10"
+ "python_version": "3.11"
},
"sources": [
{
@@ -320,7 +320,7 @@
"sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df",
"sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"
],
- "markers": "python_version >= '3.7'",
+ "markers": "python_full_version >= '3.7.0'",
"version": "==3.1.0"
},
"coreapi": {
@@ -1547,6 +1547,14 @@
}
},
"develop": {
+ "appnope": {
+ "hashes": [
+ "sha256:02bd91c4de869fbb1e1c50aafc4098827a7a54ab2f39d9dcba6c9547ed920e24",
+ "sha256:265a455292d0bd8a72453494fa24df5a11eb18373a60c7c0430889f22548605e"
+ ],
+ "markers": "sys_platform == 'darwin'",
+ "version": "==0.1.3"
+ },
"asttokens": {
"hashes": [
"sha256:4622110b2a6f30b77e1473affaa97e711bc2f07d3f10848420ff1898edbe94f3",
@@ -1704,7 +1712,7 @@
"sha256:34471d8b60e1f06d174236c4d3cf9590fbf3cff1cc733b28d15cd83672bcd062",
"sha256:824c743197bbe2104fcc6dce114a4082bf7f7efdebf16683510cb0ec6d8d53d0"
],
- "markers": "python_version >= '3.7' and python_full_version < '4.0.0'",
+ "markers": "python_full_version >= '3.7.0' and python_full_version < '4.0.0'",
"version": "==0.1.4"
},
"lazy-object-proxy": {
@@ -1762,7 +1770,7 @@
"sha256:79f37f38ef9fd5206b924ed7a6f382cea7b649b3b56383c47f1906082b7b9015",
"sha256:c573e2be2c783abae56c5a1486ab716ca96e09d1c3eab56020d1dc680aa57bf8"
],
- "markers": "python_version >= '3.7' and python_full_version < '4.0.0'",
+ "markers": "python_full_version >= '3.7.0' and python_full_version < '4.0.0'",
"version": "==0.4.4"
},
"openapi-spec-validator": {
@@ -1801,7 +1809,7 @@
"sha256:5c869d315be50776cc8a993f3af43e0c60dc01506b399643f919034ebf4cdcab",
"sha256:cdd7b1f9d7d5c8b8d3315dbf5a86b2596053ae845f056f57d97c0eefff84da14"
],
- "markers": "python_version >= '3.7' and python_full_version < '4.0.0'",
+ "markers": "python_full_version >= '3.7.0' and python_full_version < '4.0.0'",
"version": "==0.4.3"
},
"pendulum": {
@@ -1882,7 +1890,7 @@
"sha256:23ac5d50538a9a38c8bde05fecb47d0b403ecd0662857a86f886f798563d5b9b",
"sha256:45ea77a2f7c60418850331366c81cf6b5b9cf4c7fd34616f733c5427e6abbb1f"
],
- "markers": "python_version >= '3.7'",
+ "markers": "python_full_version >= '3.7.0'",
"version": "==3.0.38"
},
"psycopg": {
diff --git a/automations/python/Pipfile b/automations/python/Pipfile
index a9db6af05..365402929 100644
--- a/automations/python/Pipfile
+++ b/automations/python/Pipfile
@@ -15,7 +15,7 @@ pyotp = "*"
ipython = "*"
[requires]
-python_version = "3.10"
+python_version = "3.11"
[pipenv]
allow_prereleases = true
diff --git a/automations/python/Pipfile.lock b/automations/python/Pipfile.lock
index 3cd455817..f350a8e88 100644
--- a/automations/python/Pipfile.lock
+++ b/automations/python/Pipfile.lock
@@ -1,11 +1,11 @@
{
"_meta": {
"hash": {
- "sha256": "a33fd1d4dbff6b52b9084db0839fb0105627b01151675800f0de9c92e2b2b5e3"
+ "sha256": "6021893bea446427ceb9cde4ec565b7aa2cc313dff3ce2218b9f77dcb1950988"
},
"pipfile-spec": 6,
"requires": {
- "python_version": "3.10"
+ "python_version": "3.11"
},
"sources": [
{
@@ -195,6 +195,30 @@
"markers": "python_version >= '3'",
"version": "==3.0.1"
},
+ "cryptography": {
+ "hashes": [
+ "sha256:05dc219433b14046c476f6f09d7636b92a1c3e5808b9a6536adf4932b3b2c440",
+ "sha256:0dcca15d3a19a66e63662dc8d30f8036b07be851a8680eda92d079868f106288",
+ "sha256:142bae539ef28a1c76794cca7f49729e7c54423f615cfd9b0b1fa90ebe53244b",
+ "sha256:3daf9b114213f8ba460b829a02896789751626a2a4e7a43a28ee77c04b5e4958",
+ "sha256:48f388d0d153350f378c7f7b41497a54ff1513c816bcbbcafe5b829e59b9ce5b",
+ "sha256:4df2af28d7bedc84fe45bd49bc35d710aede676e2a4cb7fc6d103a2adc8afe4d",
+ "sha256:4f01c9863da784558165f5d4d916093737a75203a5c5286fde60e503e4276c7a",
+ "sha256:7a38250f433cd41df7fcb763caa3ee9362777fdb4dc642b9a349721d2bf47404",
+ "sha256:8f79b5ff5ad9d3218afb1e7e20ea74da5f76943ee5edb7f76e56ec5161ec782b",
+ "sha256:956ba8701b4ffe91ba59665ed170a2ebbdc6fc0e40de5f6059195d9f2b33ca0e",
+ "sha256:a04386fb7bc85fab9cd51b6308633a3c271e3d0d3eae917eebab2fac6219b6d2",
+ "sha256:a95f4802d49faa6a674242e25bfeea6fc2acd915b5e5e29ac90a32b1139cae1c",
+ "sha256:adc0d980fd2760c9e5de537c28935cc32b9353baaf28e0814df417619c6c8c3b",
+ "sha256:aecbb1592b0188e030cb01f82d12556cf72e218280f621deed7d806afd2113f9",
+ "sha256:b12794f01d4cacfbd3177b9042198f3af1c856eedd0a98f10f141385c809a14b",
+ "sha256:c0764e72b36a3dc065c155e5b22f93df465da9c39af65516fe04ed3c68c92636",
+ "sha256:c33c0d32b8594fa647d2e01dbccc303478e16fdd7cf98652d5b3ed11aa5e5c99",
+ "sha256:cbaba590180cba88cb99a5f76f90808a624f18b169b90a4abb40c1fd8c19420e",
+ "sha256:d5a1bd0e9e2031465761dfa920c16b0065ad77321d8a8c1f5ee331021fda65e9"
+ ],
+ "version": "==40.0.2"
+ },
"deprecated": {
"hashes": [
"sha256:43ac5335da90c31c24ba028af536a91d41d53f9e6901ddb021bcc572ce44e38d",
@@ -243,6 +267,9 @@
"version": "==1.57"
},
"pyjwt": {
+ "extras": [
+ "crypto"
+ ],
"hashes": [
"sha256:69285c7e31fc44f68a1feb309e948e0df53259d579295e6cfe2b1792329f05fd",
"sha256:d83c3d892a77bbb74d3e1a2cfa90afaadb60945205d1095d9221f04466f64c14"
diff --git a/documentation/Pipfile b/documentation/Pipfile
index 79e6439b8..e000360dd 100644
--- a/documentation/Pipfile
+++ b/documentation/Pipfile
@@ -4,7 +4,6 @@ verify_ssl = true
name = "pypi"
[packages]
-sphinxcontrib-mermaid = "*"
[dev-packages]
sphinx = "*"
@@ -15,4 +14,4 @@ myst-parser = "*"
sphinxcontrib-mermaid = "*"
[requires]
-python_version = "3.10"
+python_version = "3.11"
diff --git a/documentation/Pipfile.lock b/documentation/Pipfile.lock
index 8231ce9aa..584deac5d 100644
--- a/documentation/Pipfile.lock
+++ b/documentation/Pipfile.lock
@@ -1,11 +1,11 @@
{
"_meta": {
"hash": {
- "sha256": "534b21f9d4ddfdc4ac8369afcf52df73f64570944a6ac4acaf3741bd354aaebd"
+ "sha256": "90bd10310ec6ccb2b4e710ac6edf153a3591b26d9007ec39cd92f1a0c3d12440"
},
"pipfile-spec": 6,
"requires": {
- "python_version": "3.10"
+ "python_version": "3.11"
},
"sources": [
{
diff --git a/ingestion_server/Pipfile b/ingestion_server/Pipfile
index a11af76b5..3d65cd577 100644
--- a/ingestion_server/Pipfile
+++ b/ingestion_server/Pipfile
@@ -27,4 +27,4 @@ tldextract = "~=3.3"
sentry-sdk = {extras = ["falcon"], version = "*"}
[requires]
-python_version = "3.10"
+python_version = "3.11"
diff --git a/ingestion_server/Pipfile.lock b/ingestion_server/Pipfile.lock
index 0e3ebe506..fccb87ff0 100644
--- a/ingestion_server/Pipfile.lock
+++ b/ingestion_server/Pipfile.lock
@@ -1,11 +1,11 @@
{
"_meta": {
"hash": {
- "sha256": "4ea83f8549889e5801857772302999144cc22a552734b67777cd4d0fb042cf7a"
+ "sha256": "e1650664e209745fa81c3b82b8aeafb3f94b2d80f61071017098355467735a5b"
},
"pipfile-spec": 6,
"requires": {
- "python_version": "3.10"
+ "python_version": "3.11"
},
"sources": [
{
@@ -142,7 +142,7 @@
"sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df",
"sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"
],
- "markers": "python_version >= '3.7'",
+ "markers": "python_full_version >= '3.7.0'",
"version": "==3.1.0"
},
"elasticsearch": {
@@ -421,6 +421,14 @@
}
},
"develop": {
+ "appnope": {
+ "hashes": [
+ "sha256:02bd91c4de869fbb1e1c50aafc4098827a7a54ab2f39d9dcba6c9547ed920e24",
+ "sha256:265a455292d0bd8a72453494fa24df5a11eb18373a60c7c0430889f22548605e"
+ ],
+ "markers": "sys_platform == 'darwin'",
+ "version": "==0.1.3"
+ },
"asttokens": {
"hashes": [
"sha256:4622110b2a6f30b77e1473affaa97e711bc2f07d3f10848420ff1898edbe94f3",
@@ -534,7 +542,7 @@
"sha256:23ac5d50538a9a38c8bde05fecb47d0b403ecd0662857a86f886f798563d5b9b",
"sha256:45ea77a2f7c60418850331366c81cf6b5b9cf4c7fd34616f733c5427e6abbb1f"
],
- "markers": "python_version >= '3.7'",
+ "markers": "python_full_version >= '3.7.0'",
"version": "==3.0.38"
},
"ptyprocess": {