Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# -- Imports --------------------------------------------------------------

import logging
import json
import os
import re
from datetime import datetime
Expand Down Expand Up @@ -267,13 +268,29 @@ def get_supported_python_versions(project_name):
max_python_version = max(napari_supported_python_versions)

version_string = '.'.join(str(x) for x in __version_tuple__[:3])

def _stable_version_from_switcher() -> str:
"""Return the stable docs version advertised in the version switcher."""
switcher_path = Path(__file__).parent / '_static' / 'version_switcher.json'
switcher_entries = json.loads(switcher_path.read_text(encoding='utf-8'))
return next(
entry['version']
for entry in switcher_entries if entry.get('preferred')
)

bundle_version = (
_stable_version_from_switcher()
if napari_version.is_prerelease
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if napari_version.is_prerelease
if napari_version.is_devrelease

napari==0.7.1a2 is prerelease, but not devrelease

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with this current code we want 0.7.1a2 to point to 0.7.0, not the pre-release bundle (even though that was the original goal), so we want to use is_prerelease.

But you are right, if we do is_devrelease than I think 0.7.1a2 would point to the 0.7.1a2 bundle.

Can you confirm this logic?

Copy link
Copy Markdown
Contributor

@willingc willingc Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimMonko I believe that if you want to use the stable version to avoid confusion for end users (i.e. dev docs version will always display the stable bundle) then we should be using bundle_version is stable_version = _stable_version_from_switcher().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willingc can you check the logic I have in the description? #973 (comment)
A new stable release would not have the version_switcher updated, so if we did just that then it would be one version behind on each stable release.
But, admittedly, my brain is struggling to wrap up the logic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, the getting version from switcher will provide wrong version during deploy stable docs.

And there are two paths. User is opening napari.org/dev then we might want to provide stable release.

But when user enter napari.org/0.7.1 when 0.7.1 is not released yet, but have some alpha or beta then it should link to latest bundle, even alpha one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have decided in today's docs meeting that we want the dev docs to always point to the latest stable release, not alphas or rcs.

else version_string
)
# when updating the version below, ensure to also update napari/napari README
python_version = '3.11'
python_version_range = f'{min_python_version}-{max_python_version}'

myst_substitutions = {
'napari_conda_version': f'`napari={version_string}`',
'napari_version': version_string,
'bundle_version': bundle_version,
'release': release,
'python_version': python_version,
'python_version_range': python_version_range,
Expand Down
29 changes: 17 additions & 12 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,52 +255,54 @@ pip install napari[pyqt6, optional] -c constraints_py3.10.txt

napari can be installed as a standalone application on macOS, Windows, and Linux — no Python knowledge required. This is the simplest way to get started and works best if you want to use napari as a standalone GUI app. Note that some plugins may not be available without a full Python environment.

Select your platform below to download napari {{ release }} directly:
Select your platform below to download napari {{ bundle_version }} directly:

````{grid} 1 2 2 4
:gutter: 2

```{grid-item-card} Windows
:text-align: center

{{ '[Download (.exe)](https://github.com/napari/napari/releases/download/vREL/napari-REL-Windows-x86_64.exe)'.replace('REL', release) }}
{{ '[Download (.exe)](https://github.com/napari/napari/releases/download/vREL/napari-REL-Windows-x86_64.exe)'.replace('REL', bundle_version) }}
+++
{ref}`Installation steps <windows-bundle>`
```

```{grid-item-card} macOS Apple Silicon (arm64)
```{grid-item-card} macOS Apple Silicon (ARM)
:text-align: center

{{ '[Download (.pkg)](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-arm64.pkg)'.replace('REL', release) }}
{{ '[Download (.pkg)](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-arm64.pkg)'.replace('REL', bundle_version) }}
+++
{ref}`Installation steps <macos-bundle>`
```

```{grid-item-card} macOS Intel (x86_64)
:text-align: center

{{ '[Download (.pkg)](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-x86_64.pkg)'.replace('REL', release) }}
{{ '[Download (.pkg)](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-x86_64.pkg)'.replace('REL', bundle_version) }}
+++
{ref}`Installation steps <macos-bundle>`
```

```{grid-item-card} Linux
:text-align: center

{{ '[Download (.sh)](https://github.com/napari/napari/releases/download/vREL/napari-REL-Linux-x86_64.sh)'.replace('REL', release) }}
{{ '[Download (.sh)](https://github.com/napari/napari/releases/download/vREL/napari-REL-Linux-x86_64.sh)'.replace('REL', bundle_version) }}
+++
{ref}`Installation steps <linux-bundle>`
```

````

For earlier versions of the napari app, scroll below the latest release on the [napari GitHub releases page](https://github.com/napari/napari/releases). Each release (0.4.15 and above) includes installers for all platforms under the "Assets" section.
For pre-release versions or earlier stable versions of the napari app,
scroll below the latest release on the [napari GitHub releases page](https://github.com/napari/napari/releases).
Each release (0.4.15 and above) includes installers for all platforms under the "Assets" section.

(windows-bundle)=

### Windows

Download from Github: {{ '[napari-REL-Windows-x86_64.exe](https://github.com/napari/napari/releases/download/vREL/napari-REL-Windows-x86_64.exe)'.replace('REL', release) }}
Download from GitHub: {{ '[napari-REL-Windows-x86_64.exe](https://github.com/napari/napari/releases/download/vREL/napari-REL-Windows-x86_64.exe)'.replace('REL', bundle_version) }}

Double-click the downloaded `.exe` file to begin setup.

Expand Down Expand Up @@ -336,10 +338,13 @@ Next, check out our [tutorial on the viewer](viewer-tutorial) or explore the [Us

### macOS

Download the installer for your Mac:
Download the installer for your Mac. If you are unsure which version to choose,
check "About this Mac" from the Apple menu or check the
[official Apple documentation](https://support.apple.com/en-us/116943)
to identify if your machine is Apple Silicon (ARM).

- {{ '[napari-REL-macOS-arm64.pkg](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-arm64.pkg)'.replace('REL', release) }} — Apple Silicon (M1 and later)
- {{ '[napari-REL-macOS-x86_64.pkg](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-x86_64.pkg)'.replace('REL', release) }} — Intel
- {{ '[napari-REL-macOS-arm64.pkg](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-arm64.pkg)'.replace('REL', bundle_version) }} — Apple Silicon (ARM)
- {{ '[napari-REL-macOS-x86_64.pkg](https://github.com/napari/napari/releases/download/vREL/napari-REL-macOS-x86_64.pkg)'.replace('REL', bundle_version) }} — Intel

Double-click the downloaded `.pkg` file to launch the Installer.

Expand Down Expand Up @@ -383,7 +388,7 @@ Next, check out our [tutorial on the viewer](viewer-tutorial) or explore the [Us

### Linux

Download from Github: {{ '[napari-REL-Linux-x86_64.sh](https://github.com/napari/napari/releases/download/vREL/napari-REL-Linux-x86_64.sh)'.replace('REL', release) }}
Download from GitHub: {{ '[napari-REL-Linux-x86_64.sh](https://github.com/napari/napari/releases/download/vREL/napari-REL-Linux-x86_64.sh)'.replace('REL', bundle_version) }}

Open a terminal, navigate to your downloads folder (`cd ~/Downloads`), and run:

Expand Down
Loading