Skip to content

Commit b96334c

Browse files
committed
Switching to poetry for building the project
2 parents 35c363d + 6b34289 commit b96334c

39 files changed

Lines changed: 443 additions & 328 deletions

.gitignore

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,23 @@
1-
# Created by .ignore support plugin (hsz.mobi)
2-
### Python template
31
# Byte-compiled / optimized / DLL files
42
__pycache__/
53
*.py[cod]
64
*$py.class
75

86
# Distribution / packaging
97
.Python
10-
env/
118
venv/
12-
build/
13-
develop-eggs/
149
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
2310
*.egg-info/
24-
.installed.cfg
25-
*.egg
11+
poetry.lock
2612

27-
# PyInstaller
28-
# Usually these files are written by a python script from a template
29-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30-
*.manifest
31-
*.spec
32-
33-
# Installer logs
34-
pip-log.txt
35-
pip-delete-this-directory.txt
36-
37-
# Unit test / coverage reports
38-
htmlcov/
39-
.tox/
40-
.coverage
41-
.coverage.*
42-
.cache
43-
nosetests.xml
44-
coverage.xml
45-
*,cover
46-
.hypothesis/
13+
# Unit tests
4714
tests/*.log
48-
# Translations
49-
*.mo
50-
*.pot
51-
52-
# PyBuilder
53-
target/
54-
55-
# Idea project folder
56-
.idea
57-
58-
#Examples for test
5915
*.yaml
60-
/MANIFEST
16+
17+
# Docs
6118
/docs/_build
6219
/docs/[Mm]ake*
20+
21+
# Others
22+
.idea/
23+
.vscode/

.readthedocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
version: 2
3+
4+
python:
5+
version: 3.7
6+
install:
7+
- method: pip
8+
path: .
9+
extra_requirements:
10+
- docs
11+

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

environment.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

netdev/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@
44
from netdev.logger import logger
55
from netdev.version import __author__, __author_email__, __url__, __version__
66

7-
__all__ = ('create', 'platforms', 'logger', 'DisconnectError', 'TimeoutError', 'CommitError', 'vendors')
7+
__all__ = (
8+
"create",
9+
"platforms",
10+
"logger",
11+
"DisconnectError",
12+
"TimeoutError",
13+
"CommitError",
14+
"vendors",
15+
)

netdev/dispatcher.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
# @formatter:off
1515
# The keys of this dictionary are the supported device_types
1616
CLASS_MAPPER = {
17-
'arista_eos': AristaEOS,
18-
'aruba_aos_6': ArubaAOS6,
19-
'aruba_aos_8': ArubaAOS8,
20-
'cisco_asa': CiscoASA,
21-
'cisco_ios': CiscoIOS,
22-
'cisco_ios_xe': CiscoIOS,
23-
'cisco_ios_xr': CiscoIOSXR,
24-
'cisco_nxos': CiscoNXOS,
25-
'fujitsu_switch': FujitsuSwitch,
26-
'hp_comware': HPComware,
27-
'hp_comware_limited': HPComwareLimited,
28-
'juniper_junos': JuniperJunOS,
29-
'mikrotik_routeros': MikrotikRouterOS,
30-
'ubiquity_edge': UbiquityEdgeSwitch,
31-
'terminal': Terminal,
17+
"arista_eos": AristaEOS,
18+
"aruba_aos_6": ArubaAOS6,
19+
"aruba_aos_8": ArubaAOS8,
20+
"cisco_asa": CiscoASA,
21+
"cisco_ios": CiscoIOS,
22+
"cisco_ios_xe": CiscoIOS,
23+
"cisco_ios_xr": CiscoIOSXR,
24+
"cisco_nxos": CiscoNXOS,
25+
"fujitsu_switch": FujitsuSwitch,
26+
"hp_comware": HPComware,
27+
"hp_comware_limited": HPComwareLimited,
28+
"juniper_junos": JuniperJunOS,
29+
"mikrotik_routeros": MikrotikRouterOS,
30+
"ubiquity_edge": UbiquityEdgeSwitch,
31+
"terminal": Terminal,
3232
}
3333

3434
# @formatter:on
@@ -40,8 +40,10 @@
4040

4141
def create(*args, **kwargs):
4242
"""Factory function selects the proper class and creates object based on device_type"""
43-
if kwargs['device_type'] not in platforms:
44-
raise ValueError('Unsupported device_type: '
45-
'currently supported platforms are: {0}'.format(platforms_str))
46-
connection_class = CLASS_MAPPER[kwargs['device_type']]
43+
if kwargs["device_type"] not in platforms:
44+
raise ValueError(
45+
"Unsupported device_type: "
46+
"currently supported platforms are: {0}".format(platforms_str)
47+
)
48+
connection_class = CLASS_MAPPER[kwargs["device_type"]]
4749
return connection_class(*args, **kwargs)

netdev/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class DisconnectError(Exception):
22
"""AsyncSSH Disconnect Error with ip address"""
3+
34
def __init__(self, ip_address, code, reason):
45
self.ip_address = ip_address
56
self.code = code

netdev/vendors/__init__.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,30 @@
1212
from netdev.vendors.terminal import Terminal
1313
from netdev.vendors.ubiquiti import UbiquityEdgeSwitch
1414

15-
__all__ = ('CiscoASA', 'CiscoIOS', 'CiscoIOSXR', 'CiscoNXOS', 'HPComware', 'HPComwareLimited', 'FujitsuSwitch',
16-
'MikrotikRouterOS', 'JuniperJunOS', 'JunOSLikeDevice', 'AristaEOS', 'ArubaAOS6', 'ArubaAOS8', 'BaseDevice',
17-
'IOSLikeDevice', 'ComwareLikeDevice', 'Terminal', 'arista', 'aruba', 'cisco', 'fujitsu', 'hp', 'juniper',
18-
'mikrotik', 'UbiquityEdgeSwitch')
15+
__all__ = (
16+
"CiscoASA",
17+
"CiscoIOS",
18+
"CiscoIOSXR",
19+
"CiscoNXOS",
20+
"HPComware",
21+
"HPComwareLimited",
22+
"FujitsuSwitch",
23+
"MikrotikRouterOS",
24+
"JuniperJunOS",
25+
"JunOSLikeDevice",
26+
"AristaEOS",
27+
"ArubaAOS6",
28+
"ArubaAOS8",
29+
"BaseDevice",
30+
"IOSLikeDevice",
31+
"ComwareLikeDevice",
32+
"Terminal",
33+
"arista",
34+
"aruba",
35+
"cisco",
36+
"fujitsu",
37+
"hp",
38+
"juniper",
39+
"mikrotik",
40+
"UbiquityEdgeSwitch",
41+
)

netdev/vendors/arista/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .arista_eos import AristaEOS
22

3-
__all__ = ['AristaEOS']
3+
__all__ = ["AristaEOS"]

netdev/vendors/arista/arista_eos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33

44
class AristaEOS(IOSLikeDevice):
55
"""Class for working with Arista EOS"""
6+
67
pass

0 commit comments

Comments
 (0)