Skip to content

Commit

Permalink
(update) python modules structures and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Nov 7, 2023
1 parent 9449b9c commit 38f55e3
Show file tree
Hide file tree
Showing 1,571 changed files with 87 additions and 85 deletions.
4 changes: 2 additions & 2 deletions bin/run-sdk-tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
source "bin/activate-env"

echo "running sdk tests with python unittest"
python -m unittest discover -v -f modules/karrio/tests || exit 1;
packages=$(find modules/connections -type d -name "tests" -exec dirname '{}' \;)
python -m unittest discover -v -f modules/sdk/tests || exit 1;
packages=$(find modules/connectors -type d -name "tests" -exec dirname '{}' \;)
for module in ${packages}; do
python -m unittest discover -v -f ${module}/tests || exit $?;
done
4 changes: 2 additions & 2 deletions bin/run-sdk-typecheck
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ source "bin/activate-env" > /dev/null 2>&1
echo "running sdk typecheck with mypy"


for submodule in $(find "modules/karrio" -type f -name "__init__.py" ! -path "*tests*" ! -path "*schemas*" -exec dirname '{}' \;); do
for submodule in $(find "modules/sdk" -type f -name "__init__.py" ! -path "*tests*" ! -path "*schemas*" -exec dirname '{}' \;); do
mypy ${submodule} || exit $?;
done;

packages=$(find "modules/connections" -type f -name "setup.py" -exec dirname '{}' \;)
packages=$(find "modules/connectors" -type f -name "setup.py" -exec dirname '{}' \;)
for module in ${packages}; do
for submodule in $(find ${module} -type f -name "__init__.py" ! -path "*tests*" ! -path "*schemas*" -exec dirname '{}' \;); do
mypy ${submodule} || exit $?;
Expand Down
2 changes: 1 addition & 1 deletion bin/sdk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source "bin/activate-env" > /dev/null 2>&1
if [[ "$*" == *build:pkgs* ]]; then
cd "${ROOT:?}"
rm -rf ${DIST}/*
sm=$(find "${ROOT:?}/packages/connections" -type f -name "setup.py" ! -path "*$ENV_DIR/*" -prune -exec dirname '{}' \; 2>&1 | grep -v 'permission denied')
sm=$(find "${ROOT:?}/modules/connectors" -type f -name "setup.py" ! -path "*$ENV_DIR/*" -prune -exec dirname '{}' \; 2>&1 | grep -v 'permission denied')

for module in ${sm}; do
./bin/build-package-wheel "${module}" || exit 1
Expand Down
14 changes: 8 additions & 6 deletions cli/commands/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

BASE_DIR = pathlib.Path(__file__).resolve().parent.parent.parent

ROOT_DIR = string.Template(f"{BASE_DIR}/modules/connections/$id")
SCHEMAS_DIR = string.Template(f"{BASE_DIR}/modules/connections/$id/schemas")
TESTS_DIR = string.Template(f"{BASE_DIR}/modules/connections/$id/tests/$id")
MAPPERS_DIR = string.Template(f"{BASE_DIR}/modules/connections/$id/karrio/mappers/$id")
PROVIDERS_DIR = string.Template(f"{BASE_DIR}/modules/connections/$id/karrio/providers/$id")
ROOT_DIR = string.Template(f"{BASE_DIR}/modules/connectors/$id")
SCHEMAS_DIR = string.Template(f"{BASE_DIR}/modules/connectors/$id/schemas")
TESTS_DIR = string.Template(f"{BASE_DIR}/modules/connectors/$id/tests/$id")
MAPPERS_DIR = string.Template(f"{BASE_DIR}/modules/connectors/$id/karrio/mappers/$id")
PROVIDERS_DIR = string.Template(
f"{BASE_DIR}/modules/connectors/$id/karrio/providers/$id"
)
SCHEMA_DATATYPES_DIR = string.Template(
f"{BASE_DIR}/modules/connections/$id/karrio/schemas/$id"
f"{BASE_DIR}/modules/connectors/$id/karrio/schemas/$id"
)


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 38f55e3

Please sign in to comment.