diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0fa819e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +{ + "name": "Ecoindex python full stack dev container", + "image": "mcr.microsoft.com/devcontainers/python:3.12", + "postCreateCommand": "pipx install poetry && poetry self add poetry-multiproject-plugin && poetry self add poetry-polylith-plugin", + "features": { + "ghcr.io/audacioustux/devcontainers/taskfile": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "installDockerBuildx": true, + "version": "latest", + "dockerDashComposeVersion": "v2" + } + }, + "forwardPorts": [ + 8000 + ], + "customizations": { + "vscode": { + "extensions": [ + "-ms-python.autopep8", + "adrianwilczynski.alpine-js-intellisense", + "adrianwilczynski.alpine-js-intellisense", + "bierner.markdown-emoji", + "charliermarsh.ruff", + "Codeium.codeium", + "github.vscode-github-actions", + "Gruntfuggly.todo-tree", + "mhutchie.git-graph", + "ms-azuretools.vscode-docker", + "ms-python.mypy-type-checker", + "ms-python.python", + "Perkovec.emoji", + "samuelcolvin.jinjahtml", + "tamasfe.even-better-toml", + "ue.alphabetical-sorter", + "yzhang.markdown-all-in-one", + "esbenp.prettier-vscode", + "ms-pyright.pyright", + "-ms-python.vscode-pylance" + ] + } + } +} \ No newline at end of file diff --git a/projects/ecoindex_api/Taskfile.yml b/projects/ecoindex_api/Taskfile.yml index d6b9cae..26920d0 100644 --- a/projects/ecoindex_api/Taskfile.yml +++ b/projects/ecoindex_api/Taskfile.yml @@ -170,7 +170,7 @@ tasks: start-backend: internal: true cmds: - - poetry run uvicorn ecoindex.backend.main:app --reload --reload-dir ../.. + - poetry run uvicorn ecoindex.backend.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir ../.. silent: true start-dev: diff --git a/projects/ecoindex_api/poetry.lock b/projects/ecoindex_api/poetry.lock index 54403f7..ce6c229 100644 --- a/projects/ecoindex_api/poetry.lock +++ b/projects/ecoindex_api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "aiofile" @@ -1157,6 +1157,26 @@ starlette = ["starlette (>=0.19.1)"] starlite = ["starlite (>=1.48)"] tornado = ["tornado (>=6)"] +[[package]] +name = "setuptools" +version = "75.6.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.9" +files = [ + {file = "setuptools-75.6.0-py3-none-any.whl", hash = "sha256:ce74b49e8f7110f9bf04883b730f4765b774ef3ef28f722cce7c273d253aaf7d"}, + {file = "setuptools-75.6.0.tar.gz", hash = "sha256:8199222558df7c86216af4f84c30e9b34a61d8ba19366cc914424cdbd28252f6"}, +] + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.7.0)"] +core = ["importlib_metadata (>=6)", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (>=1.12,<1.14)", "pytest-mypy"] + [[package]] name = "six" version = "1.16.0" @@ -1420,4 +1440,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "443389b3c90c22d2f174b741f515d6619ab87f2b98b5cb5204d8118b4c9926b7" +content-hash = "87e21aab53c4d2386c8ac90e8b76f56ae845d21955ce7607db804eb5ac4c8ec0" diff --git a/projects/ecoindex_api/pyproject.toml b/projects/ecoindex_api/pyproject.toml index 7a15218..020a350 100644 --- a/projects/ecoindex_api/pyproject.toml +++ b/projects/ecoindex_api/pyproject.toml @@ -38,6 +38,7 @@ redis = "^5.0.1" requests = "^2.32.2" sqlmodel = "^0.0.14" sentry-sdk = "^2.8.0" +setuptools = "^75.6.0" [tool.poetry.group.backend.dependencies] uvicorn = "^0.23.2" diff --git a/pyproject.toml b/pyproject.toml index 35f203b..2930e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,6 +85,9 @@ update-values = "ecoindex.scripts:update_values" filterwarnings = ["ignore::DeprecationWarning"] [tool.mypy] +mypy_path = ["bases", "components"] +namespace_packages = true +explicit_package_bases = true ignore_missing_imports = true disallow_untyped_defs = false exclude = ["test", "dist", "__pycache__"] @@ -94,3 +97,6 @@ omit = ["test/*"] [tool.coverage.report] skip_empty = true + +[tool.pyright] +extraPaths = ["bases", "components"]