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

Abstract miniconda.rst template #869

Merged
merged 4 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
109 changes: 83 additions & 26 deletions docs/source/create_miniconda_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
NOTE: Please make sure to update the global variables below:
- MINICONDA_VERSION
- PYTHON_VERSION
- RELEASE_DATE

NOTE: Also confirm the PLATFORM_MAP is up-to-date.

NOTE: If a new Python variant has been built out, please update the tuple
below for 'py_version'.
"""

import datetime
import urllib.request
import json

Expand All @@ -26,20 +26,62 @@
# Update these!
MINICONDA_VERSION = "23.3.1-0"
PYTHON_VERSION = "3.10.10" # This is the version of Python that's bundled into the Miniconda installers.
RELEASE_DATE = "April 24, 2023"
# Must be sorted in the order in which they appear on the Miniconda page
OPERATING_SYSTEMS = ("Windows", "macOS", "Linux")
PY_VERSIONS = ("3.10", "3.9", "3.8")

# Confirm these are up-to-date.
PLATFORM_MAP = {
"win64": "Windows-x86_64.exe",
"win32": "Windows-x86.exe",
"osx64_sh": "MacOSX-x86_64.sh",
"osx64_pkg": "MacOSX-x86_64.pkg",
"osx_arm64_sh": "MacOSX-arm64.sh",
"osx_arm64_pkg": "MacOSX-arm64.pkg",
"linux64": "Linux-x86_64.sh",
"linux_aarch64": "Linux-aarch64.sh",
"linux_ppc64le": "Linux-ppc64le.sh",
"linux_s390x": "Linux-s390x.sh",
"win64": {
"operating_system": "Windows",
"suffix": "Windows-x86_64.exe",
"description": "Windows 64-bit",
},
"win32": {
"operating_system": "Windows",
"suffix": "Windows-x86.exe",
"description": "Windows 32-bit",
},
"osx64_sh": {
"operating_system": "macOS",
"suffix": "MacOSX-x86_64.sh",
"description": "macOS Intel x86 64-bit bash",
},
"osx64_pkg": {
"operating_system": "macOS",
"suffix": "MacOSX-x86_64.pkg",
"description": "macOS Intel x86 64-bit pkg",
},
"osx_arm64_sh": {
"operating_system": "macOS",
"suffix": "MacOSX-arm64.sh",
"description": "macOS Apple M1 64-bit bash",
},
"osx_arm64_pkg": {
"operating_system": "macOS",
"suffix": "MacOSX-arm64.pkg",
"description": "macOS Apple M1 64-bit pkg",
},
"linux64": {
"operating_system": "Linux",
"suffix": "Linux-x86_64.sh",
"description": "Linux 64-bit",
},
"linux_aarch64": {
"operating_system": "Linux",
"suffix": "Linux-aarch64.sh",
"description": "Linux-aarch64 64-bit",
},
"linux_ppc64le": {
"operating_system": "Linux",
"suffix": "Linux-ppc64le.sh",
"description": "Linux-ppc64le 64-bit",
},
"linux_s390x": {
"operating_system": "Linux",
"suffix": "Linux-s390x.sh",
"description": "Linux-s390x 64-bit",
},
}


Expand All @@ -63,25 +105,40 @@ def get_latest_miniconda_sizes_and_hashes():
"miniconda_version": MINICONDA_VERSION,
"conda_version": MINICONDA_VERSION.split("-")[0],
"python_version": PYTHON_VERSION,
"release_date": RELEASE_DATE
"operating_systems": OPERATING_SYSTEMS,
"py_versions": PY_VERSIONS,
}

for platform_id, installer_suffix in PLATFORM_MAP.items():
latest_installer = f"Miniconda3-latest-{installer_suffix}"
info[f"{platform_id}_py3_latest_size"] = sizeof_fmt(data[latest_installer]["size"])
info[f"{platform_id}_py3_latest_hash"] = data[latest_installer]["sha256"]
for py_version in ("38", "39", "310"):
full_installer = f"Miniconda3-py{py_version}_{MINICONDA_VERSION}-{installer_suffix}"

# win-32 is and will remain at "frozen" at v4.12.0
info["platforms"] = {(os,"latest"): [] for os in info["operating_systems"]}

for platform_id, installer_data in PLATFORM_MAP.items():
latest_installer = f"Miniconda3-latest-{installer_data['suffix']}"
if "release_date" not in info:
mtime = data[latest_installer]["mtime"]
mdate = datetime.date.fromtimestamp(mtime)
info["release_date"] = mdate.strftime("%B %-d, %Y")
os = installer_data["operating_system"]
info["platforms"][os,"latest"].append(installer_data.copy())
info["platforms"][os,"latest"][-1]["hash"] = data[latest_installer]["sha256"]
for py_version in info["py_versions"]:
py = py_version.replace(".", "")
full_installer = (
f"Miniconda3-py{py}_{MINICONDA_VERSION}-{installer_data['suffix']}"
)

# win-32 is and will remain at "frozen" at v4.12.0
# (we no longer make new builds for this subdir)
if platform_id == "win32":
full_installer = f"Miniconda3-py{py_version}_4.12.0-{installer_suffix}"
full_installer = f"Miniconda3-py{py}_4.12.0-{installer_data['suffix']}"

if full_installer not in data:
continue
info[f"{platform_id}_py{py_version}_size"] = sizeof_fmt(data[full_installer]["size"])
info[f"{platform_id}_py{py_version}_hash"] = data[full_installer]["sha256"]
if (os, py_version) not in info["platforms"]:
info["platforms"][os,py_version] = [installer_data.copy()]
else:
info["platforms"][os,py_version].append(installer_data.copy())
installer = info["platforms"][os,py_version][-1]
installer["size"] = sizeof_fmt(data[full_installer]["size"])
installer["hash"] = data[full_installer]["sha256"]

return info

Expand All @@ -94,7 +151,7 @@ def main():

template = Template(template_text)
rst_text = template.render(**rst_vars)
with open(OUT_FILENAME, 'w') as f:
with open(OUT_FILENAME, "w") as f:
f.write(rst_text)


Expand Down
18 changes: 9 additions & 9 deletions docs/source/miniconda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,29 @@ Windows installers

Python 3.10,`Miniconda3 Windows 64-bit <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe>`_,53.9 MiB,``307194e1f12bbeb52b083634e89cc67db4f7980bd542254b43d3309eaf7cb358``
Python 3.9,`Miniconda3 Windows 64-bit <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-Windows-x86_64.exe>`_,53.7 MiB,``155958e7922d8b7aa6cb3115aeb66d2efcdae1237a6f1c11e23ca75ea96d291a``
,`Miniconda3 Windows 32-bit <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-Windows-x86.exe>`_,67.8 MiB,``4fb64e6c9c28b88beab16994bfba4829110ea3145baa60bda5344174ab65d462``
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we're missing the Python version at the beginning of these additions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct. It will end up looking like the macOS installers: https://docs.conda.io/en/latest/miniconda.html#macos-installers

Right now, Windows is the only platform that doesn't sort by python version, but by platform, which is inconsistent.

To be honest, I wouldn't be against removing win-32 entirely. It hasn't been supported in a while.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, gotcha. I forgot these lists were creating tables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did just notice that the Miniconda version for win-32 was not correct though. I fixed that part.

Python 3.8,`Miniconda3 Windows 64-bit <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-Windows-x86_64.exe>`_,53.1 MiB,``f567b46b2312af5e60ec8f45daf9be626295b7716651e6e7434c447feea9123a``
Python 3.9,`Miniconda3 Windows 32-bit <https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Windows-x86.exe>`_,67.8 MiB,``4fb64e6c9c28b88beab16994bfba4829110ea3145baa60bda5344174ab65d462``
Python 3.8,`Miniconda3 Windows 32-bit <https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Windows-x86.exe>`_,66.8 MiB,``60cc5874b3cce9d80a38fb2b28df96d880e8e95d1b5848b15c20f1181e2807db``
,`Miniconda3 Windows 32-bit <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-Windows-x86.exe>`_,66.8 MiB,``60cc5874b3cce9d80a38fb2b28df96d880e8e95d1b5848b15c20f1181e2807db``

macOS installers
=================
================

.. csv-table:: macOS
:header: Python version,Name,Size,SHA256 hash
:widths: 5, 10, 5, 80

Python 3.10,`Miniconda3 macOS Intel x86 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-x86_64.sh>`_,44.1 MiB,``5abc78b664b7da9d14ade330534cc98283bb838c6b10ad9cfd8b9cc4153f8104``
,`Miniconda3 macOS Intel x86 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-x86_64.pkg>`_,43.8 MiB,``cca31a0f1e5394f2b739726dc22551c2a19afdf689c13a25668887ba706cba58``
,`Miniconda3 macOS Apple M1 ARM 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.sh>`_,42.6 MiB,``9d1d12573339c49050b0d5a840af0ff6c32d33c3de1b3db478c01878eb003d64``
,`Miniconda3 macOS Apple M1 ARM 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.pkg>`_,42.3 MiB,``6997472c5ff90a772eb77e6397f4e3e227736c83a7f7b839da33d6cc7facb75d``
,`Miniconda3 macOS Apple M1 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.sh>`_,42.6 MiB,``9d1d12573339c49050b0d5a840af0ff6c32d33c3de1b3db478c01878eb003d64``
,`Miniconda3 macOS Apple M1 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-MacOSX-arm64.pkg>`_,42.3 MiB,``6997472c5ff90a772eb77e6397f4e3e227736c83a7f7b839da33d6cc7facb75d``
Python 3.9,`Miniconda3 macOS Intel x86 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-x86_64.sh>`_,44.4 MiB,``54d739715feb0cd5c127865215cc9f50697709d71e9ee7da430576c5a1c8010d``
,`Miniconda3 macOS Intel x86 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-x86_64.pkg>`_,44.1 MiB,``6960a11f74a0717adaacdc979d1817f5d0e3612d2ef7a409d547fbeac6d58ed7``
,`Miniconda3 macOS Apple M1 ARM 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-arm64.sh>`_,43.0 MiB,``c74474bab188b8b3dcaf0f0ca52f5e0743591dbe171766016023d052acf96502``
,`Miniconda3 macOS Apple M1 ARM 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-arm64.pkg>`_,42.7 MiB,``9bc8a8fde9d01e26ee37a6611a92a66d36db66ff82e76bd4f18cb28cfbad7a1f``
,`Miniconda3 macOS Apple M1 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-arm64.sh>`_,43.0 MiB,``c74474bab188b8b3dcaf0f0ca52f5e0743591dbe171766016023d052acf96502``
,`Miniconda3 macOS Apple M1 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-MacOSX-arm64.pkg>`_,42.7 MiB,``9bc8a8fde9d01e26ee37a6611a92a66d36db66ff82e76bd4f18cb28cfbad7a1f``
Python 3.8,`Miniconda3 macOS Intel x86 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-x86_64.sh>`_,44.2 MiB,``eb7b2d285f6d3b7c9cde9576c8c647e70b65361426b0e0e069b4ab23ccbb79e2``
,`Miniconda3 macOS Intel x86 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-x86_64.pkg>`_,43.9 MiB,``23d6fa672be46632abd0bbed1f12ce9542a6cb4a38922dab503d9a6096d186d3``
,`Miniconda3 macOS Apple M1 ARM 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-arm64.sh>`_,42.9 MiB,``e0151c68f6a11a38b29c2f4a775bf6a22187fa2c8ca0f31930d69f2f013c0810``
,`Miniconda3 macOS Apple M1 ARM 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-arm64.pkg>`_,42.6 MiB,``6714fdefd12e1a65c7fd344f3829a4b054ae42d3d1368b07ceeab9dcc41ad48b``
,`Miniconda3 macOS Apple M1 64-bit bash <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-arm64.sh>`_,42.9 MiB,``e0151c68f6a11a38b29c2f4a775bf6a22187fa2c8ca0f31930d69f2f013c0810``
,`Miniconda3 macOS Apple M1 64-bit pkg <https://repo.anaconda.com/miniconda/Miniconda3-py38_23.3.1-0-MacOSX-arm64.pkg>`_,42.6 MiB,``6714fdefd12e1a65c7fd344f3829a4b054ae42d3d1368b07ceeab9dcc41ad48b``

Linux installers
================
Expand Down
Loading