Commit Graph

5 Commits

Author SHA1 Message Date
Julien de17d1a70f
Replace asyncio.ensure_future with create_task ()
`ensure_future` was deprecated in Python 3.10
https://docs.python.org/3/library/asyncio-future.html#asyncio.ensure_future

The preferred way to convert a coroutine into a future is to use
`create_task` instead, which was introduced in Python 3.7, so safe for
us to use everywhere.

Ref https://github.com/pulumi/pulumi/issues/11827
2024-09-30 12:53:15 +00:00
Justin Van Patten 597f2145b9
Fully generate TypedDict input types by default ()
https://github.com/pulumi/pulumi/pull/16704 made it so that classes and
TypeDicts are generated for input types by default, but missed some
cases, which lead to referencing some TypedDict types that didn't exist.

This PR fixes that by ensuring that all input types are generated.

A regression test is included that runs pyright in strict mode to ensure
TypedDict types in signatures actually exist.

The second commit regenerates testdata throughout.

Fixes 
2024-09-20 17:16:14 +00:00
Fraser Waters a9947b4e4e
Python parameterized provider test ()
This adds support for replacement parameterised providers to Python and
a small integration test to check it works e2e.

When using parameterised providers we need to use the new (currently
unstable) RegisterPackage system, instead of sending
Version/DownloadURL/etc via RegisterResourceRequest. Once
RegisterPackage is stable the intention is to change _all_ packages to
use it and for normal packages to fall back to the
RegisterResourceRequest options, while parameterised packages will
error.

The actual parameter value is embedded in the python SDK as a base64
string that we decode before sending to the gRPC endpoint as bytes.
2024-07-16 10:55:38 +00:00
Fraser Waters 969e0b9735
Conformance test for provider pre-release versions ()
Noticed this issue while doing SDK gen for parameterised providers, but
figured it deserved its own conformance test. Check that if a provider
has a pre-release semver that the _exact_ version can be reported by the
generated SDK. This already just works for NodeJS, but Python needed a
fix to write the version to `_utilities.py` rather than trying to
unconvert the pypi version from the package.

Also needed to make the conformance test checks for
`GetProgramDependencies` even weaker (which is fine, they are just a
very basic sanity check) because the provider reports a version of
"3.0.0-alpha.1.internal" while the python version is "3.0.0a1+internal".
2024-06-29 10:07:14 +00:00
Justin Van Patten b29807f2b4
[sdkgen/dotnet] Bump Pulumi version reference ()
Bump the default version range for the referenced `Pulumi` package to a
version that supports `Config.GetDouble` (3.55+;
380536dd85).

Fixes 
2024-06-27 05:16:14 +00:00