Skip to content

Commit

Permalink
dynamically use version in binaries links (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Theophile-Varnier authored Feb 11, 2025
1 parent f4f722c commit 3a24f78
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ ignore =
per-file-ignores =
# __init__ files
dataset_product_mapping.py: E501
conf.py: E501
21 changes: 11 additions & 10 deletions conda_environment_sphinx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ dependencies:
- python==3.9.18
- pip
- pip:
- sphinx==7.4.7
- sphinx-click==6.0.0
- numpydoc==1.8.0
- sphinx-copybutton==0.5.2
- furo==2024.8.6
- myst_parser==3.0.1
- notebook==7.1.2
- ipywidgets==8.1.5
- matplotlib==3.9.2
- myst-nb==1.1.2
- sphinx==7.4.7
- sphinx-click==6.0.0
- numpydoc==1.8.0
- sphinx-copybutton==0.5.2
- furo==2024.8.6
- myst_parser==3.0.1
- notebook==7.1.2
- ipywidgets==8.1.5
- matplotlib==3.9.2
- myst-nb==1.1.2
- toml==0.10.2
14 changes: 14 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import toml
from sphinx.builders.html import StandaloneHTMLBuilder

data = toml.load("../pyproject.toml")

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
Expand All @@ -11,6 +14,7 @@
project = "Copernicus Marine Toolbox"
copyright = "2024, Mercator Ocean International"
author = "Mercator Ocean International"
version = data["project"]["version"]

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down Expand Up @@ -73,3 +77,13 @@
# https://myst-nb.readthedocs.io/en/latest/configuration.html#config-intro

nb_execution_mode = "off"

rst_epilog = """
.. |download_macos_arm64| replace:: `copernicusmarine_macos-arm64 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/v{0}/copernicusmarine_macos-arm64.cli>`__
.. |download_macos_x86| replace:: `copernicusmarine_macos-x86_64 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/v{0}/copernicusmarine_macos-x86_64.cli>`__
.. |download_linux_235| replace:: `copernicusmarine_linux <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/v{0}/copernicusmarine_linux-glibc-2.35.cli>`__
.. |download_linux_231| replace:: `copernicusmarine_linux_2.31 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/v{0}/copernicusmarine_linux-glibc-2.31.cli>`__
.. |download_windows| replace:: `copernicusmarine <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/v{0}/copernicusmarine.exe>`__
""".format(
version
)
10 changes: 5 additions & 5 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ In the `release page <https://github.com/mercator-ocean/copernicus-marine-toolbo

To download directly the latest stable releases:

- MacOS arm64: `copernicusmarine_macos-arm64 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/latest/copernicusmarine_macos-arm64.cli>`_
- MacOS x86_64: `copernicusmarine_macos-x86_64 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/latest/copernicusmarine_macos-x86_64.cli>`_
- Linux (with glibc 2.35): `copernicusmarine_linux <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/latest/copernicusmarine_linux-glibc-2.35.cli>`_
- Linux (with glibc 2.31): `copernicusmarine_linux_2.31 <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/latest/copernicusmarine_linux-glibc-2.31.cli>`_
- Windows: `copernicusmarine <https://github.com/mercator-ocean/copernicus-marine-toolbox/releases/download/latest/copernicusmarine.exe>`_
- MacOS arm64: |download_macos_arm64|
- MacOS x86_64: |download_macos_x86|
- Linux (with glibc 2.35): |download_linux_235|
- Linux (with glibc 2.31): |download_linux_231|
- Windows: |download_windows|


Once downloaded for the specific platform, you can use the Toolbox by running the binary as follows:
Expand Down

0 comments on commit 3a24f78

Please sign in to comment.