Skip to content

Commit

Permalink
feat: migrate to Pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
egvimo committed Oct 30, 2023
1 parent c343430 commit 04e140a
Show file tree
Hide file tree
Showing 5 changed files with 720 additions and 10 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,38 @@ jobs:
- name: Prepare
run: |
sudo apt install libapt-pkg-dev
pip install pylint
pip install pipenv
- name: Install dependencies
run: pip install -r requirements.txt
run: pipenv install --dev

- name: Lint
run: pylint app.py apt_info.py
run: pipenv run pylint app.py apt_info.py

test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Prepare
run: |
sudo apt install libapt-pkg-dev
pip install pipenv
- name: Install dependencies
run: pipenv install --dev

- name: Test
run: pipenv run pytest test_app.py

test:
name: Test
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ RUN apt update && apt install -y \

WORKDIR /app

COPY requirements.txt app.py apt_info.py ./
COPY Pipfile Pipfile.lock app.py apt_info.py ./

RUN pip install --no-cache-dir --upgrade -r requirements.txt \
&& rm requirements.txt
RUN pipenv install --deploy --ignore-pipfile

EXPOSE 8000

Expand Down
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
python-apt = {ref = "2.5.3", git = "https://salsa.debian.org/apt-team/python-apt.git"}
prometheus_client = "==0.17.1"
fastapi = "==0.104.0"
uvicorn = {version = "==0.23.2", extras = ["standard"]}

[dev-packages]
pylint = "==3.0.2"
pytest = "==7.4.3"
httpx = "==0.25.0"
Loading

0 comments on commit 04e140a

Please sign in to comment.