From 856fc667170d21ae5aba996bcc356ca44412e10d Mon Sep 17 00:00:00 2001 From: Alexandre Teles Date: Sat, 29 Apr 2023 18:14:26 -0300 Subject: [PATCH] feat: project init --- .devcontainer/Dockerfile | 45 +++++++++++++++++++++++ .devcontainer/devcontainer.json | 65 +++++++++++++++++++++++++++++++++ mypy.ini | 17 +++++++++ pyproject.toml | 17 +++++++++ 4 files changed, 144 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 mypy.ini create mode 100644 pyproject.toml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..1f830b1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,45 @@ +FROM mcr.microsoft.com/devcontainers/base:jammy +# FROM mcr.microsoft.com/devcontainers/base:jammy + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER=vscode + +RUN DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get install -y build-essential --no-install-recommends make \ + ca-certificates \ + git \ + libssl-dev \ + zlib1g-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + wget \ + curl \ + llvm \ + libncurses5-dev \ + xz-utils \ + tk-dev \ + libxml2-dev \ + libxmlsec1-dev \ + libffi-dev \ + liblzma-dev + +# Python and poetry installation +USER $USER +ARG HOME="/home/$USER" +ARG PYTHON_VERSION=3.11 +# ARG PYTHON_VERSION=3.10 + +ENV PYENV_ROOT="${HOME}/.pyenv" +ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH" + +RUN echo "done 0" \ + && curl https://pyenv.run | bash \ + && echo "done 1" \ + && pyenv install ${PYTHON_VERSION} \ + && echo "done 2" \ + && pyenv global ${PYTHON_VERSION} \ + && echo "done 3" \ + && curl -sSL https://install.python-poetry.org | python3 - \ + && poetry config virtualenvs.in-project true \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0890542 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,65 @@ +{ + "name": "poetry3-poetry-pyenv", + "build": { + "dockerfile": "Dockerfile" + }, + + // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features. + // "features": {}, + + // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // 👇 Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "", + + // 👇 Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "njpwerner.autodocstring", + "ms-azuretools.vscode-docker", + "github.copilot-labs", + "github.copilot-nightly", + "eamodio.gitlens", + "visualstudioexptteam.intellicode-api-usage-examples", + "ms-python.isort", + "ms-vsliveshare.vsliveshare", + "matangover.mypy", + "ms-python.vscode-pylance", + "mgesbert.python-path", + "zeshuaro.vscode-python-poetry", + "njqdev.vscode-python-typehint", + "ms-python.black-formatter" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/sshd:1": {}, + "ghcr.io/devcontainers-contrib/features/black:2": {}, + "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/ffmpeg-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/micro:1": {}, + "ghcr.io/devcontainers-contrib/features/mosh-apt-get:1": {}, + "ghcr.io/devcontainers-contrib/features/mypy:2": {}, + "ghcr.io/devcontainers-contrib/features/poetry:2": {}, + "ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {}, + "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}, + "ghcr.io/jckimble/devcontainer-features/ngrok:3": {}, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "configureZshAsDefaultShell": true, + "installOhMyZsh": true, + "upgradePackages": true, + "username": "codespace", + "userUid": "automatic", + "userGid": "automatic" + } + } + + // 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..4d522d8 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,17 @@ +[mypy] +python_version = 3.10 +pretty = true +follow_imports = normal +namespace_packages = true +show_column_numbers = true +show_error_codes = true +allow_redefinition = false +check_untyped_defs = true +implicit_reexport = false +strict_optional = true +strict_equality = true +warn_no_return = true +warn_redundant_casts = true +warn_unused_configs = true +warn_unused_ignores = true +warn_unreachable = true diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5a1e258 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[tool.poetry] +name = "revanced-api" +version = "0.1.0" +description = "" +authors = ["Alexandre Teles "] +license = "AGPLv3" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" + +[tool.poetry.dev-dependencies] +mypy = ">=1.2.0" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"