Skip to content

Commit 35c8cd2

Browse files
authored
remove partial install (napalm-automation#554)
1 parent e51aa58 commit 35c8cd2

File tree

14 files changed

+22
-145
lines changed

14 files changed

+22
-145
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include requirements/*
1+
include requirements*
22
include napalm/*/templates/*.j2
33
include napalm/*/utils/textfsm_templates/*.tpl
44
include napalm/junos/utils/*.yml

README.md

-36
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,10 @@ You can also watch a [live demo](https://youtu.be/93q-dHC0u0I) of NAPALM to see
2626
Install
2727
=======
2828

29-
Full installation
30-
-----------------
31-
32-
If you want to fully install NAPALM you can do it by executing:
33-
3429
```
3530
pip install napalm
3631
```
3732

38-
That will install all the drivers currently available.
39-
40-
41-
Partial Installation
42-
--------------------
43-
44-
If you want to install just a subset of the available modules you can just pick them as follows:
45-
46-
```
47-
pip install --install-option="ios" napalm
48-
```
49-
50-
To install multiple drivers:
51-
```
52-
pip install --install-option="eos" --install-option="junos" napalm
53-
```
54-
55-
To add drivers to an existing instalation:
56-
```
57-
pip install --install-option="eos" --install-option="junos" --force-reinstall -U napalm
58-
```
59-
60-
Check the ['Supported Network Operating Systems'](#supported-network-operating-systems) section for more information about supported modules.
61-
6233

6334
Upgrading
6435
=========
@@ -69,13 +40,6 @@ We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes.
6940
pip install napalm -U
7041
```
7142

72-
or:
73-
74-
```
75-
pip install --install-option="eos" --install-option="junos" napalm -U
76-
```
77-
78-
7943
We will be posting news on our slack channel and on Twitter.
8044

8145

docs/installation/index.rst

+1-27
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Installation
55
Full installation
66
-----------------
77

8-
If you want to fully install NAPALM you can do it by executing:
8+
You can install napalm with pip:
99

1010
.. code-block:: bash
1111
@@ -14,32 +14,6 @@ If you want to fully install NAPALM you can do it by executing:
1414
That will install all the drivers currently available.
1515

1616

17-
Partial Installation
18-
--------------------
19-
20-
If you want to install just a subset of the available modules you can just pick them as follows:
21-
22-
.. code-block:: bash
23-
24-
pip install --install-option="eos" --install-option="junos" napalm
25-
26-
That will install only the ``eos`` and the ``junos`` drivers. If you want to add an extra driver later you can use ``pip --force-reinstall -U`` to do it:
27-
28-
.. code-block:: bash
29-
30-
pip install --install-option="ios" --force-reinstall -U napalm
31-
32-
33-
Note you can pass those options to a requirements file as well:
34-
35-
.. code-block:: bash
36-
37-
# requrements.txt
38-
napalm --install-option="ios" --install-option="eos"
39-
40-
41-
Check the `supported devices`_ section for more information on supported drivers.
42-
4317
Dependencies
4418
------------
4519

File renamed without changes.

requirements.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
future
2+
jtextfsm
3+
jinja2
4+
netaddr
5+
pyYAML
6+
pyeapi
7+
netmiko>=1.4.3
8+
pyIOSXR>=0.51
9+
netmiko>=1.4.3
10+
junos-eznc>=2.1.5
11+
pynxos
12+
netmiko>=1.4.3
13+
scp

requirements/all

-6
This file was deleted.

requirements/base

-5
This file was deleted.

requirements/eos

-1
This file was deleted.

requirements/ios

-1
This file was deleted.

requirements/iosxr

-2
This file was deleted.

requirements/junos

-1
This file was deleted.

requirements/nxos

-3
This file was deleted.

setup.py

+5-60
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,19 @@
11
"""setup.py file."""
22
import uuid
3-
import os
43

5-
from distutils.core import Command
64
from setuptools import setup, find_packages
7-
from setuptools.command import install
8-
from subprocess import check_call
9-
105

116
from pip.req import parse_requirements
127

13-
import pip # noqa: test pip is installed
14-
import sys
15-
16-
__author__ = 'David Barroso <[email protected]>'
17-
18-
# Read SUPPORTED_DRIVERS from file (without importing)
19-
_locals = {}
20-
filename = os.path.join('napalm', '_SUPPORTED_DRIVERS.py')
21-
with open(filename) as supported:
22-
exec(supported.read(), None, _locals)
23-
SUPPORTED_DRIVERS = _locals['SUPPORTED_DRIVERS']
24-
25-
26-
def process_requirements(dep):
27-
print("PROCESSING DEPENDENCIES FOR {}".format(dep))
28-
u = uuid.uuid1()
29-
iter_reqs = parse_requirements("requirements/{}".format(dep), session=u)
30-
31-
for ir in iter_reqs:
32-
check_call([sys.executable, '-m', 'pip', 'install', str(ir.req)])
33-
34-
35-
def custom_command_driver(driver):
36-
class CustomCommand(Command):
37-
"""A custom command to run Pylint on all Python source files."""
38-
user_options = []
398

40-
def initialize_options(self):
41-
pass
9+
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
10+
reqs = [str(ir.req) for ir in install_reqs]
4211

43-
def finalize_options(self):
44-
pass
45-
46-
def run(self):
47-
"""Run command."""
48-
process_requirements(driver)
49-
50-
return CustomCommand
51-
52-
53-
class CustomInstall(install.install):
54-
"""A custom command to run Pylint on all Python source files."""
55-
56-
def run(self):
57-
"""Run command."""
58-
if any([d in sys.argv for d in SUPPORTED_DRIVERS]):
59-
process_requirements('base')
60-
else:
61-
process_requirements('all')
62-
install.install.run(self)
63-
64-
65-
custom_commands = {d: custom_command_driver(d) for d in SUPPORTED_DRIVERS}
66-
custom_commands['install'] = CustomInstall
12+
__author__ = 'David Barroso <[email protected]>'
6713

6814
setup(
69-
cmdclass=custom_commands,
7015
name="napalm",
71-
version='2.1.0',
16+
version='2.2.0',
7217
packages=find_packages(exclude=("test*", )),
7318
test_suite='test_base',
7419
author="David Barroso, Kirk Byers, Mircea Ulinic",
@@ -88,7 +33,7 @@ def run(self):
8833
],
8934
url="https://github.com/napalm-automation/napalm",
9035
include_package_data=True,
91-
install_requires=[],
36+
install_requires=reqs,
9237
entry_points={
9338
'console_scripts': [
9439
'cl_napalm_configure=napalm.base.clitools.cl_napalm_configure:main',

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist = py27,py34,py35,py36
33

44
[testenv]
55
deps =
6-
-rrequirements/all
7-
-rrequirements/dev
6+
-rrequirements.txt
7+
-rrequirements-dev.txt
88
commands =
99
py.test

0 commit comments

Comments
 (0)