From 225b3256fc462adc7b9e9c0d8e36f8ce05f84568 Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Fri, 14 Oct 2016 12:53:03 -0700 Subject: [PATCH] Pin napalm-base Eliminate pylama.ini; replace with setup.cfg Add requirements-dev.txt Implement __version__ solution --- napalm_fortios/__init__.py | 13 ++++++++++++- pylama.ini | 6 ------ requirements-dev.txt | 7 +++++++ requirements.txt | 2 +- setup.cfg | 6 ++++++ 5 files changed, 26 insertions(+), 8 deletions(-) delete mode 100644 pylama.ini create mode 100644 requirements-dev.txt create mode 100644 setup.cfg diff --git a/napalm_fortios/__init__.py b/napalm_fortios/__init__.py index a95ba2b..277200a 100644 --- a/napalm_fortios/__init__.py +++ b/napalm_fortios/__init__.py @@ -13,4 +13,15 @@ # the License. """napalm_fortios package.""" -from fortios import FortiOSDriver +# Import stdlib +import pkg_resources + +# Import local modules +from napalm_fortios.fortios import FortiOSDriver + +try: + __version__ = pkg_resources.get_distribution('napalm-fortios').version +except pkg_resources.DistributionNotFound: + __version__ = "Not installed" + +__all__ = ('FortiOSDriver',) diff --git a/pylama.ini b/pylama.ini deleted file mode 100644 index 3146a20..0000000 --- a/pylama.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pylama] -linters = mccabe,pep257,pep8,pyflakes -ignore = D203, - -[pylama:pep8] -max_line_length = 120 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..491f338 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +pytest +pytest-cov +pytest-json +pytest-pythonpath +pylama +flake8-import-order +-r requirements.txt diff --git a/requirements.txt b/requirements.txt index 3b4589b..dc815fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -napalm_base +napalm-base==0.17.0 pyFG diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..ffae4a5 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,6 @@ +[pylama] +linters = mccabe,pep8,pyflakes +ignore = D203,C901 + +[pylama:pep8] +max_line_length = 100