From 54beb51fba930314c66b18ee01a328fab544237a Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Thu, 19 May 2022 19:24:50 +0200 Subject: [PATCH 1/3] chore: move source files into src folder Moved all of the source files into the src folder --- {keycloak => src/keycloak}/__init__.py | 0 {keycloak => src/keycloak}/_version.py | 0 {keycloak => src/keycloak}/authorization/__init__.py | 0 {keycloak => src/keycloak}/authorization/permission.py | 0 {keycloak => src/keycloak}/authorization/policy.py | 0 {keycloak => src/keycloak}/authorization/role.py | 0 {keycloak => src/keycloak}/connection.py | 0 {keycloak => src/keycloak}/exceptions.py | 0 {keycloak => src/keycloak}/keycloak_admin.py | 0 {keycloak => src/keycloak}/keycloak_openid.py | 0 {keycloak => src/keycloak}/urls_patterns.py | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {keycloak => src/keycloak}/__init__.py (100%) rename {keycloak => src/keycloak}/_version.py (100%) rename {keycloak => src/keycloak}/authorization/__init__.py (100%) rename {keycloak => src/keycloak}/authorization/permission.py (100%) rename {keycloak => src/keycloak}/authorization/policy.py (100%) rename {keycloak => src/keycloak}/authorization/role.py (100%) rename {keycloak => src/keycloak}/connection.py (100%) rename {keycloak => src/keycloak}/exceptions.py (100%) rename {keycloak => src/keycloak}/keycloak_admin.py (100%) rename {keycloak => src/keycloak}/keycloak_openid.py (100%) rename {keycloak => src/keycloak}/urls_patterns.py (100%) 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 From 04cc2feeeefe8bb2b83d175c72b79b11c8215ec0 Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Thu, 19 May 2022 19:26:19 +0200 Subject: [PATCH 2/3] chore: update setup py to find source files in src folder --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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}, From bc82de7989efc880cf1946e161a6747a73418e74 Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Thu, 19 May 2022 19:27:08 +0200 Subject: [PATCH 3/3] test: update the test framework Updated the tox framework to operate on files in src for checks, but in toxenv for tests --- docs/source/conf.py | 2 +- tox.ini | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) 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/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 =