Where/How to install dependencies in a Shared Virtual Environment? Executors are failing to resolve flake8/pytest #128
-
I have a single @nxlv library in my repo and ran the migration generator to centralize the dependencies.
From the blog
I did try with the default isolated dependencies project.
disclaimer: never used poetry before today. Any light that can be shed on what I'm doing wrong would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
From the blog again,
It's not clear to me how to "activate". Does this refer to installing the dependencies and having poetry establish each .venv?
|
Beta Was this translation helpful? Give feedback.
-
Hey @Tungsten78, actually, I updated the Can you re-run the blog steps again and see if get any other issues? The
it means you have to activate the python virtual environment in your terminal. There are a lot of ways of doing that, using poetry you can run Got it? |
Beta Was this translation helpful? Give feedback.
-
I thought I had used the new generator but will make double sure. We used
the single version policy every where so this was the default I attempted.
Regarding activation the concern is with CI. We clone, run npm install,
then nx affected/runmany. Currently this works without extra steps with
typescript and dotnet. Nx-dotnet adds an npm prepare step to call a
restore generator. I think this is an analog to the install executor in
nxlv/python.
Using the non shared mode, I was able to add a “nx run-many -t install” to
have all the python projects setup their venv. Is this equivalent?
…On Thu, Jun 22, 2023 at 2:44 PM Lucas Vieira ***@***.***> wrote:
Hey @Tungsten78 <https://github.com/Tungsten78>, actually, I updated the Install
Local Dependency section of the blog, it was referencing the old project
generator.
Can you re-run the blog steps again and see if get any other issues?
The @nxlv/python:poetry-project is the new version, in the next releases
the @nxlv/python:project is going to be removed, I just forget to fix one
of the references in the blog page.
It's not clear to me how to "activate". Does this refer to installing the
dependencies and having poetry establish each .venv?
it means you have to activate the python virtual environment in your
terminal.
There are a lot of ways of doing that, using poetry you can run poetry
shell in our terminal (in the root of the workspace) and the virtual
environment is gonna be activated.
Got it?
—
Reply to this email directly, view it on GitHub
<#128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5BBGVHUVJF34CA25DX2FLXMSVCLANCNFSM6AAAAAAZPN4Z4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I can confirm I had been using the correct project generator (no change in behavior)- the issue seems to be the lack of activation. My workflow:
If I activate ahead of 4 it works. What I'm noticing is the activation is scoped (I realize this is the whole point); however, I don't want to change our dev workflow where most devs won't deal directly with the python projects. Nx abstracts this nicely by hiding the details behind the common targets (lint/test/etc). What I want to avoid is the pre-requisite of having an activation at the root. Is there a way to have this persisted? I would like to embed something in the npm prepare such that post clone / npm i the Nx workspace just works. |
Beta Was this translation helpful? Give feedback.
-
Hey @Tungsten78, I've created this issue to implement this feature #132. |
Beta Was this translation helpful? Give feedback.
-
Hey, @Tungsten78 I've released a new version that supports auto-activate the shared virtual environment as we are discussing in this thread. Could you check this PR description please: #138 |
Beta Was this translation helpful? Give feedback.
@Tungsten78 got it, well, since you move to a single versioning approach, you always need to run poetry install at the root before running the commands, that's on purpose.