Coder Social home page Coder Social logo

napalm-onyx's People

Contributors

anas-shami avatar anasbadaha avatar atta avatar samerd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

napalm-onyx's Issues

Onyx driver doesn't work with NAPALM version 3.x

Since NAPALM version 3.0.0 it only supports Python3.6+, https://github.com/napalm-automation/napalm/releases/tag/3.0.0. This means they removed the napalm/base/utils/py23_compat.py etc. in napalm-automation/napalm#1068

Due to this change, the napalm-onyx driver doesn't load anymore:

bash-5.0$ python
Python 3.7.9 (default, Aug 18 2020, 04:02:05)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from napalm import get_network_driver
>>> get_network_driver('onyx')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/napalm/base/__init__.py", line 95, in get_network_driver
    raise e
  File "/usr/local/lib/python3.7/site-packages/napalm/base/__init__.py", line 86, in get_network_driver
    module = importlib.import_module(module_name)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/napalm_onyx/__init__.py", line 19, in <module>
    from napalm_onyx.onyx_ssh import ONYXSSHDriver
  File "/usr/local/lib/python3.7/site-packages/napalm_onyx/onyx_ssh.py", line 40, in <module>
    from napalm.base.utils import py23_compat
ImportError: cannot import name 'py23_compat' from 'napalm.base.utils' (/usr/local/lib/python3.7/site-packages/napalm/base/utils/__init__.py)
>>>

pip versions after 20.1 are unable to install the Onyx driver

Since pip version 20.1 they have changed how they handle the requirements.txt parsing and the current implementation in your setup.py doesn't work anymore. This is similar to many other projects that have used the same method , e.g. pypa/pip#8188 (comment)

# pip -V
pip 20.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

# pip install git+https://github.com/napalm-automation-community/napalm-onyx.git
Collecting git+https://github.com/napalm-automation-community/napalm-onyx.git
  Cloning https://github.com/napalm-automation-community/napalm-onyx.git to /tmp/pip-req-build-n1w6tajm
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-n1w6tajm/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-n1w6tajm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-oo0l93vz
         cwd: /tmp/pip-req-build-n1w6tajm/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-n1w6tajm/setup.py", line 14, in <module>
        reqs = [str(ir.req) for ir in install_reqs]
      File "/tmp/pip-req-build-n1w6tajm/setup.py", line 14, in <listcomp>
        reqs = [str(ir.req) for ir in install_reqs]
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.