setup.py and tox.ini

This commit is contained in:
Solvik Blum 2019-08-03 23:51:14 +02:00
commit d56b02c7bd
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
3 changed files with 104 additions and 0 deletions

8
dev-requirements.txt Normal file
View file

@ -0,0 +1,8 @@
pytest
pytest-cov
mypy
flake8 >= 3.3.0
pep8-naming >= 0.4.1
flake8-quotes >= 0.8.1
flake8-import-order >= 0.9.0
Sphinx

27
setup.py Normal file
View file

@ -0,0 +1,27 @@
from setuptools import setup, find_packages
setup(
name='netbox_agent',
version='0.1',
description='NetBox agent for server',
long_description=open('README.md', encoding="utf-8").read(),
url='https://github.com/solvik/netbox_agent',
author='Solvik Blum',
author_email='solvik@solvik.fr',
license='Apache2',
include_package_data=True,
use_scm_version=True,
packages=find_packages(),
install_requires=open('requirements.txt').readlines(),
zip_safe=False,
keywords=['netbox'],
classifiers=[
'Intended Audience :: Developers',
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
entry_points={
'console_scripts': ['netbox_agent=netbox_agent.cli:main'],
}
)

69
tox.ini Normal file
View file

@ -0,0 +1,69 @@
[tox]
# These are the default environments that will be run
# when ``tox`` is run without arguments.
envlist =
py35
py36
py37
coverage
mypy
pep8
docs
skip_missing_interpreters = true
[flake8]
# Use the more relaxed max line length permitted in PEP8.
max-line-length = 99
# Enforce the Google Python style for grouping and sorting imports:
# https://github.com/google/styleguide/blob/gh-pages/pyguide.md#313-imports-formatting
import-order-style = google
# Inform flake8-import-order plugin that `fact` should be treated as a local package name.
application-import-names = fact
# [testenv]
# setenv =
# COVERAGE_FILE = .coverage.{envname}
# deps =
# -r{toxinidir}/requirements.txt
# -r{toxinidir}/dev-requirements.txt
# commands =
# # Use -bb to enable BytesWarnings as error to catch str/bytes misuse.
# # Use -Werror to treat warnings as errors.
# # Must ignore a DeprecationWarnings triggered in pytest until the following are fixed:
# # https://github.com/pytest-dev/pytest/issues/1403
# # https://github.com/pytest-dev/pytest/issues/4507
# # Must ignore DeprecationWarnings in virtualenv site.py only if supporting Travis CI
# # Python 3.5 environments that bundle an older version of virtualenv.
# python -bb \
# -Werror -Wignore:::_pytest.assertion.rewrite -Wignore:::_pytest.tmpdir -Wignore:::site \
# -m pytest --cov="{envsitepackagesdir}/fact"
# [testenv:coverage]
# skip_install = true
# depends = py35,py36,py37
# # Set blank setenv to overwrite setenv from [testenv] (inherited).
# setenv =
# deps =
# -r{toxinidir}/dev-requirements.txt
# commands =
# coverage combine
# coverage html
# [testenv:mypy]
# skip_install = true
# setenv =
# deps =
# -r{toxinidir}/requirements.txt
# -r{toxinidir}/dev-requirements.txt
# commands =
# mypy src
[testenv:pep8]
skip_install = true
setenv =
deps =
-r{toxinidir}/dev-requirements.txt
commands =
flake8 netbox_agent tests