diff options
| -rw-r--r-- | .pylintrc | 13 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | pyproject.toml | 71 | ||||
| -rw-r--r-- | setup.cfg | 4 | ||||
| -rwxr-xr-x | setup.py | 48 | ||||
| -rw-r--r-- | setup_commands/__init__.py | 3 | ||||
| -rw-r--r-- | setup_commands/run_tests.py | 40 |
7 files changed, 72 insertions, 109 deletions
diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 0b11d24..0000000 --- a/.pylintrc +++ /dev/null @@ -1,13 +0,0 @@ -[SIMILARITIES] - -ignore-imports=yes - -[MESSAGES CONTROL] - -disable= - fixme, - duplicate-code, - no-else-return - -load-plugins= - pylint.extensions.no_self_use \ No newline at end of file diff --git a/README.md b/README.md index 07937eb..f6c5f04 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ The checks we do are ### Linting ```bash -pylint *py tests gn_auth +pylint tests gn_auth ``` ### Type-Checking diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f5f624d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "gn-auth" +# version = "1.0.1" +dynamic = ["version"] # Read from git, or elsewhere +description = "Authentication/Authorisation server for GeneNetwork Services." +requires-python = ">= 3.10" +authors = [ +{name = "Frederick M. Muriithi", email = "fredmanglis@gmail.com"}, +] +dependencies = [ +"argon2-cffi>= 20.1.0", +"click", +"Flask>= 1.1.2", +"mypy>= 0.790", +"mypy-extensions>= 0.4.3", +"mysqlclient>= 2.0.1", +"pylint>= 2.5.3", +"pymonad", +"redis>= 3.5.3", +"requests>= 2.25.1", +"flask-cors", # with the `>= 3.0.9` specification, it breaks the build +"gn-libs @ git+https://git.genenetwork.org/gn-libs" +] +maintainers = [ +{name = "Frederick M. Muriithi", email = "fredmanglis@gmail.com"}, +] +license = "AGPL-3.0" +readme = {file = "README.md", content-type = "text/markdown"} + +[project.urls] +Homepage = "https://git.genenetwork.org/gn-auth/" +Repository = "https://git.genenetwork.org/gn-auth/" + +[dependency-groups]# PEP 735 +tests = ["pytest"] +checks = [{include-group = "tests"}, "mypy", "pylint", "vulture"] + +[tool.pylint.main] +ignore = ["tests", "venv"] +ignore-paths = ["^gn_auth/migrations/auth/.*"] +ignore-imports = true +disable = ["fixme", "duplicate-code", "no-else-return"] +load-plugins = ["pylint.extensions.no_self_use"] + +[tool.vulture] +ignore_decorators = [ +"@admin.before_request", +"@admin.route", +"@app.cli.command", +"@auth.route", +"@collections.route", +"@data.route", +"@genobp.route", +"@groups.route", +"@masq.route", +"@misc.route", +"@phenobp.route", +"@phenosbp.route", +"@popbp.route", +"@privileges.route", +"@resources.route", +"@roles.route", +"@system.route", +"@users.route" +] +exclude = ["*/tests/unit/*", "*/gn_auth/settings.py", "*/gn_auth/migrations/*"] +min_confidence = 60 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 41d118e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[aliases] -run_unit_tests = run_tests --type=unit -run_integration_tests = run_tests --type=integration -run_performance_tests = run_tests --type=performance diff --git a/setup.py b/setup.py deleted file mode 100755 index c7339e2..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -"""Setup script for GeneNetwork Auth package.""" -from setuptools import setup, find_packages -from setup_commands import RunTests - -LONG_DESCRIPTION = """ -gn-auth project is the authentication/authorisation server to be used -across all GeneNetwork services. -""" - -setup(author="Frederick M. Muriithi", - author_email="fredmanglis@gmail.com", - description=( - "Authentication/Authorisation server for GeneNetwork Services."), - install_requires=[ - "argon2-cffi>=20.1.0", - "click", - "Flask>=1.1.2", - "mypy>=0.790", - "mypy-extensions>=0.4.3", - "mysqlclient>=2.0.1", - "pylint>=2.5.3", - "pymonad", - "redis>=3.5.3", - "requests>=2.25.1", - "flask-cors", # with the `>=3.0.9` specification, it breaks the build - "gn-libs>=0.0.0" - ], - include_package_data=True, - packages=find_packages( - where=".", - exclude=( - "tests", - "tests.*", - "setup_commands", - "setup_commands.*")), - # `package_data` doesn't seem to work. Use MANIFEST.in instead - scripts=[], - license="AGPLV3", - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - name="gn-auth", - url="https://github.com/genenetwork/gn-auth", - version="0.0.1", - tests_require=["pytest", "hypothesis"], - cmdclass={ - "run_tests": RunTests # type: ignore[dict-item] - }) diff --git a/setup_commands/__init__.py b/setup_commands/__init__.py deleted file mode 100644 index 967bb11..0000000 --- a/setup_commands/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Module for custom setup commands.""" - -from .run_tests import RunTests diff --git a/setup_commands/run_tests.py b/setup_commands/run_tests.py deleted file mode 100644 index 1bb5dab..0000000 --- a/setup_commands/run_tests.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import sys -from distutils.core import Command - -class RunTests(Command): - """ - A custom command to run tests. - """ - description = "Run the tests" - test_types = ( - "all", "unit", "integration", "performance") - user_options = [ - ("type=", None, - f"""Specify the type of tests to run. - Valid types are {tuple(test_types)}. - Default is `all`.""")] - - def __init__(self, dist): - """Initialise the command.""" - super().__init__(dist) - self.command = "pytest" - - def initialize_options(self): - """Initialise the default values of all the options.""" - self.type = "all" - - def finalize_options(self): - """Set final value of all the options once they are processed.""" - if self.type not in RunTests.test_types: - raise Exception(f""" - Invalid test type (self.type) requested! - Valid types are - {tuple(RunTests.test_types)}""") - - if self.type != "all": - self.command = f"pytest -m {self.type}_test" - def run(self): - """Run the chosen tests""" - print(f"Running {self.type} tests") - os.system(self.command) |
