https://pulumi.com logo
Title
d

dry-journalist-60579

03/09/2023, 8:17 PM
I’m trying to reconcile `Error: python projects without a
virtualenv
project configuration are not yet supported` I’m getting from Deployments with the fact that we’re using Poetry for our dependencies like this article demonstrates. Any suggestions?
Ok… so I added virtualenv to my project yaml file and generated a requirements.txt with Poetry (
poetry export --format=requirements.txt > requirements.txt
)
but the package isn’t getting installed…?
b

billowy-army-68599

03/10/2023, 3:27 PM
which python version did you use to generate your
requirements.txt
?
d

dry-journalist-60579

03/10/2023, 3:27 PM
I generated the
requirements.txt
with Poetry:
poetry export --format=requirements.txt > requirements.txt
arpeggio==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
attrs==22.2.0 ; python_version >= "3.10" and python_version < "4.0"
dill==0.3.6 ; python_version >= "3.10" and python_version < "4.0"
grpcio==1.51.3 ; python_version >= "3.10" and python_version < "4.0"
parver==0.4 ; python_version >= "3.10" and python_version < "4.0"
protobuf==4.22.0 ; python_version >= "3.10" and python_version < "4.0"
pulumi-aws-tags==0.4.1 ; python_version >= "3.10" and python_version < "4.0"
pulumi-aws==5.30.0 ; python_version >= "3.10" and python_version < "4.0"
pulumi-awsx==1.0.2 ; python_version >= "3.10" and python_version < "4.0"
pulumi-docker==3.6.1 ; python_version >= "3.10" and python_version < "4.0"
pulumi==3.56.0 ; python_version >= "3.10" and python_version < "4.0"
pyyaml==6.0 ; python_version >= "3.10" and python_version < "4.0"
semver==2.13.0 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
ohh it ignored all of them…
because python 3.9…
b

billowy-army-68599

03/10/2023, 3:29 PM
can you modify your requirements.txt and remove the
python_version
version marker, so for example
arpeggio==2.0.0
d

dry-journalist-60579

03/10/2023, 3:30 PM
Can the requirements.txt be in the repo top-level or does it have to be in the sub-directory for the pulumi project specified in the Deployment settings?
b

billowy-army-68599

03/10/2023, 3:32 PM
for now, it’ll need to be in the same directory as your pulumi code
but it’s reasonable to want to specify the path to it
d

dry-journalist-60579

03/10/2023, 3:33 PM
the repo has multiple pulumi projects:
project-1/
project-2/
group/
  project-3a/
  project-3b/

pyproject.toml
And the top-level pyproject has the poetry deps:
It’d be nice to just be able to use that. Also, would be nice to be able to specify the python version so we can have consistent behavior locally and within the deployment context
b

billowy-army-68599

03/10/2023, 3:35 PM
totally agree, could you open an issue here? https://github.com/pulumi/service-requests/
d

dry-journalist-60579

03/10/2023, 4:06 PM
sweet ok it got up and running
On a different note, has anyone ever brought up how the nouns are confusing in Pulumi, especially with the UX? The real organization is org => projects => stacks, but in the UI the “stacks” listing lists projects and then stacks within the projects. Also, from the CLI, when you’re running pulumi, you need to specify the stack for the current running project… to do that you specify
<org>/<stack>
and the project is implied… It just seems strange that projects kind of fade away even though they are a pretty important organizational principle
r

red-match-15116

03/10/2023, 5:47 PM
@dry-journalist-60579 I responded on the issue you created about supporting alternative dependency managers for pulumi deployments. https://github.com/pulumi/service-requests/issues/193 Please give it a try and let me know if you run into any issues!
d

dry-journalist-60579

03/10/2023, 5:52 PM
Oh, thank you! I’ll take a look
@red-match-15116 any recommendations on the best way to install a specific version of python?
image.png
I guess I’m debating whether we need to pin our local and repo-specified python versions to be 3.9.x because that’s what the pulumi images use or whether there’s a good way to have the executor run with the version we’d like to use
r

red-match-15116

03/10/2023, 6:03 PM
Doesn't poetry install the required python version when it's specified in the pyproject file?
d

dry-journalist-60579

03/10/2023, 6:04 PM
ahh, interesting, let me give it a whirl—looks like you can specify
--directory
for
poetry install
it would be nice to be able to specify all these things in some sort of yml file instead of needing to input this in the UI for each project + stack
@red-match-15116 hmm no dice on python version
r

red-match-15116

03/10/2023, 6:14 PM
interesting! maybe like a pre-run command to install the desired python version like
apt-get install python 3.10
?
d

dry-journalist-60579

03/10/2023, 6:57 PM
hmm so I’m not having so much luck installing 3.10 (tried pyenv and apt-get) but both seem to be cumbersome and slow down the run a ton… I think I’m going to pin our version of to 3.9 for now. Do you see a world where this could somehow be configurable more easily?
r

red-match-15116

03/10/2023, 8:11 PM
@dry-journalist-60579 yeah for sure - we definitely want to end up in a place where these things are more easily configurable. I could imagine a future where we provide images with different python versions. It's not in our immediate timeline though. However, an option that is currently possible is to specify a custom executor that already has your required version of python. There's info here on what requirements the image must meet. You could potentially build off the pulumi image with your specific python version installed. https://www.pulumi.com/docs/reference/deployments-rest-api/#:~:text=image%20is%20used.-,executorImage,-(Optional%5Bstring%5D)%3A%20Allows
d

dry-journalist-60579

03/11/2023, 4:18 PM
Thank you again! I just added a few comments to the PR for posterity