From 3a20ce755520ea4766c41a0b8cfe312d73ecd3d2 Mon Sep 17 00:00:00 2001 From: Alex Hedges Date: Fri, 17 Sep 2021 23:27:41 -0400 Subject: [PATCH 1/3] Add default verbosity to add_miniconda.py Required to prevent a crash when no verbosity given. --- plugins/python-build/scripts/add_miniconda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python-build/scripts/add_miniconda.py b/plugins/python-build/scripts/add_miniconda.py index fb52b3d2..23f3d017 100755 --- a/plugins/python-build/scripts/add_miniconda.py +++ b/plugins/python-build/scripts/add_miniconda.py @@ -250,7 +250,7 @@ if __name__ == "__main__": help="Do not write scripts, just report them to stdout", ) parser.add_argument( - "-v", "--verbose", action="count", + "-v", "--verbose", action="count", default=0, help="Increase verbosity of logging", ) parsed = parser.parse_args() From 8b07b92c3788889de66447da5574b7161fdc1c1a Mon Sep 17 00:00:00 2001 From: Alex Hedges Date: Sun, 19 Sep 2021 21:47:28 -0400 Subject: [PATCH 2/3] Support newer miniconda filenames --- plugins/python-build/scripts/add_miniconda.py | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/plugins/python-build/scripts/add_miniconda.py b/plugins/python-build/scripts/add_miniconda.py index 23f3d017..bed6f591 100755 --- a/plugins/python-build/scripts/add_miniconda.py +++ b/plugins/python-build/scripts/add_miniconda.py @@ -44,7 +44,7 @@ esac install_line_fmt = """ "{os}-{arch}" ) - install_script "Miniconda{suffix}-{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version} + install_script "Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version} ;; """.strip() @@ -126,17 +126,29 @@ class VersionStr(str): class MinicondaVersion(NamedTuple): suffix: Suffix version_str: VersionStr + py_version: Optional[PyVersion] @classmethod def from_str(cls, s): - miniconda_n, ver = s.split("-") - return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver)) + components = s.split("-") + if len(components) == 3: + miniconda_n, py_ver, ver = components + py_ver = PyVersion(f"py{py_ver.replace('.', '')}") + else: + miniconda_n, ver = components + py_ver = None + return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver) def to_filename(self): - return f"miniconda{self.suffix}-{self.version_str}" + if self.py_version: + return f"miniconda{self.suffix}-{self.py_version.version()}-{self.version_str}" + else: + return f"miniconda{self.suffix}-{self.version_str}" def default_py_version(self): - if self.suffix == Suffix.TWO: + if self.py_version: + return self.py_version + elif self.suffix == Suffix.TWO: return PyVersion.PY27 elif self.version_str.info() < (4, 7): # https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-python.html @@ -146,7 +158,7 @@ class MinicondaVersion(NamedTuple): def with_version_triple(self): return MinicondaVersion( - self.suffix, VersionStr.from_info(self.version_str.info()[:3]) + self.suffix, VersionStr.from_info(self.version_str.info()[:3]), self.py_version ) @@ -160,8 +172,13 @@ class MinicondaSpec(NamedTuple): @classmethod def from_filestem(cls, stem, md5, py_version=None): miniconda_n, ver, os, arch = stem.split("-") + if ver.startswith("py"): + py_ver, ver = ver.split("_", maxsplit=1) + py_ver = PyVersion(py_ver) + else: + py_ver = None spec = MinicondaSpec( - MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver)), + MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver), SupportedOS(os), SupportedArch(arch), md5, @@ -175,6 +192,7 @@ class MinicondaSpec(NamedTuple): repo=MINICONDA_REPO, suffix=self.version.suffix, version_str=self.version.version_str, + version_py_version=f"{self.version.py_version}_" if self.version.py_version else "", os=self.os, arch=self.arch, md5=self.md5, From af55330d379ac827938f77a66b952c1ab52043b0 Mon Sep 17 00:00:00 2001 From: Alex Hedges Date: Sun, 19 Sep 2021 21:49:58 -0400 Subject: [PATCH 3/3] Add miniconda2-2.7-4.8.3, miniconda3-3.7-4.10.3, miniconda3-3.8-4.10.3, miniconda3-3.9-4.10.3 --- .../share/python-build/miniconda2-2.7-4.8.3 | 19 +++++++++++++++++++ .../share/python-build/miniconda3-3.7-4.10.3 | 19 +++++++++++++++++++ .../share/python-build/miniconda3-3.8-4.10.3 | 19 +++++++++++++++++++ .../share/python-build/miniconda3-3.9-4.10.3 | 19 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 plugins/python-build/share/python-build/miniconda2-2.7-4.8.3 create mode 100644 plugins/python-build/share/python-build/miniconda3-3.7-4.10.3 create mode 100644 plugins/python-build/share/python-build/miniconda3-3.8-4.10.3 create mode 100644 plugins/python-build/share/python-build/miniconda3-3.9-4.10.3 diff --git a/plugins/python-build/share/python-build/miniconda2-2.7-4.8.3 b/plugins/python-build/share/python-build/miniconda2-2.7-4.8.3 new file mode 100644 index 00000000..a459ffea --- /dev/null +++ b/plugins/python-build/share/python-build/miniconda2-2.7-4.8.3 @@ -0,0 +1,19 @@ +case "$(anaconda_architecture 2>/dev/null || true)" in +"Linux-ppc64le" ) + install_script "Miniconda2-py27_4.8.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-ppc64le.sh#120b300120b1362831f2075cc0bd452f" "miniconda" verify_py27 + ;; +"Linux-x86_64" ) + install_script "Miniconda2-py27_4.8.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-x86_64.sh#19ce7d0039ab349914d928e7f32b1c1b" "miniconda" verify_py27 + ;; +"MacOSX-x86_64" ) + install_script "Miniconda2-py27_4.8.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-MacOSX-x86_64.sh#14e2d294decc5a48a449b588f5819c10" "miniconda" verify_py27 + ;; +* ) + { echo + colorize 1 "ERROR" + echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)." + echo + } >&2 + exit 1 + ;; +esac diff --git a/plugins/python-build/share/python-build/miniconda3-3.7-4.10.3 b/plugins/python-build/share/python-build/miniconda3-3.7-4.10.3 new file mode 100644 index 00000000..ded90b82 --- /dev/null +++ b/plugins/python-build/share/python-build/miniconda3-3.7-4.10.3 @@ -0,0 +1,19 @@ +case "$(anaconda_architecture 2>/dev/null || true)" in +"Linux-ppc64le" ) + install_script "Miniconda3-py37_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-ppc64le.sh#a926bbaf28d59ac1264799e3ca770a44" "miniconda" verify_py37 + ;; +"Linux-x86_64" ) + install_script "Miniconda3-py37_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh#9f186c1d86c266acc47dbc1603f0e2ed" "miniconda" verify_py37 + ;; +"MacOSX-x86_64" ) + install_script "Miniconda3-py37_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-MacOSX-x86_64.sh#b88a2eb66917c55a6bd1973fabaf05b3" "miniconda" verify_py37 + ;; +* ) + { echo + colorize 1 "ERROR" + echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)." + echo + } >&2 + exit 1 + ;; +esac diff --git a/plugins/python-build/share/python-build/miniconda3-3.8-4.10.3 b/plugins/python-build/share/python-build/miniconda3-3.8-4.10.3 new file mode 100644 index 00000000..7f1438a5 --- /dev/null +++ b/plugins/python-build/share/python-build/miniconda3-3.8-4.10.3 @@ -0,0 +1,19 @@ +case "$(anaconda_architecture 2>/dev/null || true)" in +"Linux-ppc64le" ) + install_script "Miniconda3-py38_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-ppc64le.sh#12ddb1b94f30f8fc633c3223b0398d2f" "miniconda" verify_py38 + ;; +"Linux-x86_64" ) + install_script "Miniconda3-py38_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh#14da4a9a44b337f7ccb8363537f65b9c" "miniconda" verify_py38 + ;; +"MacOSX-x86_64" ) + install_script "Miniconda3-py38_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-MacOSX-x86_64.sh#cb609591c280423e999fc421cdb779d3" "miniconda" verify_py38 + ;; +* ) + { echo + colorize 1 "ERROR" + echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)." + echo + } >&2 + exit 1 + ;; +esac diff --git a/plugins/python-build/share/python-build/miniconda3-3.9-4.10.3 b/plugins/python-build/share/python-build/miniconda3-3.9-4.10.3 new file mode 100644 index 00000000..3a08afb9 --- /dev/null +++ b/plugins/python-build/share/python-build/miniconda3-3.9-4.10.3 @@ -0,0 +1,19 @@ +case "$(anaconda_architecture 2>/dev/null || true)" in +"Linux-ppc64le" ) + install_script "Miniconda3-py39_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-ppc64le.sh#07ea41c691bdcc7d9c71cae1a1a88151" "miniconda" verify_py39 + ;; +"Linux-x86_64" ) + install_script "Miniconda3-py39_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh#8c69f65a4ae27fb41df0fe552b4a8a3b" "miniconda" verify_py39 + ;; +"MacOSX-x86_64" ) + install_script "Miniconda3-py39_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.sh#09bb30a9204ced74ce3c06762cb442fc" "miniconda" verify_py39 + ;; +* ) + { echo + colorize 1 "ERROR" + echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)." + echo + } >&2 + exit 1 + ;; +esac