Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to python 3.11 #39

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 black 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"]
16 changes: 16 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: magicparse
description: Declarative parser
annotations:
github.com/project-slug: ZeroGachis/magicparse
tags:
- python
- python-3-11
- backend
spec:
type: library
lifecycle: production
system: FWMS
owner: FWMS_Squad
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