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

Development to Master #29

Merged
merged 10 commits into from
Nov 11, 2023
45 changes: 45 additions & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Build and Test
on: [push, pull_request]
permissions:
contents: read

jobs:
std_tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
python-version: [3.8, 3.9, 3.11]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e .
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt

- name: Run black
run: |
black --check .

- name: Run linter
run: |
pylama .

- name: Run type checker
run: |
mypy -p napalm_huawei_vrp --config-file mypy.ini

# - name: Run Tests
# run: |
# py.test --cov=napalm --cov-report term-missing -vs --pylama
34 changes: 13 additions & 21 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

name: Publish Python Package
on:
release:
types: [published]
push:
# Sequence of patterns matched against refs/tags
tags:
- '*'

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
pip install setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: pypi
password: ${{ secrets.PYPI_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ test/unit/develop_test.py
# Python Virtual Env
venv_*

# mypy
.mypy_cache/

# VSCODE
.vscode/
49 changes: 49 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[mypy]
disallow_untyped_defs = False
allow_redefinition = True

[mypy-napalm]
ignore_missing_imports = True

[mypy-napalm.base.*]
disallow_untyped_defs = True
ignore_missing_imports = True

[mypy-napalm.iosxr_netconf.*]
ignore_errors = True

[mypy-napalm.nxapi_plumbing.*]
disallow_untyped_defs = True

[mypy-napalm.base.clitools.*]
ignore_errors = True

[mypy-napalm.base.test.*]
ignore_errors = True

[mypy-netaddr.*]
ignore_missing_imports = True

[mypy-netmiko.*]
ignore_missing_imports = True

[mypy-jnpr.*]
ignore_missing_imports = True

[mypy-pyeapi.*]
ignore_missing_imports = True

[mypy-lxml.*]
ignore_missing_imports = True

[mypy-netutils.*]
ignore_missing_imports = True

[mypy-textfsm]
ignore_missing_imports = True

[mypy-ttp]
ignore_missing_imports = True

[mypy-pytest]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion napalm_huawei_vrp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"""napalm-skeleton package."""
from napalm_huawei_vrp.huawei_vrp import VRPDriver

__all__ = ('VRPDriver',)
__all__ = ("VRPDriver",)
Loading