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

Updates for new pkgs #77

Merged
merged 22 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/workflows/make_bundle_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,12 @@ jobs:
git diff
mv ${GITHUB_WORKSPACE}/napari-source .

- name: Run build scripts (PyQt)
- name: Run build scripts
shell: bash -el {0}
working-directory: napari-feedstock
env:
DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7
CONFIG: linux_64_qt_bindingspyqt # filename under feedstock's .ci_support/
CI: github_actions
CONDA_BLD_PATH: "${{ github.workspace }}${{ env.conda_bld_suffix }}"
run: |
export
./.scripts/run_docker_build.sh

- name: Run build scripts (PySide)
shell: bash -el {0}
working-directory: napari-feedstock
env:
DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7
CONFIG: linux_64_qt_bindingspyside2 # filename under feedstock's .ci_support/
CONFIG: linux_64_ # filename under feedstock's .ci_support/
CI: github_actions
CONDA_BLD_PATH: "${{ github.workspace }}${{ env.conda_bld_suffix }}"
run: |
Expand Down Expand Up @@ -217,7 +205,9 @@ jobs:
"target-platform": "win-64",
},
]
platforms_str = "${{ inputs.installer_platforms || 'linux-64,win-64,osx-64,osx-arm64' }}"
# TEMPORARY for 0.4.18 only
# platforms_str = "${{ inputs.installer_platforms || 'linux-64,win-64,osx-64,osx-arm64' }}"
platforms_str = 'linux-64,win-64,osx-64,osx-arm64'
platforms = {p.strip() for p in platforms_str.split(",")}

matrix = {"include": []}
Expand Down Expand Up @@ -327,7 +317,7 @@ jobs:
if [[ "$host_platform" != "$CONSTRUCTOR_TARGET_PLATFORM" ]]; then
prefix="${RUNNER_TEMP}/conda-exe-${CONSTRUCTOR_TARGET_PLATFORM}"
CONDA_SUBDIR=$CONSTRUCTOR_TARGET_PLATFORM \
conda create -yq -p "${prefix}" -c napari/label/bundle_tools_2 conda-standalone
conda create -yq -p "${prefix}" -c napari/label/bundle_tools_3 conda-standalone
echo "CONSTRUCTOR_CONDA_EXE=${prefix}/standalone_conda/conda.exe" >> $GITHUB_ENV
fi

Expand Down Expand Up @@ -544,19 +534,23 @@ jobs:
working-directory: napari-packaging/_work
env:
CONDA_EXPERIMENTAL_SOLVER: classic
MENUINST_DEBUG: 1
run: |
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 config --show-sources
conda config --show
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'))"

- name: Test installation (macOS)
if: runner.os == 'macOS' && matrix.target-platform == 'osx-64'
working-directory: napari-packaging/_work
env:
CONDA_EXPERIMENTAL_SOLVER: classic
MENUINST_DEBUG: 1
run: |
set -x
installer -pkg napari-${{ env.version }}-${{ runner.os }}-${{ env.arch-suffix }}.${{ env.extension }} -target CurrentUserHomeDirectory -dumplog
Expand All @@ -565,16 +559,21 @@ jobs:
conda config --show-sources
conda config --show
napari --info
# Test shortcut
python -c "import pathlib as p; assert list(p.Path('~/Applications').expanduser().glob('napari*.app'))"

