Check
setup.py
integration examplepyproject.toml
with Setuptools (PEP 621) examplehatch_project
using Hatchling example
One can try out unidep
here by running, for example:
unidep install ./setup_py_project ./hatch_project
to install thesetup_py_project
andhatch_project
packagesunidep install-all -e
to install all packages in editable modeunidep conda-lock
to generate a globalconda-lock.yml
file and consistent per packageconda-lock.yml
filesunidep merge
to merge allrequirements.yaml
files into a singleenvironment.yaml
fileunidep pip-compile
to generate a lockedrequirements.txt
file
- Combine one or multiple
requirements.yaml
files into a singleenvironment.yaml
file - Install a
requirements.yaml
file directly withpip
- Install a
requirements.yaml
file directly withunidep
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, 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
, 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`