From 51ee7f728c77f529ec6b0972d7a42a51226a30ff Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 17 Feb 2024 03:13:34 +0300 Subject: [PATCH] less-versioning-py --- Dockerfile | 8 ++-- pyproject.toml | 108 ----------------------------------------------- requirements.txt | 8 ++++ 3 files changed, 11 insertions(+), 113 deletions(-) delete mode 100644 pyproject.toml create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 3e36460..d53dd7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use an official Python runtime as a parent image -FROM python:3.12-alpine +FROM python:alpine # Set the working directory in the container to /app WORKDIR /app @@ -12,10 +12,8 @@ COPY . /app # Install any needed packages specified in pyproject.toml RUN apk update && apk add --no-cache gcc curl && \ - curl -sSL https://install.python-poetry.org | python - && \ - export PATH=$PATH:/root/.local/bin && \ - poetry config virtualenvs.create false && \ - poetry install --no-dev + +RUN pip install -r requirements.txt --no-cache # Run server.py when the container launches CMD ["python", "server.py"] diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 4daf5fb..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,108 +0,0 @@ -[tool.poetry] -name = "discoursio-notifier" -version = "0.3.0" -description = "notifier server for discours.io" -authors = ["Tony Rewin "] - -[tool.poetry.dependencies] -python = "^3.12" -SQLAlchemy = "^2.0.22" -psycopg2-binary = "^2.9.9" -redis = {extras = ["hiredis"], version = "^5.0.1"} -strawberry-graphql = {extras = ["asgi", "debug-server"], version = "^0.216.1" } -strawberry-sqlalchemy-mapper = "^0.4.0" -sentry-sdk = "^1.37.1" -aiohttp = "^3.9.1" -granian = "^1.0.2" - -[tool.poetry.group.dev.dependencies] -setuptools = "^69.0.2" -isort = "^5.13.2" -pyright = "^1.1.341" -mypy = "^1.7.1" -ruff = "^0.1.15" -black = "^23.12.0" -pytest = "^7.4.3" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.ruff] -line-length = 120 -extend-select = [ - # E and F are enabled by default - 'B', # flake8-bugbear - 'C4', # flake8-comprehensions - 'C90', # mccabe - 'I', # isort - 'N', # pep8-naming - 'Q', # flake8-quotes - 'RUF100', # ruff (unused noqa) - 'S', # flake8-bandit - 'W', # pycodestyle -] -extend-ignore = [ - 'B008', # function calls in args defaults are fine - 'B009', # getattr with constants is fine - 'B034', # re.split won't confuse us - 'B904', # rising without from is fine - 'E501', # leave line length to black - 'N818', # leave to us exceptions naming - 'S101', # assert is fine - 'RUF100', # black's noqa -] -flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' } -mccabe = { max-complexity = 13 } -target-version = "py312" - -[tool.ruff.format] -quote-style = 'single' - -[tool.black] -skip-string-normalization = true - -[tool.ruff.isort] -combine-as-imports = true -lines-after-imports = 2 -known-first-party = ['resolvers', 'services', 'orm', 'tests'] - -[tool.ruff.per-file-ignores] -'tests/**' = ['B018', 'S110', 'S501'] - -[tool.mypy] -python_version = "3.12" -warn_return_any = true -warn_unused_configs = true -ignore_missing_imports = true -exclude = ["nb"] - -[tool.pytest.ini_options] -asyncio_mode = 'auto' - -[tool.pyright] -venvPath = "." -venv = ".venv" -include = ["."] -useLibraryCodeForTypes = true -disableLanguageServices = false -disableOrganizeImports = false -reportMissingImports = false -reportMissingModuleSource = "warning" -reportImportCycles = "warning" -maxMemoryForLargeFile = 4096 -pythonVersion = "3.12" -autoImportCompletions = true -useVirtualEnv = true -typeCheckingMode = "basic" -disableJediCompletion = false -disableCompletion = false -disableSnippetCompletion = false -disableGoToDefinition = false -disableRenaming = false -disableSignatureHelp = false -diagnostics = true -logLevel = "Information" -pluginSearchPaths = [] -typings = {} -mergeTypeStubPackages = false diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..836ab72 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +aiohttp +strawberry-sqlalchemy-mapper +redis[hiredis] +psycopg2-binary +sqlalchemy +strawberry-graphql[asgi,debug-server] +granian +sentry-sdk[strawberry]