From 90ce1da3f7c057fc2094df0dc99ce9cb286630aa Mon Sep 17 00:00:00 2001 From: mikewrighton Date: Mon, 6 Nov 2023 11:19:07 -0500 Subject: [PATCH] revert: "switch to python 3.8 (#4239)" (#4317) This reverts commit 087ff241bc852b49d91c79883e5faeaf5bb92f42. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 --- .github/workflows/main.yml | 26 +++++++++---------- CONTRIBUTING.md | 4 +-- .../user-guides/language-support/index.md | 2 +- .../configuration/targets/python.md | 1 + .../content/user-guides/lib-author/index.md | 2 +- packages/@jsii/python-runtime/pyproject.toml | 4 +-- packages/@jsii/python-runtime/setup.py | 5 ++-- packages/jsii-pacmak/lib/targets/python.ts | 5 ++-- .../__snapshots__/examples.test.js.snap | 10 ++++--- .../prerelease-identifiers.test.js.snap | 20 ++++++++------ .../__snapshots__/target-python.test.js.snap | 20 ++++++++------ 11 files changed, 56 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5fbb9186a4..884e769d3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,10 +47,10 @@ jobs: with: cache: yarn node-version: '16' - - name: Set up Python 3.8 + - name: Set up Python 3.7 uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.7' cache: pip - name: Install python3-venv run: sudo apt install -y python3-venv @@ -130,10 +130,10 @@ jobs: with: cache: yarn node-version: '16' - - name: Set up Python 3.8 + - name: Set up Python 3.7 uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.7' cache: pip - name: Install python3-venv run: sudo apt install -y python3-venv @@ -197,7 +197,7 @@ jobs: java: ['8'] node: ['16'] # EOL 2023-09-11 os: [ubuntu-latest] - python: ['3.8'] + python: ['3.7'] # Add specific combinations to be tested against "node 14" (to restrict cardinality) include: # Test using Windows @@ -207,7 +207,7 @@ jobs: go: '1.18' java: '8' node: '16' - python: '3.8' + python: '3.7' # Test using macOS - title: 'macOS' os: macos-latest @@ -215,7 +215,7 @@ jobs: go: '1.18' java: '8' node: '16' - python: '3.8' + python: '3.7' # Test alternate Nodes - title: 'Node 16' java: '8' @@ -223,21 +223,21 @@ jobs: go: '1.18' node: '16' # EOL 2023-09-11 os: ubuntu-latest - python: '3.8' + python: '3.7' - title: 'Node 18' java: '8' dotnet: '6.0.x' go: '1.18' node: '18' # EOL 2025-04-30 os: ubuntu-latest - python: '3.8' + python: '3.7' - title: 'Node 20' java: '8' dotnet: '6.0.x' go: '1.18' node: '20' # EOL 2026-04-30 os: ubuntu-latest - python: '3.8' + python: '3.7' # Test alternate .NETs - title: '.NET 7.0' java: '8' @@ -245,7 +245,7 @@ jobs: go: '1.18' node: '16' os: ubuntu-latest - python: '3.8' + python: '3.7' # Test alternate Gos - title: 'Go 1.19' java: '8' @@ -253,7 +253,7 @@ jobs: go: '1.19' node: '16' os: ubuntu-latest - python: '3.8' + python: '3.7' # Test alternate Javas - title: 'Java 11' java: '11' @@ -261,7 +261,7 @@ jobs: go: '1.18' node: '16' os: ubuntu-latest - python: '3.8' + python: '3.7' # Test alternate Pythons - title: 'Python 3.8' python: '3.8' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31ca82f6ce..5d313502da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ in your development environment. + [`maven >= 3.0.5`](https://maven.apache.org) - [.NET `6.0`] or later + *Recommended:* [`mono >= 6`](https://www.mono-project.com) -- [Python `3.8.10`] or later +- [Python `3.7.3`] or later + [`pip`](https://pip.pypa.io/en/stable/installing/) + [`setuptools >= 38.6.0`](https://pypi.org/project/setuptools/) + [`wheel`](https://pypi.org/project/wheel/) @@ -57,7 +57,7 @@ in your development environment. [Oracle's OpenJDK8]: http://openjdk.java.net/install/ [Amazon Corretto 8]: https://aws.amazon.com/corretto/ [.NET `6.0`]: https://www.microsoft.com/net/download -[Python `3.8.10`]: https://www.python.org/downloads/release/python-3810/ +[Python `3.7.3`]: https://www.python.org/downloads/release/python-373/ [Go]: https://go.dev/dl/ ## Getting Started diff --git a/gh-pages/content/user-guides/language-support/index.md b/gh-pages/content/user-guides/language-support/index.md index ed2788985b..03b9dcc5c5 100644 --- a/gh-pages/content/user-guides/language-support/index.md +++ b/gh-pages/content/user-guides/language-support/index.md @@ -69,7 +69,7 @@ in significant re-engineering effort: - How are dependencies modeled? If [semantic versioning] is not the norm, what is the strategy to correctly represent semantic version ranges? - What are the toolchain and platform requirements? - - For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.8 or above, + - For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.7 or above, etc... ## Code Generation 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 2eadcf7c2d..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 @@ -16,6 +16,7 @@ The `python` target requires two configuration entries: - Additionally, the following `Programming Language ::` classifiers are already set (more could be added by the user if relevant): - `Programming Language :: Python :: 3 :: Only` + - `Programming Language :: Python :: 3.7` - `Programming Language :: Python :: 3.8` - `Programming Language :: Python :: 3.9` - `Programming Language :: Python :: 3.10` diff --git a/gh-pages/content/user-guides/lib-author/index.md b/gh-pages/content/user-guides/lib-author/index.md index fdf52ab1c0..dac3277655 100644 --- a/gh-pages/content/user-guides/lib-author/index.md +++ b/gh-pages/content/user-guides/lib-author/index.md @@ -19,7 +19,7 @@ to produce releasable artifacts. | .NET | .NET ≥ 6.0 | | Go | Go ≥ 1.18 | | Java | JDK ≥ 8 *and* Maven ≥ 3.6 | -| Python | Python ≥ 3.8 | +| Python | Python ≥ 3.7 | ## :octicons-desktop-download-24: Download Locations diff --git a/packages/@jsii/python-runtime/pyproject.toml b/packages/@jsii/python-runtime/pyproject.toml index 791f88fdba..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 = ['py38', 'py39', 'py310', 'py311'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = '\.pyi?$' exclude = '\.(git|mypy_cache|env)' @@ -11,6 +11,6 @@ exclude = '\.(git|mypy_cache|env)' ignore_missing_imports = true [tool.pyright] -pythonVersion = "3.8" +pythonVersion = "3.7" venv = ".env" venvPath = "." diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index c5378575c3..5ae79af4b7 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -36,15 +36,16 @@ "publication>=0.0.3", # This is used by all generated code. "typeguard~=2.13.3", # This is used by all generated code. "python-dateutil", - "typing_extensions>=3.8,<5.0", + "typing_extensions>=3.7,<5.0", ], - python_requires="~=3.8", + python_requires="~=3.7", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index c0ab22271e..55b73db957 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -2102,7 +2102,7 @@ class Package { package_dir: { '': 'src' }, packages: modules.map((m) => m.pythonName), package_data: packageData, - python_requires: '~=3.8', + python_requires: '~=3.7', install_requires: [ `jsii${toPythonVersionRange(`^${VERSION}`)}`, 'publication>=0.0.3', @@ -2115,6 +2115,7 @@ class Package { 'Operating System :: OS Independent', 'Programming Language :: JavaScript', 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', @@ -2235,7 +2236,7 @@ class Package { code.line(); code.line('[tool.pyright]'); code.line('defineConstant = { DEBUG = true }'); - code.line('pythonVersion = "3.8"'); + code.line('pythonVersion = "3.7"'); code.line('pythonPlatform = "All"'); code.line('reportSelfClsParameterName = false'); code.closeFile('pyproject.toml'); 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 cbc750ca01..72c40a5489 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 @@ -1225,7 +1225,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -1266,7 +1266,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -1277,6 +1277,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -2646,7 +2647,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -2687,7 +2688,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -2698,6 +2699,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", 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 473d5cfe94..4482893e5c 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 @@ -417,7 +417,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -454,7 +454,7 @@ kwargs = json.loads( "foo@1.2.3.jsii.tgz" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "bar>=2.0.0.rc42, <3.0.0", "jsii<0.0.1", @@ -466,6 +466,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -931,7 +932,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -968,7 +969,7 @@ kwargs = json.loads( "foo@1.2.3.jsii.tgz" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "bar>=4.5.6.dev1337, <5.0.0", "jsii<0.0.1", @@ -980,6 +981,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -1425,7 +1427,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -1462,7 +1464,7 @@ kwargs = json.loads( "foo@2.0.0-rc.42.jsii.tgz" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -1473,6 +1475,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -1916,7 +1919,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -1953,7 +1956,7 @@ kwargs = json.loads( "foo@4.5.6-pre.1337.jsii.tgz" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -1964,6 +1967,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", 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 b0d3531ebb..e5db3283dd 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 @@ -248,7 +248,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -289,7 +289,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -301,6 +301,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -802,7 +803,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -843,7 +844,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -854,6 +855,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -1329,7 +1331,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -1372,7 +1374,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -1385,6 +1387,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -2989,7 +2992,7 @@ build-backend = "setuptools.build_meta" [tool.pyright] defineConstant = { DEBUG = true } -pythonVersion = "3.8" +pythonVersion = "3.7" pythonPlatform = "All" reportSelfClsParameterName = false @@ -3069,7 +3072,7 @@ kwargs = json.loads( "py.typed" ] }, - "python_requires": "~=3.8", + "python_requires": "~=3.7", "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", @@ -3082,6 +3085,7 @@ kwargs = json.loads( "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",