diff --git a/docs/source/conf.py b/docs/source/conf.py index 3a70cb6..2b67d12 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -41,7 +41,7 @@ extensions = [ ] autoapi_type = "python" -autoapi_dirs = ["../../keycloak"] +autoapi_dirs = ["../../src/keycloak"] autoapi_root = "reference" autoapi_keep_files = False autoapi_add_toctree_entry = False diff --git a/setup.py b/setup.py index 86a6fb2..27a188d 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import re -from setuptools import setup + +from setuptools import find_packages, setup with open("README.md", "r") as fh: long_description = fh.read() @@ -15,7 +16,7 @@ with open("docs-requirements.txt", "r") as fh: docs_reqs = fh.read().split("\n") -VERSIONFILE = "keycloak/_version.py" +VERSIONFILE = "src/keycloak/_version.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) @@ -35,7 +36,8 @@ setup( description="python-keycloak is a Python package providing access to the Keycloak API.", long_description=long_description, long_description_content_type="text/markdown", - packages=["keycloak", "keycloak.authorization"], + packages=find_packages("src"), + package_dir={"": "src"}, install_requires=reqs, tests_require=dev_reqs, extras_require={"docs": docs_reqs}, diff --git a/keycloak/__init__.py b/src/keycloak/__init__.py similarity index 100% rename from keycloak/__init__.py rename to src/keycloak/__init__.py diff --git a/keycloak/_version.py b/src/keycloak/_version.py similarity index 100% rename from keycloak/_version.py rename to src/keycloak/_version.py diff --git a/keycloak/authorization/__init__.py b/src/keycloak/authorization/__init__.py similarity index 100% rename from keycloak/authorization/__init__.py rename to src/keycloak/authorization/__init__.py diff --git a/keycloak/authorization/permission.py b/src/keycloak/authorization/permission.py similarity index 100% rename from keycloak/authorization/permission.py rename to src/keycloak/authorization/permission.py diff --git a/keycloak/authorization/policy.py b/src/keycloak/authorization/policy.py similarity index 100% rename from keycloak/authorization/policy.py rename to src/keycloak/authorization/policy.py diff --git a/keycloak/authorization/role.py b/src/keycloak/authorization/role.py similarity index 100% rename from keycloak/authorization/role.py rename to src/keycloak/authorization/role.py diff --git a/keycloak/connection.py b/src/keycloak/connection.py similarity index 100% rename from keycloak/connection.py rename to src/keycloak/connection.py diff --git a/keycloak/exceptions.py b/src/keycloak/exceptions.py similarity index 100% rename from keycloak/exceptions.py rename to src/keycloak/exceptions.py diff --git a/keycloak/keycloak_admin.py b/src/keycloak/keycloak_admin.py similarity index 100% rename from keycloak/keycloak_admin.py rename to src/keycloak/keycloak_admin.py diff --git a/keycloak/keycloak_openid.py b/src/keycloak/keycloak_openid.py similarity index 100% rename from keycloak/keycloak_openid.py rename to src/keycloak/keycloak_openid.py diff --git a/keycloak/urls_patterns.py b/src/keycloak/urls_patterns.py similarity index 100% rename from keycloak/urls_patterns.py rename to src/keycloak/urls_patterns.py diff --git a/tox.ini b/tox.ini index 2726f66..54b2c2b 100644 --- a/tox.ini +++ b/tox.ini @@ -10,9 +10,9 @@ deps = isort flake8 commands = - black --check --diff keycloak tests docs - isort -c --df keycloak tests docs - flake8 keycloak tests docs + black --check --diff src/keycloak tests docs setup.py + isort -c --df src/keycloak tests docs setup.py + flake8 src/keycloak tests docs setup.py [testenv:apply-check] deps = @@ -20,9 +20,9 @@ deps = isort flake8 commands = - black -C keycloak tests docs - black keycloak tests docs - isort keycloak tests docs + black -C src/keycloak tests docs setup.py + black src/keycloak tests docs setup.py + isort src/keycloak tests docs setup.py [testenv:docs] deps =