1
0
Fork 0

Adding upstream version 0.10.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 13:50:26 +01:00
parent fb90b93350
commit ac8cf99bdd
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 21 additions and 15 deletions

View file

@ -16,10 +16,10 @@ jobs:
python-version: ["3.8", "3.9", "3.10"] python-version: ["3.8", "3.9", "3.10"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-python@v4 - uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- uses: pre-commit-ci/lite-action@v1.0.1 - uses: pre-commit-ci/lite-action@v1.0.2
compiling: compiling:
name: Run installation process and code compilation supported Python versions name: Run installation process and code compilation supported Python versions
@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -61,7 +61,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
@ -84,7 +84,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
@ -107,7 +107,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}

View file

@ -128,6 +128,7 @@ def eos(
console = Console() console = Console()
# Get from Context # Get from Context
token = ctx.obj["token"] token = ctx.obj["token"]
is_latest: bool = False
if token is None or token == "": if token is None or token == "":
console.print( console.print(
"❗ Token is unset ! Please configure ARISTA_TOKEN or use --token option", "❗ Token is unset ! Please configure ARISTA_TOKEN or use --token option",
@ -156,6 +157,7 @@ def eos(
my_download.authenticate() my_download.authenticate()
elif latest: elif latest:
is_latest = True
my_download = eos_downloader.eos.EOSDownloader( my_download = eos_downloader.eos.EOSDownloader(
image=image_type, image=image_type,
software="EOS", software="EOS",
@ -180,7 +182,7 @@ def eos(
my_download.download_local(file_path=output, checksum=True) my_download.download_local(file_path=output, checksum=True)
if import_docker: if import_docker:
my_download.docker_import(image_name=docker_name) my_download.docker_import(image_name=docker_name, is_latest=is_latest)
console.print("✅ processing done !") console.print("✅ processing done !")
sys.exit(0) sys.exit(0)

View file

@ -137,8 +137,7 @@ class EOSDownloader(ObjectDownloader):
selected_branch = EosVersion.from_str(BASE_BRANCH_STR) selected_branch = EosVersion.from_str(BASE_BRANCH_STR)
for branch in self._get_branches(with_rtype=rtype): for branch in self._get_branches(with_rtype=rtype):
branch = EosVersion.from_str(branch) branch = EosVersion.from_str(branch)
if branch > selected_branch: selected_branch = max(selected_branch, branch)
selected_branch = branch
return selected_branch return selected_branch
def get_eos_versions( def get_eos_versions(

View file

@ -547,7 +547,9 @@ class ObjectDownloader:
if noztp: if noztp:
self._disable_ztp(file_path=file_path) self._disable_ztp(file_path=file_path)
def docker_import(self, image_name: str = "arista/ceos") -> None: def docker_import(
self, image_name: str = "arista/ceos", is_latest: bool = False
) -> None:
""" """
Import docker container to your docker server. Import docker container to your docker server.
@ -561,6 +563,9 @@ class ObjectDownloader:
logger.info(f"Importing image {self.filename} to {docker_image}") logger.info(f"Importing image {self.filename} to {docker_image}")
console.print(f"🚀 Importing image {self.filename} to {docker_image}") console.print(f"🚀 Importing image {self.filename} to {docker_image}")
os.system(f"$(which docker) import {self.filename} {docker_image}") os.system(f"$(which docker) import {self.filename} {docker_image}")
if is_latest:
console.print(f"🚀 Configuring {docker_image}:{self.version} to be latest")
os.system(f"$(which docker) tag {docker_image} {image_name}:latest")
for filename in glob.glob(f"{self.filename}*"): for filename in glob.glob(f"{self.filename}*"):
try: try:
os.remove(filename) os.remove(filename)

View file

@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "eos_downloader" name = "eos_downloader"
version = "v0.9.0" version = "v0.10.0"
readme = "README.md" readme = "README.md"
authors = [{ name = "Thomas Grimonet", email = "thomas.grimonet@gmail.com" }] authors = [{ name = "Thomas Grimonet", email = "thomas.grimonet@gmail.com" }]
maintainers = [ maintainers = [
@ -22,7 +22,7 @@ dependencies = [
"scp", "scp",
"tqdm", "tqdm",
"loguru", "loguru",
"rich>=13.5.2,<13.7.0", "rich>=13.5.2,<13.8.0",
"cvprac>=1.0.7", "cvprac>=1.0.7",
"click~=8.1.6", "click~=8.1.6",
"click-help-colors~=0.9", "click-help-colors~=0.9",
@ -51,8 +51,8 @@ requires-python = ">=3.8"
[project.optional-dependencies] [project.optional-dependencies]
dev = [ dev = [
"isort==5.12.0", "mypy==1.8.0",
"mypy==1.5.1", "isort==5.13.2",
"mypy-extensions>=0.4.3", "mypy-extensions>=0.4.3",
"pre-commit>=2.20.0", "pre-commit>=2.20.0",
"pylint", "pylint",
@ -94,7 +94,7 @@ namespaces = false
# Version # Version
################################ ################################
[tool.bumpver] [tool.bumpver]
current_version = "0.9.0" current_version = "0.10.0"
version_pattern = "MAJOR.MINOR.PATCH" version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump: Version {old_version} -> {new_version}" commit_message = "bump: Version {old_version} -> {new_version}"
commit = true commit = true