diff --git a/.all-contributorsrc b/.all-contributorsrc
index 4dd91a9bf3..0ed1c67de7 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -1549,6 +1549,15 @@
"contributions": [
"bug"
]
+ },
+ {
+ "login": "greglucas",
+ "name": "Greg Lucas",
+ "avatar_url": "https://avatars.githubusercontent.com/u/12417828?v=4",
+ "profile": "https://github.com/greglucas",
+ "contributions": [
+ "code"
+ ]
}
],
"repoType": "github",
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 869dc2d66d..cae45cbe5a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -283,6 +283,13 @@ jobs:
java: '8'
node: '14'
os: ubuntu-latest
+ - title: 'Python 3.11'
+ python: '3.11'
+ dotnet: '6.0.x'
+ go: '1.18'
+ java: '8'
+ node: '14'
+ os: ubuntu-latest
runs-on: ${{ matrix.os }}
diff --git a/.mergify/config.yml b/.mergify/config.yml
index be5e069cdc..e4ac664195 100644
--- a/.mergify/config.yml
+++ b/.mergify/config.yml
@@ -22,6 +22,7 @@ queue_rules:
- status-success=Test (Python 3.8)
- status-success=Test (Python 3.9)
- status-success=Test (Python 3.10)
+ - status-success=Test (Python 3.11)
pull_request_rules:
- name: label core
@@ -71,6 +72,7 @@ pull_request_rules:
- status-success=Test (Python 3.8)
- status-success=Test (Python 3.9)
- status-success=Test (Python 3.10)
+ - status-success=Test (Python 3.11)
- name: Synchronize that PR to upstream and merge it (squash)
actions:
@@ -120,6 +122,7 @@ pull_request_rules:
- status-success=Test (Python 3.8)
- status-success=Test (Python 3.9)
- status-success=Test (Python 3.10)
+ - status-success=Test (Python 3.11)
- name: Synchronize that PR to upstream and merge it (no-squash)
actions:
@@ -169,6 +172,7 @@ pull_request_rules:
- status-success=Test (Python 3.8)
- status-success=Test (Python 3.9)
- status-success=Test (Python 3.10)
+ - status-success=Test (Python 3.11)
- name: Clean branch up
actions:
diff --git a/README.md b/README.md
index a451c1a826..87a3a7a96f 100644
--- a/README.md
+++ b/README.md
@@ -129,131 +129,132 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Graham Lea 🤔 👀 |
+ Greg Lucas 💻 |
Hamza Assyad 🐛 💻 🤔 👀 |
Hari Pachuveetil 📝 📖 |
Hsing-Hui Hsu 💻 📖 🤔 👀 |
Ikko Ashimine 📖 |
James 🐛 💻 |
- James Kelley 🐛 |
+ James Kelley 🐛 |
James Mead 💻 |
James Siri 💻 🚧 |
Jason Del Ponte 🤔 👀 |
Jason Fulghum 🤔 📆 👀 |
Jeff Malins 💻 |
Jerry Kindall 📖 🤔 |
- Jimmy Gaussen 🤔 |
+ Jimmy Gaussen 🤔 |
Johannes Weber 📖 |
John Pantzlaff 💻 |
Jon Steinich 🐛 🤔 💻 |
Joseph Lawson 👀 |
Joseph Martin 🐛 |
Junix 🐛 |
- Justin Frahm 🐛 |
+ Justin Frahm 🐛 |
Justin Taylor 🐛 |
Kaizen Conroy 💻 🐛 |
Kaizen Conroy 💻 |
Kaushik Borra 🐛 |
Knut O. Hellan 🐛 |
Kyle Thomson 💻 👀 |
- Leandro Padua 🐛 |
+ Leandro Padua 🐛 |
Liang Zhou 🐛 💻 |
Madeline Kusters 💻 🐛 |
Maja S Bratseth 🐛 |
Marcos Diez 🐛 |
Mark Nielsen 💻 |
Matthew Bonig 🐛 📝 |
- Matthew Pirocchi 💻 🤔 👀 |
+ Matthew Pirocchi 💻 🤔 👀 |
Meng Xin Zhu 🐛 |
Michael Neil 🚧 |
Mike Lane 🐛 |
Mitch Garnaat 🐛 💻 🤔 👀 |
Mitchell Valine 🐛 💻 🤔 🚧 👀 |
Mohamad Soufan 📖 |
- Mykola Mogylenko 🐛 |
+ Mykola Mogylenko 🐛 |
Naumel 👀 |
Neta Nir 💻 🤔 🚧 👀 |
Nick Lynch 🐛 💻 🚧 👀 |
Niranjan Jayakar 🐛 💻 🤔 🚧 👀 |
Noah Litov 💻 🚧 👀 |
Otavio Macedo 💻 🐛 |
- PIDZ - Bart 🤔 |
+ PIDZ - Bart 🤔 |
Peter Woodworth 🚧 |
Petr Kacer 🐛 |
Petra Barus 💻 |
Philip Cali 🤔 |
Quentin Loos 🤔 |
Raphael 🐛 |
- Richard H Boyd 🐛 |
+ Richard H Boyd 🐛 |
Rico Huijbers 🐛 💻 🤔 🚧 👀 |
Romain Marcadier 🐛 💻 🎨 🤔 🚧 👀 📝 |
SADIK KUZU 👀 |
SK 🤔 |
Sam Fink 💻 👀 |
Sam Goodwin 👀 |
- Sebastian Korfmann 🐛 💻 🤔 |
+ Sebastian Korfmann 🐛 💻 🤔 |
Sepehr Laal 🐛 |
Shane Witbeck 🤔 |
Shiv Lakshminarayan 💻 🚧 👀 |
Somaya 💻 🤔 🚧 👀 |
Stephen Kuenzli 📖 |
Takahiro Sugiura 📖 |
- The Gitter Badger 💻 🚧 |
+ The Gitter Badger 💻 🚧 |
Thomas Poignant 🐛 |
Thomas Steinbach 🐛 |
Thorsten Hoeger 💻 |
Tim Wagner 🐛 🤔 |
Tobias Lidskog 💻 |
Tom Bonner 🐛 |
- Ty Coghlan 🐛 |
+ Ty Coghlan 🐛 |
Tyler van Hensbergen 🤔 |
Vlad Hrybok 🐛 |
Vladimir Shchur 🐛 |
Will Bender 🐛 |
Yan Zhulanow 💻 |
Yigong Liu 🐛 🤔 |
- Zach Bienenfeld 🐛 |
+ Zach Bienenfeld 🐛 |
ajnarang 🤔 |
aniljava 💻 |
arnogeurts-sqills 🐛 💻 |
cn-cit 🐛 |
deccy-mcc 🐛 |
dependabot-preview[bot] 🐛 🚧 |
- dependabot[bot] 🚧 |
+ dependabot[bot] 🚧 |
dheffx 🐛 |
gregswdl 🐛 |
guyroberts21 📖 |
mattBrzezinski 📖 |
mergify 🚧 |
mergify[bot] 🚧 |
- nathannaveen 🚧 |
+ nathannaveen 🚧 |
seiyashima42 🐛 💻 📖 |
sullis 💻 |
vaneek 🐛 |
diff --git a/gh-pages/content/user-guides/lib-author/configuration/targets/python.md b/gh-pages/content/user-guides/lib-author/configuration/targets/python.md
index ab5eb8098a..7a41219615 100644
--- a/gh-pages/content/user-guides/lib-author/configuration/targets/python.md
+++ b/gh-pages/content/user-guides/lib-author/configuration/targets/python.md
@@ -20,6 +20,7 @@ The `python` target requires two configuration entries:
- `Programming Language :: Python :: 3.8`
- `Programming Language :: Python :: 3.9`
- `Programming Language :: Python :: 3.10`
+ - `Programming Language :: Python :: 3.11`
Example:
diff --git a/packages/@jsii/python-runtime/pyproject.toml b/packages/@jsii/python-runtime/pyproject.toml
index bc3c3c58b7..4ccebe88f3 100644
--- a/packages/@jsii/python-runtime/pyproject.toml
+++ b/packages/@jsii/python-runtime/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["setuptools~=62.2", "wheel~=0.37"]
build-backend = 'setuptools.build_meta'
[tool.black]
-target-version = ['py37', 'py38', 'py39', 'py310']
+target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'
exclude = '\.(git|mypy_cache|env)'
diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py
index a3ef3a3c1f..33e2cb80ae 100644
--- a/packages/@jsii/python-runtime/setup.py
+++ b/packages/@jsii/python-runtime/setup.py
@@ -32,6 +32,7 @@
install_requires=[
"attrs>=21.2,<23.0",
"cattrs>=1.8,<22.3",
+ "importlib_resources>=5.2.0",
"publication>=0.0.3", # This is used by all generated code.
"typeguard~=2.13.3", # This is used by all generated code.
"python-dateutil",
@@ -48,6 +49,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
"Typing :: Typed",
diff --git a/packages/@jsii/python-runtime/src/jsii/__meta__.py b/packages/@jsii/python-runtime/src/jsii/__meta__.py
index f4a54a5056..a24112ea87 100644
--- a/packages/@jsii/python-runtime/src/jsii/__meta__.py
+++ b/packages/@jsii/python-runtime/src/jsii/__meta__.py
@@ -3,7 +3,9 @@
from ._compat import importlib_resources
# Load our version number and other metadata.
-_meta = json.loads(importlib_resources.read_text("jsii", "_metadata.json"))
+_meta = json.loads(
+ importlib_resources.files("jsii").joinpath("_metadata.json").read_text()
+)
__version__ = _meta["version"]
__jsii_runtime_version__ = _meta["jsii-runtime"]["version"]
diff --git a/packages/@jsii/python-runtime/src/jsii/_compat.py b/packages/@jsii/python-runtime/src/jsii/_compat.py
index 27798ed192..3c0830517b 100644
--- a/packages/@jsii/python-runtime/src/jsii/_compat.py
+++ b/packages/@jsii/python-runtime/src/jsii/_compat.py
@@ -2,10 +2,7 @@
import sys
-if sys.version_info >= (3, 7):
- import importlib.resources as importlib_resources
-else:
- import importlib_resources
+import importlib_resources
__all__ = ["importlib_resources"]
diff --git a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
index 7ae62a11d5..61e5fae38a 100644
--- a/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
+++ b/packages/@jsii/python-runtime/src/jsii/_kernel/providers/process.py
@@ -237,7 +237,11 @@ def _jsii_runtime(self) -> str:
for resname, filename in resources.items():
pathlib.Path(os.path.dirname(filename)).mkdir(exist_ok=True)
with open(filename, "wb") as fp:
- fp.write(importlib_resources.read_binary(jsii._embedded.jsii, resname))
+ fp.write(
+ importlib_resources.files(jsii._embedded.jsii)
+ .joinpath(resname)
+ .read_bytes()
+ )
# Return our first path, which should be the path for jsii-runtime.js
return resources[jsii._embedded.jsii.ENTRYPOINT]
diff --git a/packages/@jsii/python-runtime/src/jsii/_runtime.py b/packages/@jsii/python-runtime/src/jsii/_runtime.py
index 19dcc31ba0..b8fd0e6c23 100644
--- a/packages/@jsii/python-runtime/src/jsii/_runtime.py
+++ b/packages/@jsii/python-runtime/src/jsii/_runtime.py
@@ -44,11 +44,13 @@ def load(cls, *args, _kernel=kernel, **kwargs) -> "JSIIAssembly":
assembly = cls(*args, **kwargs)
# Actually load the assembly into the kernel, we're using the
- # importlib.resources API here isntead of manually constructing the path, in
+ # importlib.resources API here instead of manually constructing the path, in
# the hopes that this will make JSII modules able to be used with zipimport
# instead of only on the FS.
- with importlib_resources.path(
- f"{assembly.module}._jsii", assembly.filename
+ with importlib_resources.as_file(
+ importlib_resources.files(f"{assembly.module}._jsii").joinpath(
+ assembly.filename
+ )
) as assembly_path:
_kernel.load(assembly.name, assembly.version, os.fspath(assembly_path))
diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts
index 831f0e41e0..0a7a010423 100644
--- a/packages/jsii-pacmak/lib/targets/python.ts
+++ b/packages/jsii-pacmak/lib/targets/python.ts
@@ -2124,6 +2124,7 @@ class Package {
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
'Typing :: Typed',
],
scripts,
diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap
index 2daa7b47c7..b1c57b1df4 100644
--- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap
+++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap
@@ -1282,6 +1282,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"License :: OSI Approved"
],
@@ -2704,6 +2705,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"License :: OSI Approved"
],
diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap
index 7e5af6ef15..fb35301af4 100644
--- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap
+++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap
@@ -466,6 +466,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed"
],
"scripts": []
@@ -976,6 +977,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed"
],
"scripts": []
@@ -1465,6 +1467,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed"
],
"scripts": []
@@ -1952,6 +1955,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed"
],
"scripts": []
diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap
index 1e09f2e78f..5bc1df2363 100644
--- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap
+++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap
@@ -305,6 +305,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"License :: OSI Approved"
],
@@ -858,6 +859,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"License :: OSI Approved"
],
@@ -1389,6 +1391,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"Development Status :: 7 - Inactive",
"License :: OSI Approved"
@@ -3016,6 +3019,7 @@ kwargs = json.loads(
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Typing :: Typed",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved",