Skip to content

Latest commit

 

History

History
99 lines (71 loc) · 4.75 KB

README.md

File metadata and controls

99 lines (71 loc) · 4.75 KB

Examples

Check

One can try out unidep here by running, for example:

  • unidep install ./setup_py_project ./hatch_project to install the setup_py_project and hatch_project packages
  • unidep install-all -e to install all packages in editable mode
  • unidep conda-lock to generate a global conda-lock.yml file and consistent per package conda-lock.yml files
  • unidep merge to merge all requirements.yaml files into a single environment.yaml file
  • unidep pip-compile to generate a locked requirements.txt file

Table of Contents

Combine one or multiple requirements.yaml files into a single environment.yaml file

Combine requirements.yaml files in subdirectories and into an environment.yaml file that can be installed with conda.

Here we can just run unidep merge with no arguments, since the defaults are the same as what we want.

This would be the same as running unidep merge --name myenv --verbose:

🔍 Scanning in `.` at depth 0
🔍 Scanning in `hatch_project` at depth 1
🔍 Found `requirements.yaml` at `hatch_project/requirements.yaml`
🔍 Scanning in `poetry_project` at depth 1
🔍 Found `requirements.yaml` at `poetry_project/requirements.yaml`
🔍 Scanning in `setuptools_project` at depth 1
🔍 Found `requirements.yaml` at `setuptools_project/requirements.yaml`
🔍 Scanning in `setup_py_project` at depth 1
🔍 Found `requirements.yaml` at `setup_py_project/requirements.yaml`
📄 Parsing `hatch_project/requirements.yaml`
📄 Parsing `poetry_project/requirements.yaml`
📄 Parsing `setup_py_project/requirements.yaml`
📄 Parsing include `../setuptools_project`
📄 Parsing `setuptools_project/requirements.yaml`
📝 Generating environment file at `environment.yaml`
📝 Environment file generated successfully.
✅ Generated environment file at `environment.yaml` from `hatch_project/requirements.yaml`, `poetry_project/requirements.yaml`, `setup_py_project/requirements.yaml`, `setuptools_project/requirements.yaml`

See the resulting environment.yaml file.

Install a requirements.yaml file directly with pip

Install a requirements.yaml file directly with pip, which installs only the pip installable packages.

Just run pip install ./setup_py_project/.

Because unidep is in the [build-system] section of the pyproject.toml file, it will be installed automatically.

Install a requirements.yaml file directly with unidep

Install a requirements.yaml file directly with unidep, which first installs the conda installable packages, then the Pip installable packages, and finally the local package itself.

Just run unidep install ./setup_py_project or unidep install -e ./setup_py_project for an editable install.

📦 Installing conda dependencies with `conda install --yes --override-channels --channel conda-forge pandas adaptive">=1.0.0, <2.0.0" pfapack pipefunc`

📦 Installing pip dependencies with `/opt/hostedtoolcache/Python/3.12.0/x64/bin/python -m pip install yaml2bib rsync-time-machine slurm-usage codestructure aiokef markdown-code-runner home-assistant-streamdeck-yaml`

📝 Found local dependencies: {'setup_py_project': ['hatch_project', 'setuptools_project']}

📦 Installing project with `/opt/hostedtoolcache/Python/3.12.0/x64/bin/python -m pip install -e /home/runner/work/unidep/unidep/example/hatch_project -e /home/runner/work/unidep/unidep/example/setuptools_project -e ./setup_py_project`