Skip to content

Commit 2064f3d

Browse files
committed
[build,core,utils] Remove pyyaml, move storage.py to core
1 parent b2ac443 commit 2064f3d

21 files changed

+3345
-740
lines changed

conda/Makefile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ NAME = deepali
44
# Relative path of repository root directory
55
ROOT = ..
66

7-
# Commands
8-
CONDA = mamba
9-
CONDA_OPTS = --no-banner
10-
CONDA_DEVENV = conda devenv
11-
CONDA_LOCK = conda-lock
12-
CONDA_LOCK_OPTS = --mamba
13-
147
# Name of conda-devenv configuration file
158
DEVENV = environment.devenv.yml
169

@@ -66,20 +59,20 @@ clear:
6659
@rm -f $(LOCKFILE) environment.devenv.{linux-64,osx-64,win-64}.yml environment.{linux-64,osx-64,win-64}.{lock,yml}
6760

6861
lock-linux:
69-
@$(CONDA_DEVENV) --name $(NAME) --file $(DEVENV) --env-manager $(CONDA) --env-var PLATFORM=linux-64 --print > environment.devenv.linux-64.yml
70-
@$(CONDA_LOCK) $(CONDA_LOCK_OPTS) --lockfile $(LOCKFILE) --platform linux-64 --file environment.devenv.linux-64.yml
62+
conda devenv --name $(NAME) --file $(DEVENV) --env-manager conda --env-var PLATFORM=linux-64 --print > environment.devenv.linux-64.yml
63+
conda lock --lockfile $(LOCKFILE) --platform linux-64 --file environment.devenv.linux-64.yml
7164

7265
lock-osx:
73-
@$(CONDA_DEVENV) --name $(NAME) --file $(DEVENV) --env-manager $(CONDA) --env-var PLATFORM=osx-64 --print > environment.devenv.osx-64.yml
74-
@$(CONDA_LOCK) $(CONDA_LOCK_OPTS) --lockfile $(LOCKFILE) --platform osx-64 --file environment.devenv.osx-64.yml
66+
conda devenv --name $(NAME) --file $(DEVENV) --env-manager conda --env-var PLATFORM=osx-64 --print > environment.devenv.osx-64.yml
67+
conda lock --lockfile $(LOCKFILE) --platform osx-64 --file environment.devenv.osx-64.yml
7568

7669
lock-win:
77-
@$(CONDA_DEVENV) --name $(NAME) --file $(DEVENV) --env-manager $(CONDA) --env-var PLATFORM=win-64 --print > environment.devenv.win-64.yml
78-
@$(CONDA_LOCK) $(CONDA_LOCK_OPTS) --lockfile $(LOCKFILE) --platform win-64 --file environment.devenv.win-64.yml
70+
conda devenv --name $(NAME) --file $(DEVENV) --env-manager conda --env-var PLATFORM=win-64 --print > environment.devenv.win-64.yml
71+
conda lock --lockfile $(LOCKFILE) --platform win-64 --file environment.devenv.win-64.yml
7972

8073
render:
81-
@$(CONDA_LOCK) render $(LOCKFILE) --kind env --filename-template environment.{platform}
82-
@$(CONDA_LOCK) render $(LOCKFILE) --kind explicit --filename-template environment.{platform}.lock
74+
conda lock render $(LOCKFILE) --kind env --filename-template environment.{platform}
75+
conda lock render $(LOCKFILE) --kind explicit --filename-template environment.{platform}.lock
8376
@if ! grep -e 'pytorch.*cuda' environment.linux-64.lock > /dev/null 2> /dev/null; then \
8477
echo "Expected PyTorch with CUDA support for PLATFORM=linux-64. Check conda configuration."; \
8578
fi
@@ -88,10 +81,10 @@ render:
8881
env: create-env install
8982

9083
create-env:
91-
@$(CONDA) $(CONDA_OPTS) create --name $(NAME) --file environment.$(PLATFORM).lock
84+
conda create --name $(NAME) --file environment.$(PLATFORM).lock
9285

9386
update-env:
94-
@$(CONDA) $(CONDA_OPTS) update --name $(NAME) --file environment.$(PLATFORM).lock --prune
87+
conda update --name $(NAME) --file environment.$(PLATFORM).lock --prune
9588

9689
install:
97-
@$(CONDA) $(CONDA_OPTS) run --name $(NAME) pip install $(PIP_INSTALL_OPTS) ./$(ROOT)[utils]
90+
conda run --name $(NAME) pip install $(PIP_INSTALL_OPTS) ./$(ROOT)[utils]

conda/README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Conda environment configurations for `deepali` libraries.
55

66
## Create environment
77

8-
If not done before, install either [Miniconda](https://docs.conda.io/en/latest/miniconda.html) or [Anaconda](https://www.anaconda.com/).
8+
If not done before, install either [Anaconda], [Miniconda], or [Mambaforge].
99

1010
A conda environment for this project can be created using the `env` Makefile target, i.e.,
1111

@@ -22,7 +22,7 @@ NAME=deepali
2222
PLATFORM=linux-64
2323
2424
conda create --name $NAME --file environment.$PLATFORM.lock
25-
conda run --name $NAME pip install [--editable] ..
25+
conda run --name $NAME pip install ..[utils]
2626
```
2727

2828
where `PLATFORM` is one of the following values.
@@ -38,16 +38,21 @@ where `PLATFORM` is one of the following values.
3838

3939
The following tools are required to update the generated dependency files.
4040

41-
1. Install [Miniconda](https://docs.conda.io/en/latest/miniconda.html): Package dependency management tool.
42-
2. Install [mamba](https://mamba.readthedocs.io/en/latest/): Faster dependency resolution and more informative error messages.
43-
- `conda install mamba=0.23 --name base --channel conda-forge`
44-
3. Install [conda-devenv](https://conda-devenv.readthedocs.io/en/latest/): Advanced conda environment configuration such as conditional dependencies.
45-
- `conda install conda-devenv=2.3 --name base --channel conda-forge`
46-
4. Install [conda-lock](https://conda-incubator.github.io/conda-lock/): Lock versions of dependencies and generate explicit lockfiles.
47-
- `conda install conda-lock=1.0 --name base --channel conda-forge`
41+
1. Install [Mambaforge]: Package dependency management tool.
42+
3. Install [conda-devenv]: Advanced conda environment configuration such as conditional dependencies.
43+
- `mamba --no-banner install conda-devenv=2.3 --name base --channel conda-forge`
44+
4. Install [conda-lock]: Lock versions of dependencies and generate explicit lockfiles.
45+
- `mamba --no-banner install conda-lock=1.0 --name base --channel conda-forge`
4846

4947
After editing the `environment.devenv.yml` file to add, remove, or update required and optional dependencies, run the following command to re-generate the `environment.conda-lock.yml` and `environment.*.lock` files.
5048

5149
```
5250
make all
5351
```
52+
53+
54+
[Anaconda]: https://www.anaconda.com/
55+
[Mambaforge]: https://mamba.readthedocs.io/en/latest/installation.html
56+
[Miniconda]: https://docs.conda.io/en/latest/miniconda.html
57+
[conda-devenv]: https://conda-devenv.readthedocs.io/en/latest/
58+
[conda-lock]: https://conda-incubator.github.io/conda-lock/

0 commit comments

Comments
 (0)