Skip to content
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

automatically activate shared virtual environment #132

Closed
1 task done
lucasvieirasilva opened this issue Jun 26, 2023 · 0 comments · Fixed by #138
Closed
1 task done

automatically activate shared virtual environment #132

lucasvieirasilva opened this issue Jun 26, 2023 · 0 comments · Fixed by #138
Assignees
Labels
enhancement New feature or request

Comments

@lucasvieirasilva
Copy link
Owner

  • I'd be willing to implement this feature

Description

Currently, all the @nxlv/python executors (add, update, remove, build and flake8) just run poetry commands without any activation logic and let poetry decide which virtual environment to use.

However, when the workspace uses the shared virtual environment, to run all the commands the developer needs to manually activate the virtual environment.

With that being said, @nxlv/python should identify if a virtual environment is not activated and the workspace is configured to use a shared virtual environment, if yes and no virtual environment is activated, the @nxlv/python should be activated before running the poetry commands.

Motivation

Result of this discussion: #128

@lucasvieirasilva lucasvieirasilva added enhancement New feature or request needs-triage This issue needs triage labels Jun 26, 2023
@lucasvieirasilva lucasvieirasilva self-assigned this Jun 26, 2023
@lucasvieirasilva lucasvieirasilva removed the needs-triage This issue needs triage label Jun 26, 2023
lucasvieirasilva added a commit that referenced this issue Jul 3, 2023
Changes all the `@nxlv/python` executors to first verify if the shared virtual environment is
available in the workspace, if yes, activate before running the commands, also adds a new
`@nxlv/python:run-commands` executors to wrap the `nx:run-commands` and activate the virtual
environment before running the commands, if you are using `@nxlv/python` version 16> you can use
this following command to migrate all your `nx:run-commands` to `@nxlv/python:run-commands`: `npx nx
migrate @nxlv/python`

re #132
lucasvieirasilva added a commit that referenced this issue Jul 3, 2023
)

* feat(nx-python): automatically activate shared virtual environment

Changes all the `@nxlv/python` executors to first verify if the shared virtual environment is
available in the workspace, if yes, activate before running the commands, also adds a new
`@nxlv/python:run-commands` executors to wrap the `nx:run-commands` and activate the virtual
environment before running the commands, if you are using `@nxlv/python` version 16> you can use
this following command to migrate all your `nx:run-commands` to `@nxlv/python:run-commands`: `npx nx
migrate @nxlv/python`

re #132
github-actions bot pushed a commit that referenced this issue Jul 3, 2023
# [16.1.0](nx-python-v16.0.0...nx-python-v16.1.0) (2023-07-03)

### Features

* **nx-python:** automatically activate shared virtual environment ([#138](#138)) ([e275534](e275534)), closes [#132](#132)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant