You've already forked lmod_manager
mirror of
https://github.com/AdaCore/lmod_manager.git
synced 2026-02-12 13:10:59 -08:00
Add support for GNAT Pro for Rust
This commit is contained in:
committed by
Tobias Reiher
parent
c0e36a0f7b
commit
72abd7412e
@@ -58,6 +58,8 @@ class Tool:
|
||||
|
||||
@staticmethod
|
||||
def from_archive(archive: Path) -> Tool:
|
||||
if archive.name.startswith(GnatProRust.archive_name()):
|
||||
return GnatProRust(archive)
|
||||
if archive.name.startswith(Gnat.archive_name()):
|
||||
return Gnat(archive)
|
||||
if archive.name.startswith(Spark.archive_name()):
|
||||
@@ -72,6 +74,8 @@ class Tool:
|
||||
|
||||
@staticmethod
|
||||
def from_module(module_name: str) -> Tool:
|
||||
if module_name.startswith(GnatProRust.name()):
|
||||
return GnatProRust(module_name=module_name)
|
||||
if module_name.startswith(Gnat.name()):
|
||||
return Gnat(module_name=module_name)
|
||||
if module_name.startswith(Spark.name()):
|
||||
@@ -255,6 +259,27 @@ class Rust(Tool):
|
||||
)
|
||||
|
||||
|
||||
class GnatProRust(Tool):
|
||||
@staticmethod
|
||||
def name() -> str:
|
||||
return "gnatpro-rust"
|
||||
|
||||
@staticmethod
|
||||
def archive_name() -> str:
|
||||
return "gnatpro-rust"
|
||||
|
||||
@staticmethod
|
||||
def _installation_file() -> Path:
|
||||
return Path("bin/rustc")
|
||||
|
||||
def _install_archive(self, installation_dir: Path) -> None:
|
||||
call(
|
||||
f"./install --install-dir='{installation_dir}' --force",
|
||||
cwd=self._extracted_archive_dir(),
|
||||
shell=True,
|
||||
)
|
||||
|
||||
|
||||
def main() -> Union[int, str]:
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
|
||||
BIN
tests/data/gnatpro-rust-25.0w-20240820-x86_64-linux-bin.tar.gz
Normal file
BIN
tests/data/gnatpro-rust-25.0w-20240820-x86_64-linux-bin.tar.gz
Normal file
Binary file not shown.
@@ -240,6 +240,13 @@ def test_install_unexpected_archive_name_format(monkeypatch: MonkeyPatch, tmp_pa
|
||||
"25.0w-20240417",
|
||||
),
|
||||
],
|
||||
[
|
||||
Archive(
|
||||
"gnatpro-rust-25.0w-20240820-x86_64-linux-bin.tar.gz",
|
||||
"gnatpro-rust",
|
||||
"25.0w-20240820",
|
||||
),
|
||||
],
|
||||
],
|
||||
)
|
||||
def test_install_and_uninstall(
|
||||
|
||||
Reference in New Issue
Block a user