1
0
Fork 0

Merging upstream version 0.10.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 13:52:40 +01:00
parent 801f1af336
commit d1f683ede3
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 45 additions and 46 deletions

View file

@ -40,7 +40,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: Dockerfile file: Dockerfile
@ -80,7 +80,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: Dockerfile.docker file: Dockerfile.docker

View file

@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-python@v5 - 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.2 - uses: pre-commit-ci/lite-action@v1.1.0
compiling: compiling:
name: Run installation process and code compilation supported Python versions name: Run installation process and code compilation supported Python versions

View file

@ -2,38 +2,17 @@
name: "Tag & Release management" name: "Tag & Release management"
on: on:
push: push:
# Sequence of patterns matched against refs/tags
tags: tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10 - 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs: jobs:
# release:
# name: Create Github Release
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Generate Changelog
# run: |
# sudo apt update && sudo apt install zsh
# export TAG_CURRENT=$(git describe --abbrev=0 --tags)
# export TAG_PREVIOUS=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
# echo "Previous tag is: ${TAG_PREVIOUS}"
# echo "Current tag is: ${TAG_CURRENT}"
# zsh .github/changelog.sh ${TAG_CURRENT} ${TAG_PREVIOUS} md > CHANGELOG.md
# cat CHANGELOG.md
# - name: Release on Github
# uses: softprops/action-gh-release@v1
# with:
# draft: false
# body_path: CHANGELOG.md
pypi: pypi:
name: Publish version to Pypi servers name: Publish version to Pypi servers
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/eos-downloader
permissions:
id-token: write
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -47,7 +26,7 @@ jobs:
run: | run: |
python -m build python -m build
- name: Publish package to TestPyPI - name: Publish package to Pypi server
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__ user: __token__
@ -86,7 +65,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: Dockerfile file: Dockerfile
@ -127,7 +106,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: Dockerfile.docker file: Dockerfile.docker

View file

@ -13,6 +13,10 @@
Script to download Arista softwares to local folder, Cloudvision or EVE-NG. Script to download Arista softwares to local folder, Cloudvision or EVE-NG.
> [!CAUTION]
> This script should not be deployed on EOS device. If you do that, there is no support to expect from Arista TAC team.
```bash ```bash
pip install eos-downloader pip install eos-downloader
``` ```

View file

@ -18,6 +18,11 @@ import importlib.metadata
import json import json
from typing import Any from typing import Any
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from _typeshed import DataclassInstance # noqa: F401
__author__ = "@titom73" __author__ = "@titom73"
__email__ = "tom@inetsix.net" __email__ = "tom@inetsix.net"
__date__ = "2022-03-16" __date__ = "2022-03-16"
@ -52,5 +57,5 @@ class EnhancedJSONEncoder(json.JSONEncoder):
def default(self, o: Any) -> Any: def default(self, o: Any) -> Any:
if dataclasses.is_dataclass(o): if dataclasses.is_dataclass(o):
return dataclasses.asdict(o) return dataclasses.asdict(o) # type: ignore
return super().default(o) return super().default(o)

View file

@ -124,6 +124,7 @@ def eos(
latest: bool = False, latest: bool = False,
branch: Union[str, None] = None, branch: Union[str, None] = None,
) -> int: ) -> int:
# pylint: disable=R0917
"""Download EOS image from Arista website""" """Download EOS image from Arista website"""
console = Console() console = Console()
# Get from Context # Get from Context

View file

@ -71,7 +71,7 @@ def eos_versions(
latest: bool = False, latest: bool = False,
verbose: bool = False, verbose: bool = False,
) -> None: ) -> None:
# pylint: disable = too-many-branches # pylint: disable = too-many-branches, R0917
""" """
List Available EOS version on Arista.com website. List Available EOS version on Arista.com website.

View file

@ -59,7 +59,7 @@ class ObjectDownloader:
token: str, token: str,
software: str = "EOS", software: str = "EOS",
hash_method: str = "md5sum", hash_method: str = "md5sum",
): ): # pylint: disable=R0917
""" """
__init__ Class constructor __init__ Class constructor

View file

@ -3,7 +3,8 @@ disable=
invalid-name, invalid-name,
logging-fstring-interpolation, logging-fstring-interpolation,
fixme, fixme,
line-too-long line-too-long,
too-many-arguments
[BASIC] [BASIC]
good-names=runCmds, i, y, t, c, x, e, fd, ip, v good-names=runCmds, i, y, t, c, x, e, fd, ip, v

View file

@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "eos_downloader" name = "eos_downloader"
version = "v0.10.2" version = "v0.10.3"
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 = [
@ -27,8 +27,19 @@ dependencies = [
"click>=8.1.6", "click>=8.1.6",
"click-help-colors>=0.9", "click-help-colors>=0.9",
"pydantic>2.0.0", "pydantic>2.0.0",
"urllib3>=2.2.2",
]
keywords = [
"eos_downloader",
"Arista",
"eos",
"cvp",
"network",
"automation",
"networking",
"devops",
"netdevops",
] ]
keywords = ["eos_downloader", "Arista", "eos", "cvp", "network", "automation", "networking", "devops", "netdevops"]
classifiers = [ classifiers = [
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
@ -51,7 +62,7 @@ requires-python = ">=3.8"
[project.optional-dependencies] [project.optional-dependencies]
dev = [ dev = [
"mypy==1.10.0", "mypy==1.13.0",
"isort==5.13.2", "isort==5.13.2",
"mypy-extensions>=0.4.3", "mypy-extensions>=0.4.3",
"pre-commit>=2.20.0", "pre-commit>=2.20.0",
@ -70,7 +81,7 @@ dev = [
"yamllint", "yamllint",
"flake8>=4.0.1", "flake8>=4.0.1",
"pyflakes>=2.4.0", "pyflakes>=2.4.0",
"bumpver>=2023.1126" "bumpver>=2023.1126",
] ]
[project.urls] [project.urls]
@ -94,7 +105,7 @@ namespaces = false
# Version # Version
################################ ################################
[tool.bumpver] [tool.bumpver]
current_version = "0.10.2" current_version = "0.10.3"
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
@ -107,9 +118,7 @@ push = false
# mypy as per https://pydantic-docs.helpmanual.io/mypy_plugin/#enabling-the-plugin # mypy as per https://pydantic-docs.helpmanual.io/mypy_plugin/#enabling-the-plugin
[tool.mypy] [tool.mypy]
plugins = [ plugins = ["pydantic.mypy"]
"pydantic.mypy",
]
follow_imports = "skip" follow_imports = "skip"
ignore_missing_imports = true ignore_missing_imports = true
warn_redundant_casts = true warn_redundant_casts = true
@ -174,7 +183,7 @@ commands =
description = check the code style description = check the code style
commands = commands =
flake8 --max-line-length=165 --config=/dev/null eos_downloader flake8 --max-line-length=165 --config=/dev/null eos_downloader
pylint eos_downloader pylint --rcfile=pylintrc eos_downloader
[testenv:type] [testenv:type]
description = check typing description = check typing