diff --git a/.github/workflows/make_bundle_conda.yml b/.github/workflows/make_bundle_conda.yml index 271c0091..85d7591c 100644 --- a/.github/workflows/make_bundle_conda.yml +++ b/.github/workflows/make_bundle_conda.yml @@ -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: | @@ -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": []} @@ -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 @@ -544,6 +534,7 @@ 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" @@ -551,12 +542,15 @@ jobs: 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 @@ -565,6 +559,8 @@ 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' @@ -572,9 +568,12 @@ jobs: 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'))" diff --git a/build_installers.py b/build_installers.py index f9413936..3b853867 100644 --- a/build_installers.py +++ b/build_installers.py @@ -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: @@ -216,6 +217,7 @@ 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 { @@ -223,8 +225,9 @@ def _napari_env( # "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", @@ -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"], @@ -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 diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml deleted file mode 100644 index 0cb43129..00000000 --- a/conda-recipe/conda_build_config.yaml +++ /dev/null @@ -1,3 +0,0 @@ -qt_bindings: - - pyside2 - - pyqt diff --git a/conda-recipe/conda_menu_config.json b/conda-recipe/conda_menu_config.json new file mode 100644 index 00000000..579de9c9 --- /dev/null +++ b/conda-recipe/conda_menu_config.json @@ -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" + ] + } + } + } + ] +} diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 0f8786de..06911415 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -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: @@ -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 @@ -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: @@ -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"