Skip to content

Commit

Permalink
Constrain dependencies in installer's base env more strictly (#187)
Browse files Browse the repository at this point in the history
* Fix base env dependencies

* add more tests

* pin in the napari env too

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Do not pin mamba

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jaimergp and pre-commit-ci[bot] authored Sep 30, 2024
1 parent 76225f3 commit 03b8872
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/make_bundle_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,11 @@ jobs:
bash napari-${{ env.version }}-${{ runner.os }}-${{ env.arch-suffix }}.${{ env.extension }} -bfp "${{ runner.temp }}/napari-${{ env.version }}"
. "${{ runner.temp }}/napari-${{ env.version }}/etc/profile.d/conda.sh"
conda activate "${{ runner.temp }}/napari-${{ env.version }}/envs/napari-${{ env.version }}"
conda info
conda config --show-sources
conda config --show
conda list -p "${{ runner.temp }}/napari-${{ env.version }}"
conda list -p "${{ runner.temp }}/napari-${{ env.version }}/envs/napari-${{ env.version }}"
xvfb-run --auto-servernum napari --info
# Test shortcut
python -c "import pathlib as p; assert list(p.Path('~/.local/share/applications/').expanduser().glob('napari*.desktop'))"
Expand All @@ -563,8 +566,11 @@ jobs:
installer -pkg napari-${{ env.version }}-${{ runner.os }}-${{ env.arch-suffix }}.${{ env.extension }} -target CurrentUserHomeDirectory -dumplog
. "/Users/runner/Library/napari-${{ env.version }}/etc/profile.d/conda.sh"
conda activate "/Users/runner/Library/napari-${{ env.version }}/envs/napari-${{ env.version }}"
conda info
conda config --show-sources
conda config --show
conda list -p "/Users/runner/Library/napari-${{ env.version }}"
conda list -p "/Users/runner/Library/napari-${{ env.version }}/envs/napari-${{ env.version }}"
napari --info
# Test shortcut
python -c "import pathlib as p; assert list(p.Path('~/Applications').expanduser().glob('napari*.app'))"
Expand All @@ -578,8 +584,11 @@ jobs:
run: |
cmd.exe /c start /wait napari-${{ env.version }}-${{ runner.os }}-${{ env.arch-suffix }}.${{ env.extension }} /S /D=${{ runner.temp }}\napari-${{ env.version }}
CALL ${{ runner.temp }}\napari-${{ env.version }}\Scripts\activate ${{ runner.temp }}\napari-${{ env.version }}\envs\napari-${{ env.version }}
CALL conda info
CALL conda config --show-sources
CALL conda config --show
CALL conda list -p ${{ runner.temp }}\napari-${{ env.version }}
CALL conda list -p ${{ runner.temp }}\napari-${{ env.version }}\envs\napari-${{ env.version }}
napari --info
:: Test shortcut
python -c "import pathlib as p; assert list(p.Path('%PROGRAMDATA%\\Microsoft\\Windows\\Start Menu\\Programs').glob('napari*\\napari*.lnk'))"
19 changes: 11 additions & 8 deletions build_installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
else:
raise RuntimeError(f"Unrecognized OS: {sys.platform}")

CONDA_TOOL_DEPS = (
"conda >=23.10",
"conda-libmamba-solver",
"mamba",
"pip",
)


def _use_local():
"""
Expand Down Expand Up @@ -215,9 +222,7 @@ def _base_env(python_version=PY_VER):
],
"specs": [
f"python={python_version}.*=*_cpython",
"conda",
"mamba",
"pip",
*CONDA_TOOL_DEPS,
],
}

Expand All @@ -237,11 +242,9 @@ def _napari_env(
f"napari-menu={napari_version}",
"napari-plugin-manager",
f"pyside2={pyside_version}",
"conda",
"mamba",
"pip",
]
+ (extra_specs or []),
*CONDA_TOOL_DEPS,
*(extra_specs or ()),
],
# "exclude": exclude, # TODO: not supported yet in constructor
}

Expand Down

0 comments on commit 03b8872

Please sign in to comment.