Skip to main content

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 lockfile 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.

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:

install-locked-env https://github.com/fluiddyn/fluidsim

or in another directory:

install-locked-env https://github.com/fluiddyn/fluidsim/tree/branch/default/pixi-envs/env-fluidsim

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

  1. URL Parsing: Extracts repository information (platform, owner, repo, ref, path)
  2. File Detection: Attempts to download supported lock files
  3. Environment Type Detection: Determines the type based on downloaded files
  4. Installation: Creates output directory and runs the appropriate installer
  5. 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

install_locked_env-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

install_locked_env-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file install_locked_env-0.1.0.tar.gz.

File metadata

  • Download URL: install_locked_env-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.13.2 Linux/6.1.0-28-amd64

File hashes

Hashes for install_locked_env-0.1.0.tar.gz
Algorithm Hash digest
SHA256 337902557eaff8096e7f2da2078fbbdf040caaf7e30cf460aab2e712f2ec467b
MD5 b36eeff94021ec176702df1e08a02b47
BLAKE2b-256 97640b61d2e3922e08b32355cfac651763efaf02151e121ebd1807d8614dbebf

See more details on using hashes here.

File details

Details for the file install_locked_env-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: install_locked_env-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.13.2 Linux/6.1.0-28-amd64

File hashes

Hashes for install_locked_env-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8630fabc21d617007626743d1902d4b3e050f9666879d8a2280a6ed0f2b37143
MD5 04240a2ed27f5b7f4ab40e66fab22f57
BLAKE2b-256 a10495c6d95affaf73e8c2d616d5a0d6a4a7928589c1ca99aab5ed1f06e076e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page