Skip to content

Commit

Permalink
build: add dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
xdai555 committed Jan 31, 2022
1 parent 2aa660d commit 346ac7a
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 11 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please read http://napalm.readthedocs.io/en/latest/contributing/index.html
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include requirements.txt
include napalm_comware/templates/*.j2
include napalm_comware/utils/textfsm_templates/*.tpl
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,51 @@ NAPALM driver for H3C/HPE Comware V7 network devices.
# Supported devices

...
S5100、S5500、S6800、S12500 Series Data Center Switches.

# Supported functions

- :white_check_mark: is_alive()
- :white_check_mark: get_facts()
- :white_check_mark: get_vlans()
- :white_check_mark: get_interfaces()
- :white_check_mark: get_lldp_neighbors()
- :white_check_mark: get_environment()
- :white_check_mark: get_interfaces_counters()
- :white_check_mark: get_lldp_neighbors_detail()
- :white_check_mark: cli()
- :white_check_mark: get_arp_table()
- :white_check_mark: get_mac_address_move_table()
- :white_check_mark: get_mac_address_table()
- :white_check_mark: get_vlans()
- :white_check_mark: get_config()
- :white_check_mark: get_interfaces()
- :white_check_mark: get_irf_config()
- :white_check_mark: is_irf()



# Getting Started

...
## Install

```shell
pip install napalm-comware-ssh
```

## Upgrading

```
pip install napalm -U
```

## Use

# License
```python
from napalm import get_network_driver

ASL2.0
driver = get_network_driver("comware")
driver = driver("192.168.56.20", "netdevops", "NetDevops@01",)
driver.open()
ret = driver.is_alive()
print(ret)
```
4 changes: 2 additions & 2 deletions napalm_comware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

from napalm_comware.comware import ComwareDriver

__all__ = ('ComwareDriver',)
__version__ = '0.0.1'
__all__ = ("ComwareDriver",)
__version__ = "0.1.0"
6 changes: 2 additions & 4 deletions napalm_comware/comware.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
# the License.

"""
Napalm driver for H3C ComwareV7 devices.
Napalm driver for H3C/HPE ComwareV7 devices.
Read https://napalm.readthedocs.io for more information.
"""

from operator import itemgetter
from collections import defaultdict
from tabnanny import verbose
from typing import Any, Optional, Dict, List
import re
from netmiko.hp.hp_comware import HPComwareBase
from napalm.base.base import NetworkDriver
from napalm.base.exceptions import (
ConnectionClosedException,
Expand All @@ -35,6 +32,7 @@
mac,
)
from napalm.base.netmiko_helpers import netmiko_args
from netmiko.hp.hp_comware import HPComwareBase
from .utils.helpers import (
canonical_interface_name_comware,
parse_time,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
napalm>=3.0.0
49 changes: 49 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""setup.py file."""

from setuptools import setup, find_packages
import re


with open("requirements.txt", "r") as fs:
reqs = [r for r in fs.read().splitlines() if (
len(r) > 0 and not r.startswith("#"))]

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

__author__ = "Eric Wu <[email protected]>"

# get version without importing
with open("napalm_comware/__init__.py", "r") as f:
VERSION = str(re.search('__version__ = "(.+?)"', f.read()).group(1))


setup(
name="napalm-comware-ssh",
version=VERSION,
author="Eric Wu",
author_email="[email protected]",
description="NAPALM driver for H3C/HPE Comware V7 network devices.",
license="Apache 2.0",
long_description_content_type="text/markdown",
long_description=long_description,
url="https://github.com/xdai555/napalm-comware-ssh",
project_urls={
"Bug Tracker": "https://github.com/xdai555/napalm-comware-ssh/issues",
},
classifiers=[
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
],
packages=find_packages(exclude=("test*", "*demo.py")),
include_package_data=True, # declarations in MANIFEST.in
install_requires=reqs,
)

0 comments on commit 346ac7a

Please sign in to comment.