From 2022da2405ce577ccb453d099e3a09f7c6c866de Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Wed, 26 Jul 2017 15:42:42 +0200 Subject: [PATCH] Add overall python code QA and guidelines with flake8 ScyllaDB loves python & python loves ScyllaDB. It would benefit the project to start enforcing some code guidelines and basic QA with a linter along a PEP8 respect thanks to flake8. This patch adds a tox config to at least start with an assessment of the work to be done on all .py files in the code base. To reduce its noise, tests on long lines (> 80char) are ignored for now. Signed-off-by: Ultrabug Message-Id: <20170726134242.8927-1-ultrabug@gentoo.org> --- .gitignore | 4 ++++ setup.py | 12 ++++++++++++ tox.ini | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 setup.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 468493ac03..8ea3f2ffd0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,8 @@ Cql.tokens .kdev4 *.kdev4 CMakeLists.txt.user +.cache +.tox +*.egg-info +__pycache__CMakeLists.txt.user .gdbinit diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000..7e1885febc --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +from setuptools import find_packages, setup + +setup( + name="scylla", + description='NoSQL data store using the seastar framework, compatible with Apache Cassandra', + url='https://github.com/scylladb/scylla', + download_url='https://github.com/scylladb/scylla/tags', + license='AGPL', + platforms='any', + packages=find_packages(), + include_package_data=True, + install_requires=[]) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..36dfb0d830 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +usedevelop=True +skipdist=True + +[testenv] +deps = + pytest + pytest-flake8 + +commands = + pytest --flake8 -k 'not tests' + +[flake8] +max-line-length = 120 +exclude = .ropeproject,.tox,tests +show-source = False + +[pytest] +flake8-ignore = + E501