Commit Graph

7 Commits

Author SHA1 Message Date
Justin Van Patten fd7a9a88c0
[tests/integration] Remove `pulumi` from `requirements.txt` ()
In preparation for supporting Python 3.12...

These tests have a `requirements.txt` file that depends on the released
version of the `pulumi` package, but that package depends on the old
`grpcio` package that does not work Python 3.12.

Note that `ProgramTest` first installs `requirements.txt` in the virtual
environment it creates, then it installs any local dependencies
specified via `ProgramTestOptions.Dependencies`.

To make these tests work on Python 3.12, remove `pulumi` from
`requirements.txt`. After we publish a new `pulumi` package that
supports Python 3.12, we could consider reverting this change.

Aside: I considered changing `ProgramTest` to install
`ProgramTestOptions.Dependencies` deps _before_ `requirements.txt` deps.
That would avoid the need to change these `requirements.txt` files and
would work for the most part. If the version specified in
`requirements.txt` is satisfied by the already installed local version,
then pip doesn't install the version from `requirements.txt`. Where this
doesn't work is if `requirements.txt` specifies an older version range.
Then the local dependency would be uninstalled and the older version
from `requirements.txt` would be installed. Which isn't the behavior we
want. And there's very likely `requirements.txt` files in other repos in
this situation (there were even some in this PR that depend on v2.x!)
and I didn't want to change the behavior for those. We'd have to make it
an opt-in `ProgramTestOptions` option. It seemed simpler to just modify
these `requirements.txt` files.

Note: The change to
`tests/integration/python/stack_truncate/main_dir_specified/bar/requirements.txt`
depends on https://github.com/pulumi/pulumi/pull/15225. It's going to
fail without that change.
2024-01-24 14:16:40 +00:00
Justin Van Patten e6359b86b3 [sdk/python] Fix enum test for python 11 behavior change
Python 11 has changed the behavior of `__format__` and `__str__` to return the type and name of an enum rather than its value. This affects one of our tests which is expecting the value of the enum ("Burgundy") to be formatted in a sentence and not the type and name ("RubberTreeVariety.BURGUNDY"). This change fixes the test to explicitly use the enum's value in the formatted string so we get consistent output when the test is run across multiple versions of Python.
2023-03-22 07:23:46 -07:00
Aaron Friel bcd4ee9909
Fix non-determinism in Python dynamic provider serialization ()
* fix: workaround for nondeterminism in dynamic provider serialization

* Revert "fix: simplify test, remove capture of global variable ()"

This reverts commit 7b8b1cceae.

* chore: changelog entry
2022-05-22 20:15:29 -07:00
Aaron Friel 7b8b1cceae
fix: simplify test, remove capture of global variable () 2022-05-22 08:48:06 -07:00
Emiliza Gutierrez 14211eea10
Updating requirements.txt to use 3.x series of pulumi () 2021-11-02 15:25:26 -07:00
Komal 48f43906f4
[sdk/python] - Support enums ()
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-11-24 19:15:11 -06:00
Komal ec9c02f578
Add tests for ts enums () 2020-10-22 10:53:29 -07:00