From ac38e69e160bdbea776e843ab2833efffcd7b1b4 Mon Sep 17 00:00:00 2001 From: Viktor Date: Thu, 7 Nov 2019 00:24:36 +0200 Subject: [PATCH] Add setup config. --- requirements.txt | 3 +++ setup.cfg | 19 +++++++++++++++++++ setup.py | 31 ++++++++++++++++++++++++------- 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 requirements.txt create mode 100644 setup.cfg diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3e78bb2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +selenium==3.141.0 +urllib3==1.25.3 +mypy==0.740 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..c431ac2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,19 @@ +[pycodestyle] +ignore=E501 +max_line_length=110 + +[mypy] +python_version = 3.6 +show_column_numbers = True +; Suppress error messages about imports that cannot be resolved (PEP-561 non-complient packages): +ignore_missing_imports = True +; Report an error whenever it encounters a function definition without type annotations: +disallow_untyped_defs = True +; Disallow calling functions without type annotations in the scope of annotated functions: +disallow_untyped_calls = True +; Require from arguments with a None default value to be explicitly Optional: +no_implicit_optional = True +; Report an err whenever code uses a # type: ignore comment on a line that is not actually generating an error message: +warn_unused_ignores = True +; In order to avoid bugs and confusion don't use mypy cache: +incremental = False diff --git a/setup.py b/setup.py index e6e9b6d..03b8a44 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,38 @@ -import setuptools +from setuptools import setup, find_packages + + +def get_requirements(): + """Reads the installation requirements from requirements.pip""" + with open("requirements.pip") as reqfile: + return [line for line in reqfile.read().split("\n") if not line.startswith(('#', '-'))] + + +def get_test_requirements(): + """Reads the installation requirements for tests""" + with open("test-requirements.pip") as test_reqfile: + return [line for line in test_reqfile.read().split("\n") if not line.startswith(('#', '-'))] + with open("README.md", "r") as fh: long_description = fh.read() -setuptools.setup( + +setup( name="selen-kaa", version="0.0.1", - author="Example Author", - author_email="author@example.com", - description="A small example package", + author="Viktor Grygorchuk", + author_email="vvgrygorchuk@gmail.com", + description="A lightweight wrapper around Selenium python repo.", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/pypa/sampleproject", - packages=setuptools.find_packages(), + packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), + install_requires=get_requirements(), classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + "Operating System :: OS Independent" ], + test_suite="tests", + tests_require=get_test_requirements() )