diff --git a/.github/workflows/pullrequest-push.yml b/.github/workflows/pullrequest-push.yml index c180393..d62c1d4 100644 --- a/.github/workflows/pullrequest-push.yml +++ b/.github/workflows/pullrequest-push.yml @@ -26,12 +26,13 @@ jobs: uses: ZeroGachis/.github/.github/workflows/run-docker.yml@v4 with: image_url: ${{ needs.build.outputs.image-url }} - workdir: /home/src/magicparse + workdir: /app vault_enabled: false tailscale_enabled: false run_command: | - black magicparse/ --check --diff - flake8 + poetry install --no-interaction --no-ansi --no-root --only dev + poetry run magicparse/ --check --diff + poetry run flake8 secrets: inherit unit-tests: @@ -42,9 +43,10 @@ jobs: uses: ZeroGachis/.github/.github/workflows/run-docker-with-db.yml@v4 with: image_url: ${{ needs.build.outputs.image-url }} - workdir: /home/src/magicparse + workdir: /app run_command: | - pytest --verbose --junit-xml reports/unit_tests_results.xml + poetry install --no-interaction --no-ansi --no-root --only dev + poetry run pytest --verbose --junit-xml reports/unit_tests_results.xml vault_enabled: false tailscale_enabled: false enable_test_report: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a52fb28..2727928 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,6 @@ jobs: if: ${{ needs.github-release.outputs.release_created == 'true' }} uses: ZeroGachis/.github/.github/workflows/python-publish.yml@v4 with: - python_version: "3.10" + python_version: "3.11" environment_name: main \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 30f3c21..cf5f9f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,12 @@ -FROM python:3.10-slim-bullseye +FROM 007065811408.dkr.ecr.eu-west-3.amazonaws.com/python-3-11:1 -RUN apt update && apt install -y git - -ENV POETRY_NO_INTERACTION=1 \ - POETRY_VIRTUALENVS_IN_PROJECT=1 \ - POETRY_CACHE_DIR=/tmp/poetry_cache \ - POETRY_VENV=/opt/poetry \ - POETRY_VERSION=1.7.1 \ - APP_DIR=/home/src/magicparse - -# Add poetry to PATH -ENV PATH="${PATH}:${POETRY_VENV}/bin" - -RUN python3 -m venv $POETRY_VENV \ - && $POETRY_VENV/bin/pip install -U pip setuptools \ - && $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION} - -WORKDIR $APP_DIR - -# Activate the app virtualenv -ENV APP_VENV="$APP_DIR/.venv" -ENV PATH="$APP_VENV/bin:$PATH" -RUN python3 -m venv $APP_VENV +WORKDIR /app COPY pyproject.toml poetry.lock ./ -RUN poetry install --no-root - -COPY . ./ +COPY . . -RUN poetry install +RUN poetry install --without dev && \ + poetry config http-basic.* --unset CMD ["bash"] diff --git a/docker-compose.yml b/docker-compose.yml index e02bb91..6605cfa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,11 @@ version: '3.0' services: - magicparse: build: context: . - args: - - USERNAME=magicparse tty: true - working_dir: /home/src/magicparse + working_dir: /app volumes: - - .:/home/src/magicparse - - /home/src/magicparse/.venv/ + - .:/app + - /app/.venv/ diff --git a/poetry.lock b/poetry.lock index 67ee4ee..266fd70 100644 --- a/poetry.lock +++ b/poetry.lock @@ -56,8 +56,6 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -79,10 +77,7 @@ files = [ [package.dependencies] jmespath = ">=0.7.1,<2.0.0" python-dateutil = ">=2.1,<3.0.0" -urllib3 = [ - {version = ">=1.25.4,<1.27", markers = "python_version < \"3.10\""}, - {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""}, -] +urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""} [package.extras] crt = ["awscrt (==0.21.2)"] @@ -123,20 +118,6 @@ files = [ {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, ] -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "flake8" version = "7.1.1" @@ -165,7 +146,6 @@ files = [ [package.dependencies] Flake8 = ">=5" -TOMLi = {version = "*", markers = "python_version < \"3.11\""} [package.extras] dev = ["pyTest", "pyTest-cov"] @@ -313,11 +293,9 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=1.5,<2" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] @@ -440,44 +418,6 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - -[[package]] -name = "typing-extensions" -version = "4.12.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, -] - -[[package]] -name = "urllib3" -version = "1.26.19" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" -files = [ - {file = "urllib3-1.26.19-py2.py3-none-any.whl", hash = "sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3"}, - {file = "urllib3-1.26.19.tar.gz", hash = "sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429"}, -] - -[package.extras] -brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - [[package]] name = "urllib3" version = "2.2.2" @@ -497,5 +437,5 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "5da20a17c510ea5a7c3f90f0b1462226a59f7600040231b5222730c0b4897f7e" +python-versions = "^3.11" +content-hash = "d48187e8b417a4ab67bb222fe4b0e8f40a34b5e6a2815360392b83ec0250ff53" diff --git a/pyproject.toml b/pyproject.toml index 2f9ae25..1300dd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ repository = "https://github.com/ZeroGachis/magicparse" [tool.poetry.dependencies] -python = "^3.9" +python = "^3.11" [tool.poetry.group.dev.dependencies] black = "^24.0.0"