diff --git a/.deprecated_files b/.deprecated_files index ca3684e0..af2a4cf8 100644 --- a/.deprecated_files +++ b/.deprecated_files @@ -21,3 +21,4 @@ setup.cfg .pylintrc .flake8 +.editorconfig diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ee5192f9..89ff58f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,69 +1,75 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/python-3 +// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/python-3-postgres +// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6 { - "name": "hexkit", + "name": "${localWorkspaceFolderBasename}", "dockerComposeFile": "docker-compose.yml", - "service": "hexkit", + "service": "app", "workspaceFolder": "/workspace", - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "python.pythonPath": "/usr/local/bin/python", - "python.languageServer": "Pylance", - "python.linting.enabled": true, - "python.linting.pylintEnabled": true, - "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.formatting.provider": "black", - "editor.formatOnSave": true, - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", - "python.testing.pytestPath": "/usr/local/py-utils/bin/pytest", - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "editor.renderWhitespace": "all", - "editor.rulers": [ - 88 - ], - "licenser.license": "Custom", - "licenser.customHeaderFile": "/workspace/.devcontainer/license_header.txt" + "customizations": { + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "files.eol": "\n", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash" + } + }, + "python.pythonPath": "/usr/local/bin/python", + "python.languageServer": "Pylance", + "python.analysis.typeCheckingMode": "basic", + "python.testing.pytestPath": "/usr/local/py-utils/bin/pytest", + "python.testing.pytestArgs": [ + "--profile" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.renderWhitespace": "all", + "editor.rulers": [ + 88 + ], + "editor.defaultFormatter": "ms-python.black-formatter", + "licenser.license": "Custom", + "licenser.customHeaderFile": "/workspace/.devcontainer/license_header.txt" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "mikestead.dotenv", + "ms-azuretools.vscode-docker", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-toolsai.jupyter", + "njpwerner.autodocstring", + "redhat.vscode-yaml", + "42crunch.vscode-openapi", + "arjun.swagger-viewer", + "eamodio.gitlens", + "github.vscode-pull-request-github", + "streetsidesoftware.code-spell-checker", + "yzhang.markdown-all-in-one", + "visualstudioexptteam.vscodeintellicode", + "ymotongpoo.licenser", + "charliermarsh.ruff", + "ms-python.black-formatter", + "ms-python.mypy-type-checker" + ] + } }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "mtxr.sqltools", - "mtxr.sqltools-driver-pg", - "42crunch.vscode-openapi", - "eamodio.gitlens", - "formulahendry.terminal", - "tyriar.terminal-tabs", - "alexcvzz.vscode-sqlite", - "njpwerner.autodocstring", - "arjun.swagger-viewer", - "ms-toolsai.jupyter", - "redhat.vscode-yaml", - "ymotongpoo.licenser", - "ms-azuretools.vscode-docker" - ], // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // "forwardPorts": [5000, 5432], // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "dev_install", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "version": "latest", - "enableNonRootDocker": "true", - "moby": true, - "azureDnsAutoDetection": false - } + "containerEnv": { + // for testcontainers to connect to the docker host: + "TC_HOST": "host.docker.internal", + "DOCKER_HOST": "unix:///var/run/docker.sock" }, - "forwardPorts": [ - "kafka-ui:8080" - ] -} \ No newline at end of file + "features": { + // details can be found here: https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} + } +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index ee18e9bf..44a67e76 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: - hexkit: + app: build: context: . dockerfile: ./Dockerfile diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 3fa06b52..00000000 --- a/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -# Top-most EditorConfig file. -root = true - -# For all files ... -[*] - -# Unix-style LF newlines. -end_of_line = lf - -# Force a newline at the end of the file. -insert_final_newline = true - -# Use UTF-8. -charset = utf-8 diff --git a/.mandatory_files b/.mandatory_files index c0b51fb1..ba9f6c31 100644 --- a/.mandatory_files +++ b/.mandatory_files @@ -6,9 +6,7 @@ # may differ from that of the template repository. .devcontainer/dev_launcher -.devcontainer/devcontainer.json .devcontainer/docker-compose.yml -.devcontainer/Dockerfile tests/__init__.py tests/fixtures/__init__.py diff --git a/.static_files b/.static_files index e3c8f767..5f035a96 100644 --- a/.static_files +++ b/.static_files @@ -11,6 +11,7 @@ .devcontainer/dev_install .devcontainer/license_header.txt .devcontainer/Dockerfile +.devcontainer/devcontainer.json scripts/script_utils/__init__.py scripts/script_utils/cli.py @@ -39,7 +40,6 @@ scripts/README.md example_data/README.md .coveragerc -.editorconfig .gitattributes .gitignore .mypy.ini diff --git a/pyproject.toml b/pyproject.toml index b7b76b99..4f6c68fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "hexkit" -version = "0.11.0" +version = "0.11.1" description = "A Toolkit for Building Microservices using the Hexagonal Architecture" readme = "README.md" authors = [ @@ -47,3 +47,6 @@ Repository = "https://github.com/ghga-de/hexkit" [tool.setuptools.packages.find] where = ["src"] + +[tool.setuptools.package-data] +"hexkit.providers.s3.test_files" = ["*.yaml"] diff --git a/requirements-dev.txt b/requirements-dev.txt index be5f5e8c..e7c617f1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --all-extras --generate-hashes --output-file=/workspace/requirements-dev.txt /tmp/tmpkllxpg08/pyproject.toml /workspace/requirements-dev.in +# pip-compile --all-extras --generate-hashes --output-file=/workspace/requirements-dev.txt /tmp/tmpye1zf3r4/pyproject.toml /workspace/requirements-dev.in # aiokafka==0.8.1 \ --hash=sha256:1e24839088fd6d3ff481cc09a48ea487b997328df11630bc0a1b88255edbcfe9 \ @@ -252,7 +252,9 @@ coverage[toml]==7.3.2 \ --hash=sha256:f94b734214ea6a36fe16e96a70d941af80ff3bfd716c141300d95ebc85339738 \ --hash=sha256:fa28e909776dc69efb6ed975a63691bc8172b64ff357e663a1bb06ff3c9b589a \ --hash=sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4 - # via pytest-cov + # via + # coverage + # pytest-cov dependency-injector==4.41.0 \ --hash=sha256:02620454ee8101f77a317f3229935ce687480883d72a40858ff4b0c87c935cce \ --hash=sha256:059fbb48333148143e8667a5323d162628dfe27c386bd0ed3deeecfc390338bf \ @@ -944,7 +946,9 @@ stringcase==1.2.0 \ # via -r /workspace/requirements-dev-common.in testcontainers[kafka,mongo]==3.7.1 \ --hash=sha256:7f48cef4bf0ccd78f1a4534d4b701a003a3bace851f24eae58a32f9e3f0aeba0 - # via hexkit (pyproject.toml) + # via + # hexkit (pyproject.toml) + # testcontainers tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f diff --git a/requirements.txt b/requirements.txt index 027e9bf9..bbf5063f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --all-extras --constraint=/workspace/requirements-dev.txt --generate-hashes --output-file=/workspace/requirements.txt /tmp/tmpkllxpg08/pyproject.toml +# pip-compile --all-extras --constraint=/workspace/requirements-dev.txt --generate-hashes --output-file=/workspace/requirements.txt /tmp/tmpye1zf3r4/pyproject.toml # aiokafka==0.8.1 \ --hash=sha256:1e24839088fd6d3ff481cc09a48ea487b997328df11630bc0a1b88255edbcfe9 \ @@ -714,6 +714,7 @@ testcontainers[kafka,mongo]==3.7.1 \ # via # -c /workspace/requirements-dev.txt # hexkit (pyproject.toml) + # testcontainers typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef