Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda-lock to example #54

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d063a83
Add `conda-lock` to example
basnijholt Dec 7, 2023
0198b7d
chore(docs): update TOC
basnijholt Dec 7, 2023
655b6ff
Install conda-lock
basnijholt Dec 7, 2023
3f54e05
Merge 655b6ff9e1151af29ca84557cffc44cddbe5e91d into 779ba0f7384f66987…
basnijholt Dec 7, 2023
5cf5214
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
a5ee3df
Install setuptools
basnijholt Dec 7, 2023
f545f8b
Add --check-input-hash
basnijholt Dec 7, 2023
edd6ef2
Merge f545f8baea5d8a693f0158e0166df8b1886b563e into 779ba0f7384f66987…
basnijholt Dec 7, 2023
b2a6705
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
11f76e5
Add --skip-global
basnijholt Dec 7, 2023
0a9a24e
Rephrase
basnijholt Dec 7, 2023
1fbaddc
Merge 0a9a24ea3724a8a3b93ec1a0414a54956cf32c67 into 779ba0f7384f66987…
basnijholt Dec 7, 2023
25d3972
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
c6d52de
Add lock files
basnijholt Dec 7, 2023
b28c80a
Use --skip-global
basnijholt Dec 7, 2023
555c492
Merge b28c80af48f0568fee3b621b6d32409016558998 into 779ba0f7384f66987…
basnijholt Dec 7, 2023
71895a3
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
35abbae
Bad idea
basnijholt Dec 7, 2023
39c25bf
Merge 35abbaee1f7cf7efed2d70b5550de34edc9763cf into 779ba0f7384f66987…
basnijholt Dec 7, 2023
cd07c98
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
5fd71df
fix test
basnijholt Dec 7, 2023
0580ad1
Merge 5fd71dfeeaf7631afd037caf2b6076a5038b7efc into 779ba0f7384f66987…
basnijholt Dec 7, 2023
43847eb
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
e9dd46d
Undo bad idea
basnijholt Dec 7, 2023
0b8ae13
Merge e9dd46dbd7dd3cfda052128d525a296f0ed406a0 into 779ba0f7384f66987…
basnijholt Dec 7, 2023
814ab0d
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
8a661f2
update env
basnijholt Dec 7, 2023
0ff9098
rm
basnijholt Dec 7, 2023
aa86dfc
use --check-input-hash
basnijholt Dec 7, 2023
d2aeb08
Merge aa86dfcd0556d2c5fbe8f647a7600d839bd61edf into 779ba0f7384f66987…
basnijholt Dec 7, 2023
da12623
Update files from markdown-code-runner
github-actions[bot] Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install markdown-code-runner
pip install -e .
pip install -e ".[conda-lock]" setuptools

- name: Run markdown-code-runner
run: |
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ See `unidep conda -h` for more information:
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
```bash
usage: unidep conda-lock [-h] [--only-global] [--check-input-hash]
[-d DIRECTORY] [-v]
[--skip-global] [-d DIRECTORY] [-v]
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
[--depth DEPTH]

Expand All @@ -432,6 +432,9 @@ options:
--check-input-hash Check existing input hashes in lockfiles before
regenerating lock files. This flag is directly passed
to `conda-lock`.
--skip-global Skip the call to `conda-lock`, only regenerate the sub
`conda-lock.yml` files. Requires the global `conda-
lock.yml` file to already exist.
-d DIRECTORY, --directory DIRECTORY
Base directory to scan for `requirements.yaml`
file(s), by default `.`
Expand Down
25 changes: 25 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Combine one or multiple `requirements.yaml` files into a single `environment.yaml` file](#combine-one-or-multiple-requirementsyaml-files-into-a-single-environmentyaml-file)
- [Install a `requirements.yaml` file directly with `pip`](#install-a-requirementsyaml-file-directly-with-pip)
- [Install a `requirements.yaml` file directly with `unidep`](#install-a-requirementsyaml-file-directly-with-unidep)
- [Create a global `conda-lock.yml` and per project `conda-lock.yml` files](#create-a-global-conda-lockyml-and-per-project-conda-lockyml-files)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -81,3 +82,27 @@ Just run `unidep install ./project1` or `unidep install -e ./project1` for an ed
```

<!-- OUTPUT:END -->

## Create a global `conda-lock.yml` and per project `conda-lock.yml` files

Using `unidep conda-lock` we can create a global `conda-lock.yml` file and per project `conda-lock.yml` files that are consistent with the global lock file.

<!-- CODE:BASH:START -->
<!-- echo '```bash' -->
<!-- unidep conda-lock --check-input-hash -->
<!-- echo '```' -->
<!-- CODE:END -->
<!-- OUTPUT:START -->
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
```bash
✅ Generated environment file at `tmp.environment.yaml` from `project1/requirements.yaml`, `project2/requirements.yaml`, `project3/requirements.yaml`
🔒 Locking dependencies with `conda-lock lock --file tmp.environment.yaml --lockfile conda-lock.yml --check-input-hash`

✅ Global dependencies locked successfully in `conda-lock.yml`.
📝 Generated lock file for `project1/requirements.yaml`: `project1/conda-lock.yml`
📝 Generated lock file for `project2/requirements.yaml`: `project2/conda-lock.yml`
📝 Generated lock file for `project3/requirements.yaml`: `project3/conda-lock.yml`
✅ Analyzed all lock files and found no inconsistencies.
```

<!-- OUTPUT:END -->
Loading