New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sdkgen/python] Use importlib.metadata
instead of pkg_resources
#15266
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changelog[uncommitted] (2024-01-26)Bug Fixes
|
6 tasks
This was referenced Jan 26, 2024
Test: Upgrade pulumi/{pkg,sdk} to 8c84e11a354d16eac9acf1412abc0e7d27fd7934
pulumi/pulumi-azuread#741
Closed
Closed
Closed
Closed
This was referenced Jan 26, 2024
Test: Upgrade pulumi/{pkg,sdk} to d54f44cbfa6f8147d10bfe7c8080fb144f1a67ec
pulumi/pulumi-azuread#742
Closed
Closed
Closed
Closed
justinvp
force-pushed
the
justin/importlib
branch
from
January 26, 2024 03:16
d54f44c
to
867406d
Compare
This was referenced Jan 26, 2024
Closed
Test: Upgrade pulumi/{pkg,sdk} to 867406da7cc4acdc5195c519d38d5db034e75477
pulumi/pulumi-azuread#743
Closed
Closed
Closed
Frassle
approved these changes
Jan 26, 2024
This was referenced Jan 26, 2024
Closed
Test: Upgrade pulumi/{pkg,sdk} to f226f0f205fd648cb3fa4ad5de48da90c467c43f
pulumi/pulumi-azuread#744
Closed
Closed
Closed
This addresses two issues: 1. `pkg_resource` is deprecated in favor of `importlib.resources` and `importlib.metadata` (https://setuptools.pypa.io/en/latest/pkg_resources.html) 2. Generated provider SDKs don't indicate that they have a dependency on `setuptools` (which includes `pkg_resources`), which can cause problems when installing the package in environments that don't have `setuptools` installed. That's not often common in Pulumi projects, as the virtual environment created by the CLI will include `setuptools`, however, if creating the virtual environment manually with `python -m venv`, `setuptools` is no longer included in the created virtual environment as of Python 3.12.
Co-authored-by: Fraser Waters <fraser@pulumi.com>
justinvp
force-pushed
the
justin/importlib
branch
from
January 26, 2024 14:49
f226f0f
to
76a087e
Compare
This was referenced Jan 26, 2024
Closed
Test: Upgrade pulumi/{pkg,sdk} to 76a087e4c0214d6b5fa9d64ed7564ef9c6325177
pulumi/pulumi-azuread#745
Closed
Closed
Closed
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 26, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 26, 2024
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 31, 2024
### Features - [backend] Allows the PULUMI_SKIP_CHECKPOINTS environment variable to be set without requiring the PULUMI_EXPERIMENTAL flag. [#15318](#15318) - [auto/go] Add new API to install the Pulumi CLI from the Automation API [#15049](#15049) - [auto/nodejs] Allow disabling version validation when using a custom PulumiCommand instance [#15242](#15242) - [auto/python] Add new API to install the Pulumi CLI [#15204](#15204) - [auto/python] Inline programs can now be defined as async functions. [#15278](#15278) - [pkg/testing] Add RequireEmptyPreviewAfterRefresh option to ProgramTest ### Bug Fixes - [engine] Fix a hang in preview --import-file. [#15203](#15203) - [engine] Engine will now error if aliases request a parent with no URN. [#15232](#15232) - [engine] Fix stack name validation when PULUMI_DISABLE_VALIDATION isn't set. [#15245](#15245) - [engine] Fix a performance issue doing unneeded secret encryption. [#15306](#15306) - [sdk/go] Include error message in local workspace validation. [#15279](#15279) - [sdkgen/go] Remove pulumix references from generated enums [#15280](#15280) - [programgen/nodejs] Fixes generated expression for filebase64 function to use fs.readFileSync directly with base64 encoding option [#15253](#15253) - [sdkgen/python] Use importlib.metadata instead of pkg_resources [#15266](#15266) ### Miscellaneous - [auto/go] Remove obsolete note from FullyQualifiedStackName comment. [#15281](#15281) - [backend/filestate] Upgrade gocloud.dev to the latest version [#15202](#15202) - [sdk/python] Remove compatability code for Python 3.7 and below. [#15276](#15276)
4 tasks
blampe
added a commit
to pulumi/ci-mgmt
that referenced
this pull request
Jan 31, 2024
We need to regenerate SDKs with pulumi/pulumi#15266 before we can upgrade to the latest 3.x. 3.11 should be the last version that included pkg_resources. Tests: * [x] pulumi/pulumi-docker#973 * [x] pulumi/pulumi-aws-native#1305 * [ ] pulumi/pulumi-aws#3365 * [x] pulumi/pulumi-kubernetes#2802 Closes #800 --------- Co-authored-by: Bryce Lampe <bryce@pulumi.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses two issues:
pkg_resource
is deprecated in favor ofimportlib.resources
andimportlib.metadata
(https://setuptools.pypa.io/en/latest/pkg_resources.html)Generated provider SDKs don't indicate that they have a dependency on
setuptools
(which includespkg_resources
), which can cause problems when installing the package in environments that don't havesetuptools
installed. That's not often common in Pulumi projects, as the virtual environment created by the CLI will includesetuptools
, however, if creating the virtual environment manually withpython -m venv
,setuptools
is no longer included in the created virtual environment as of Python 3.12.Fixes #12414
Based on #14002, thanks @edgarrmondragon!