setup.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from setuptools import setup
  2. from setuptools import find_packages
  3. import os
  4. import re
  5. def find_version(*file_paths):
  6. """
  7. This pattern was modeled on a method from the Python Packaging User Guide:
  8. https://packaging.python.org/en/latest/single_source_version.html
  9. We read instead of importing so we don't get import errors if our code
  10. imports from dependencies listed in install_requires.
  11. """
  12. base_module_file = os.path.join(*file_paths)
  13. with open(base_module_file) as f:
  14. base_module_data = f.read()
  15. version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
  16. base_module_data, re.M)
  17. if version_match:
  18. return version_match.group(1)
  19. raise RuntimeError("Unable to find version string.")
  20. setup(
  21. name='netmiko',
  22. version=find_version('netmiko', '__init__.py'),
  23. description='Multi-vendor library to simplify Paramiko SSH connections to network devices',
  24. url='https://github.com/ktbyers/netmiko',
  25. author='Kirk Byers',
  26. author_email='ktbyers@twb-tech.com',
  27. license='MIT',
  28. classifiers=[
  29. 'Development Status :: 4 - Beta',
  30. 'License :: OSI Approved :: MIT License',
  31. 'Programming Language :: Python :: 2',
  32. 'Programming Language :: Python :: 2.7',
  33. 'Programming Language :: Python :: 3',
  34. 'Programming Language :: Python :: 3.5',
  35. 'Programming Language :: Python :: 3.6',
  36. ],
  37. packages=find_packages(exclude=("test*", )),
  38. install_requires=['paramiko>=2.0.0', 'scp>=0.10.0', 'pyyaml', 'pyserial', 'textfsm'],
  39. extras_require={
  40. 'test': ['pytest>=3.2.5', ]
  41. },
  42. )