- name: Test installation (Windows)
if: runner.os == 'Windows'
shell: cmd /C call {0}
working-directory: napari-packaging/_work
env:
CONDA_EXPERIMENTAL_SOLVER: classic
MENUINST_DEBUG: 1
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 config --show-sources
CALL conda config --show
napari --info
:: Test shortcut
python -c "import pathlib as p; assert list(p.Path('%PROGRAMDATA%\\Microsoft\\Windows\\Start Menu\\Programs').glob('napari*\\napari*.lnk'))"
7 changes: 6 additions & 1 deletion build_installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
ARCH = (platform.machine() or "generic").lower().replace("amd64", "x86_64")
TARGET_PLATFORM = os.environ.get("CONSTRUCTOR_TARGET_PLATFORM")
PY_VER = f"{sys.version_info.major}.{sys.version_info.minor}"
PYSIDE_VER = os.environ.get("CONSTRUCTOR_PYSIDE_VER", "*")
if WINDOWS:
EXT, OS = "exe", "Windows"
elif LINUX:
Expand Down Expand Up @@ -216,15 +217,17 @@ def _base_env(python_version=PY_VER):
def _napari_env(
python_version=PY_VER,
napari_version=_version(),
pyside_version=PYSIDE_VER,
extra_specs=None,
):
return {
"name": f"napari-{napari_version}",
# "channels": same as _base_env(), omit to inherit :)
"specs": [
f"python={python_version}.*=*_cpython",
f"napari={napari_version}=*pyside*",
f"napari={napari_version}",
f"napari-menu={napari_version}",
f"pyside2={pyside_version}",
"conda",
"mamba",
"pip",
Expand All @@ -250,6 +253,7 @@ def _definitions(version=_version(), extra_specs=None, napari_repo=HERE):
"channels": base_env["channels"],
"conda_default_channels": ["conda-forge"],
"installer_filename": OUTPUT_FILENAME,
"initialize_conda": False,
"initialize_by_default": False,
"license_file": os.path.join(resources, "bundle_license.rtf"),
"specs": base_env["specs"],
Expand Down Expand Up @@ -312,6 +316,7 @@ def _definitions(version=_version(), extra_specs=None, napari_repo=HERE):
"icon_image": os.path.join(
napari_repo, "napari", "resources", "icon.ico"
),
"register_python": False,
"register_python_default": False,
"default_prefix": os.path.join(
"%LOCALAPPDATA%", INSTALLER_DEFAULT_PATH_STEM
Expand Down
3 changes: 0 additions & 3 deletions conda-recipe/conda_build_config.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions conda-recipe/conda_menu_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://schemas.conda.io/menuinst-1.schema.json",
"menu_name": "napari (__PKG_VERSION__)",
"menu_items": [
{
"name": "napari (__PKG_VERSION__)",
"description": "a fast n-dimensional image viewer in Python",
"icon": "{{ MENU_DIR }}/napari.{{ ICON_EXT }}",
"precommand": "unset PYTHONHOME && unset PYTHONPATH",
"command": [
"{{ PYTHON }}",
"-m",
"napari"
],
"activate": true,
"terminal": false,
"platforms": {
"win": {
"precommand": "set \"PYTHONHOME=\" & set \"PYTHONPATH=\"",
"desktop": true,
"app_user_model_id": "napari.napari.viewer.__PKG_VERSION__"
},
"linux": {
"Categories": [
"Graphics",
"Science"
],
"StartupWMClass": "napari"
},
"osx": {
"link_in_bundle": {
"{{ PREFIX }}/bin/python": "{{ MENU_ITEM_LOCATION }}/Contents/Resources/python"
},
"command": ["{{ MENU_ITEM_LOCATION }}/Contents/Resources/python", "-m", "napari"],
"CFBundleName": "napari",
"CFBundleDisplayName": "napari",
"CFBundleVersion": "__PKG_VERSION__",
"entitlements": [
"com.apple.security.files.user-selected.read-write",
"com.apple.security.files.downloads.read-write",
"com.apple.security.assets.pictures.read-write",
"com.apple.security.assets.music.read-write",
"com.apple.security.assets.movies.read-write"
]
}
}
}
]
}
29 changes: 13 additions & 16 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ outputs:
build:
noarch: python
number: {{ build }}
string: pyh{{ PKG_HASH }}_{{ build }}_{{ qt_bindings }}
script: PIP_NO_INDEX=True PIP_NO_DEPENDENCIES=True PIP_NO_BUILD_ISOLATION=False PIP_IGNORE_INSTALLED=True PYTHONDONTWRITEBYTECODE=True {{ PREFIX }}/bin/python -m pip install . -vv
entry_points:
- napari = napari.__main__:main
# de-prioritize pyside so pyqt gets installed by default if unspecified
track_features: # [qt_bindings == 'pyside2']
- napari_pyside2 # [qt_bindings == 'pyside2']

requirements:
build:
Expand All @@ -39,34 +35,34 @@ outputs:
- python >=3.8

# dependencies matched to setup.cfg
- app-model >=0.1.2,<0.3.0
- app-model >=0.1.0,<0.3.0a
- appdirs >=1.4.4
- cachey >=0.2.1
- certifi >=2020.6.20
- dask >=2.15.0,!=2.28.0
- imageio >=2.5.0,!=2.11.0,!=2.22.1
- imageio >=2.20,!=2.22.1
- jsonschema >=3.2.0
- lazy_loader>=0.2
- lazy_loader >=0.2
- magicgui >=0.3.6
- napari-console >=0.0.6
- napari-plugin-engine >=0.1.9
- napari-svg >=0.1.7
- npe2 >=0.5.2
- numpy >=1.20
- numpy >=1.21
- numpydoc >=0.9.2
- pandas >=1.3.0
- pillow !=7.1.0,!=7.1.1
- pint >=0.17
- psutil >=5.0
- psygnal>=0.3.4
- pydantic >=1.9.0
- pygments >=2.4.0
- pydantic >=1.9.0,<2.0a0
- pygments >=2.6.0
- pyopengl >=3.1.0
- pyyaml >=5.1
- qtpy >=1.10.0
- scikit-image >=0.19.1
- scipy >=1.5.4
- sphinx <5
- sphinx >=4.3.0,<5
- superqt >=0.4.1
- tifffile >=2020.2.16
- toolz >=0.10.0
Expand All @@ -80,9 +76,9 @@ outputs:
- pooch >=1.3.0
- zarr

# variants
- pyside2 >=5.13.2,!=5.15.0 # [qt_bindings == 'pyside2']
- pyqt >=5.12.3,!=5.15.0 # [qt_bindings == 'pyqt']
run_constrained:
- pyside2 >=5.14.2,!=5.15.0
- pyqt >=5.12.3,!=5.15.0

test:
requires:
Expand Down Expand Up @@ -125,11 +121,12 @@ outputs:
version: {{ version }}
build:
noarch: python
skip: true # [qt_bindings == 'pyside2']
number: {{ build }}
script:
- mkdir -p "${PREFIX}/Menu"
- sed "s/__PKG_VERSION__/{{ PKG_VERSION }}/" "{{ SRC_DIR }}/resources/conda_menu_config.json" > "{{ PREFIX }}/Menu/napari-menu.json"
# - sed "s/__PKG_VERSION__/{{ PKG_VERSION }}/" "{{ SRC_DIR }}/resources/conda_menu_config.json" > "{{ PREFIX }}/Menu/napari-menu.json"
# TEMPORARY, revert after 0.4.18
- sed "s/__PKG_VERSION__/{{ PKG_VERSION }}/" "{{ RECIPE_DIR }}/conda_menu_config.json" > "{{ PREFIX }}/Menu/napari-menu.json"
- cp "{{ SRC_DIR }}/napari/resources/logo.png" "{{ PREFIX }}/Menu/napari.png"
- cp "{{ SRC_DIR }}/napari/resources/icon.icns" "{{ PREFIX }}/Menu/napari.icns"
- cp "{{ SRC_DIR }}/napari/resources/icon.ico" "{{ PREFIX }}/Menu/napari.ico"
Expand Down