Helper to install (web) locked environments
Project description
install-locked-env
Helper to install "locked environments" stored in repositories on the web.
Installation
Development Setup
hg clone ssh://hg@foss.heptapod.net/fluiddyn/install-locked-env
cd install-locked-env
pdm sync
. .venv/bin/activate
Installing as a tool
Once published to PyPI, you can use it with uvx:
uvx install-locked-env <url>
Usage
Basic Usage
Install a locked environment from a web source:
install-locked-env https://github.com/fluiddyn/fluidsim/tree/5266c974e3368d17819f59b0e700b723591e0d1a/pixi-envs/env-fluidsim-mpi
Different lock file formats (pylock.toml, uv.lock, pdm.lock, pixi.lock, ...) produced and used by different tools (UV, PDM, Pixi, ...) will be supported. Currently, only Pixi is supported.
GitHub, GitLab and Heptapod are supported.
[!CAUTION] Use only with trusted repositories and lock files!
install-locked-envpotentially executes code in the installed environment.
Options
install-locked-env [OPTIONS] URL
Options:
-o, --output PATH Output directory (default: auto-generated from URL)
--no-install Download files only, don't install environment
--register-kernel Register Jupyter kernel if ipykernel is present (default: True)
--no-register-kernel Skip Jupyter kernel registration
--help Show this message and exit
Examples
Install from GitHub:
Lockfile located in the root directory of a repository:
# not yet implemented
install-locked-env https://github.com/fluiddyn/fluidsim
# implemented, but
# - uses pixi.lock and not pylock.toml and
# - wrong env name
install-locked-env https://github.com/fluiddyn/fluidsim/tree/branch/default
or in another directory (this is what currently works):
install-locked-env https://github.com/fluiddyn/fluidsim/tree/branch/default/pixi-envs/env-fluidsim
It should be possible (not yet implemented) to give a lock file address (something like https://github.com/fluiddyn/fluidsim/tree/branch/default/pylock.toml).
Install from Heptapod:
install-locked-env https://foss.heptapod.net/fluiddyn/fluidsim/-/tree/branch/default/pixi-envs/env-fluidsim
Install from GitLab:
install-locked-env https://gitlab.com/user/project/-/tree/main/envs/dev
Download only (no installation):
install-locked-env --no-install --output ./my-env https://github.com/user/repo/tree/main/envs/prod
Skip Jupyter kernel registration:
install-locked-env --no-register-kernel https://github.com/user/repo/tree/main/envs/test
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=install_locked_env --cov-report=html
# Run specific test file
pytest tests/test_parsers.py
# Run specific test
pytest tests/test_parsers.py::test_parse_github_url
Supported Environment Types
Current (v0.1.0)
- ✅ Pixi (pixi.toml, pixi.lock)
Planned
- ⏳ uv (pyproject.toml, uv.lock/pylock.toml)
- ⏳ PDM (pyproject.toml, pdm.lock/pylock.toml)
- ⏳ Poetry (pyproject.toml, poetry.lock)
How it works
- URL parsing: Extracts repository information (platform, owner, repo, ref, path)
- File detection: Attempts to download supported lock files
- Environment type detection: Determines the type based on downloaded files
- Installation: Creates output directory and runs the appropriate installer
- Jupyter registration: If ipykernel is present, registers the environment as a Jupyter kernel
Requirements
- Python 3.11+
- Pixi (for Pixi environments)
- UV (for uv.lock and pylock.toml)
- PDM (for pdm.lock)
Contributing
Contributions are welcome! Please feel free to submit a Merge Request.
License
BSD-3-Clause
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file install_locked_env-0.1.1.tar.gz.
File metadata
- Download URL: install_locked_env-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.26.2 CPython/3.14.2 Linux/6.12.43+deb13-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fb8339468b94e04ed15fccb9581fbf1c7e699b3171e3b0a6a1ccb4556d14f33
|
|
| MD5 |
1ef9644d3d49dc95e8a8125b19eda1c7
|
|
| BLAKE2b-256 |
da7d63f7bf0571561d4990d2fb335e34542735916cd6806b30dc505e01744414
|
File details
Details for the file install_locked_env-0.1.1-py3-none-any.whl.
File metadata
- Download URL: install_locked_env-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.26.2 CPython/3.14.2 Linux/6.12.43+deb13-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15205a092efe7ab0dfc82252f52a4f6c4c22b65891c7a75c583521b2754af36e
|
|
| MD5 |
021afdfc9e855c17cb75fb0e879e4284
|
|
| BLAKE2b-256 |
e6aef6d553b7e6039d998cdfe6e2d6ee314a521355a418b2c3cf119f568132d8
|