Skip to content

Commit

Permalink
feat: update to python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbriere1 committed Aug 27, 2024
1 parent fd4054e commit f4864ed
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 103 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/pullrequest-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

32 changes: 5 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
9 changes: 3 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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/
66 changes: 3 additions & 63 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f4864ed

Please sign in to comment.