Skip to content

Commit

Permalink
Migrated from pipenv to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-babic committed Apr 4, 2024
1 parent 8908d89 commit 5c90782
Show file tree
Hide file tree
Showing 8 changed files with 1,736 additions and 1,256 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
- name: Install dependecies
uses: VaultVulp/[email protected]
with:
command: install -d
run: poetry install
- name: Execute pre-commit
uses: VaultVulp/[email protected]
with:
command: run pre-commit run -a --color=always --show-diff-on-failure
run: poetry run pre-commit run -a --color=always --show-diff-on-failure
- name: Execute Unit Tests
uses: VaultVulp/[email protected]
with:
command: run make test
run: poetry run make test
13 changes: 4 additions & 9 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
- name: Install dependecies
uses: VaultVulp/[email protected]
with:
command: install -d
run: poetry install
- name: Execute pre-commit
uses: VaultVulp/[email protected]
with:
command: run pre-commit run -a --color=always --show-diff-on-failure
run: poetry run pre-commit run -a --color=always --show-diff-on-failure
- name: Execute Unit Tests
uses: VaultVulp/[email protected]
with:
command: run make test
run: poetry run make test
build-and-push-to-gcr:
needs:
- test
Expand Down
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ FROM python:3.10-slim

WORKDIR /app

RUN pip3 install pipenv
RUN apt update && \
apt install -y curl && \
curl -sSL https://install.python-poetry.org | env POETRY_HOME=/usr/local python3 -

COPY Pipfile* ./
RUN pipenv install --dev
COPY pyproject.toml ./
COPY poetry.lock ./
RUN poetry install

COPY src src

ENTRYPOINT [ "pipenv", "run", "python", "src/main.py" ]
ENTRYPOINT [ "poetry", "run", "python", "src/main.py" ]
26 changes: 0 additions & 26 deletions Pipfile

This file was deleted.

1,205 changes: 0 additions & 1,205 deletions Pipfile.lock

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
Requirements:

- Python 3.10+
- Pipenv
- [Poetry](curl -sSL https://install.python-poetry.org | python3 -)
- Make

#### Setup

```shell
pipenv install --dev
pipenv shell
poetry install
poetry shell
make init
```

Expand Down
1,683 changes: 1,683 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
[tool.poetry]
name = "py-generic-boilerplate"
version = "0.1.0"
description = "Boilerplate to kick-off your python service."
authors = ["Aleksandar Babic <[email protected]>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
python-dotenv = "^1.0.1"

[tool.poetry.group.dev.dependencies]
isort = "^5.13.2"
flake8 = "^7.0.0"
radon = "^6.0.1"
bandit = "^1.7.8"
assertpy = "^1.1"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
responses = "^0.25.0"
mypy = "^1.9.0"
requests = "^2.31.0"
types-jsonschema = "^4.21.0.20240331"
pre-commit = "^3.7.0"
safety = "^3.1.0"
black = "^24.3.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[virtualenvs]
in-project = true

[tool.black]
line-length = 120

Expand Down

0 comments on commit 5c90782

Please sign in to comment.