-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Sync with system Python? #5964
Comments
I was able to workaround this by activating the environment dynamically, but this does feel like a bit of a hack since it doesn't guarantee that the environments are actually synced. This is with a dask cluster, I'm not aware of an easy way to "switch" to the new venv if the workers are started with the system python. import runpy
runpy.run_path('.venv/bin/activate_this.py') |
Na this isn't supported yet. |
I think you can use |
In the mean time, I'm addind the venv's bin (or Scripts on Windows) folder to PATH as per https://github.com/jakebailey/pyright-action/tree/v2/?tab=readme-ov-file#using-pyright-from-path : jobs:
mypy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- name: Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync --locked --extra dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- run: mypy . --python-version=3.12
pyright:
runs-on: ubuntu-latest
defaults:
run:
working-directory: canopeum_backend
steps:
- uses: actions/checkout@v4
- name: Install uv using the standalone installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv sync --locked --extra dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2
with:
version: PATH
python-version: "3.12"
working-directory: canopeum_backend And making sure that my docker commands are using |
I upvote for the optional synchronization with the host system rather than with venv-only. Not only for CI/CD, but for me personally it is also occasionally preferable to install project packages into the system directly. |
One option is to symlink:
|
* Adding google maps package * Set secret path for docker swar * Debugging secrets * Debugging secrets * Debugging secrets * Backend secret backend setted up * Backend secret backend setted up v2 * Backend secret backend setted up v3 * Backend secret backend setted up v4 * Switch to UV for dependency and venv management * Remove GitHub uv cache * Missing dependencies * powershell -> pwsh * group tools vs stubs in dev dependencies * sync djangorestframework-stubs higher * Fix standalone isntaller to actually use Unix command * try adding bin to path * Add ref to astral-sh/uv#5964 * Remove dependency on pytz * Edit Contact works fine * Adding links edition , TODO add error validation * Announcement edition OK , still TODO: error handling * Fixing some html keys duplication * Cardinal edit site fixed * WIP * Fix adress * Error handling OK, TODO : Translation * Translations OK * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing lint and few build errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing mypy and pyrights warns * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Line to long for ruff ><' * Possibility to generate spec file by cli * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rollbacking some mistakes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ruff don't like bare exception, it is not really needed * Build test * Regenerating package.lock * Revert "Possibility to generate spec file by cli" This reverts commit 000da46. * Update package-lock * Update canopeum_frontend/src/components/analytics/site-modal/SiteModal.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_frontend/src/components/analytics/site-modal/SiteModal.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_backend/canopeum_backend/views.py Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Rollback config database changes, opening another PR for these * Removing indexing list because unecessary since dev test previously created same treetype on a single batch but shouldn't * Simplifying things * Lint autofix * Mass linting * Reason mandatory onCancel SiteModal + Bringing back StrictMode * Update canopeum_frontend/src/components/social/AnnouncementCard.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_frontend/src/components/social/AnnouncementCard.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Rolling back to fit dprint requirements + deletion of requirement.txt --------- Co-authored-by: Theo Auffeuvre <theo.auffeuvre@beslogic.com> Co-authored-by: Samuel Therrien <samuel.therrien@beslogic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I suppose it is a functional workaround, but having this implemented natively into uv would be a big improvement |
This is now supported via |
* Adding google maps package * Set secret path for docker swar * Debugging secrets * Debugging secrets * Debugging secrets * Backend secret backend setted up * Backend secret backend setted up v2 * Backend secret backend setted up v3 * Backend secret backend setted up v4 * Switch to UV for dependency and venv management * Remove GitHub uv cache * Missing dependencies * powershell -> pwsh * group tools vs stubs in dev dependencies * sync djangorestframework-stubs higher * Fix standalone isntaller to actually use Unix command * try adding bin to path * Add ref to astral-sh/uv#5964 * Remove dependency on pytz * Edit Contact works fine * Adding links edition , TODO add error validation * Announcement edition OK , still TODO: error handling * Fixing some html keys duplication * Cardinal edit site fixed * WIP * Fix adress * Error handling OK, TODO : Translation * Translations OK * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing lint and few build errors * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing mypy and pyrights warns * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Line to long for ruff ><' * Possibility to generate spec file by cli * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rollbacking some mistakes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ruff don't like bare exception, it is not really needed * Build test * Regenerating package.lock * Revert "Possibility to generate spec file by cli" This reverts commit 000da46. * Update package-lock * Update canopeum_frontend/src/components/analytics/site-modal/SiteModal.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_frontend/src/components/analytics/site-modal/SiteModal.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_backend/canopeum_backend/views.py Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Rollback config database changes, opening another PR for these * Removing indexing list because unecessary since dev test previously created same treetype on a single batch but shouldn't * Simplifying things * Lint autofix * Mass linting * Reason mandatory onCancel SiteModal + Bringing back StrictMode * Update canopeum_frontend/src/components/social/AnnouncementCard.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Update canopeum_frontend/src/components/social/AnnouncementCard.tsx Co-authored-by: Samuel T. <samuel.therrien@beslogic.com> * Rolling back to fit dprint requirements + deletion of requirement.txt --------- Co-authored-by: Theo Auffeuvre <theo.auffeuvre@beslogic.com> Co-authored-by: Samuel Therrien <samuel.therrien@beslogic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I'm trying to use uv to synchronize environments across a cluster. This involves creating a lock file and then using it to install dependencies everywhere. As far as I can tell,
uv sync
only supports installing dependencies in a uv managed venv. Is there anyway to run sync against a target environment, the system Python in this case?The text was updated successfully, but these errors were encountered: