Skip to content

Commit

Permalink
Merge pull request #635 from bcgov/poetry-support
Browse files Browse the repository at this point in the history
Migrate vc-authn to use poetry for dependancy managment
  • Loading branch information
esune committed Sep 17, 2024
2 parents f1f9cd9 + 5ed48d5 commit eb4f86f
Show file tree
Hide file tree
Showing 7 changed files with 2,142 additions and 38 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/controller_unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ jobs:
- name: Install dependencies
working-directory: ./oidc-controller
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
pip3 install --no-cache-dir poetry
poetry install
- name: Lint with black
working-directory: ./oidc-controller
run: |
flake8 . --count --show-source --statistics
poetry run black --check .
- name: Test with pytest
working-directory: ./oidc-controller
run: |
pytest --log-cli-level=INFO --cov --cov-report lcov
poetry run pytest --log-cli-level=INFO --cov --cov-report lcov
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
Expand Down
11 changes: 7 additions & 4 deletions docker/oidc-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ FROM python:3.11 as main

WORKDIR /app

COPY oidc-controller/requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
ENV POETRY_VIRTUALENVS_CREATE=false
RUN pip3 install --no-cache-dir poetry

COPY oidc-controller ./
COPY pyproject.toml poetry.lock README.md ./
RUN poetry install --only main

COPY ./oidc-controller .

EXPOSE 5000

RUN ["chmod", "+x", "./docker-entrypoint.sh"]

ENTRYPOINT ["./docker-entrypoint.sh"]
ENTRYPOINT ["./docker-entrypoint.sh"]
7 changes: 0 additions & 7 deletions oidc-controller/pyproject.toml

This file was deleted.

9 changes: 0 additions & 9 deletions oidc-controller/requirements-dev.txt

This file was deleted.

12 changes: 0 additions & 12 deletions oidc-controller/requirements.txt

This file was deleted.

2,082 changes: 2,082 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[tool.poetry]
name = "vc-authn-oidc"
version = "0.2.2"
description = "Verifiable Credential Identity Provider for OpenID Connect."
authors = ["Government of British Columbia <[DItrust@gov.bc.ca](mailto:DItrust@gov.bc.ca)>"]
license = "Apache-2.0"
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
]
repository = "https://github.com/bcgov/vc-authn-oidc"

[tool.poetry.dependencies]
python = ">=3.11,<4.0"
fastapi = "^0.111.0"
jinja2 = "^3.1.4"
oic = "^1.7.0"
pymongo = "^4.7.3"
pyop = "^3.4.1"
python-multipart = "^0.0.9" # required by fastapi to serve/upload files
qrcode = { version = "^7.4.2", extras = ["pil"]}
structlog = "^24.2.0"
uvicorn = { version = "^0.30.1", extras = ["standard"] }
python-socketio = "^5.11.3" # required to run websockets
canonicaljson = "^2.0.0" # used to provide unique consistent user identifiers"
pydantic-settings = "^2.3.3"

[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
mock = "^5.1.0"
mongomock = "^4.1.2"
pytest-asyncio = "^0.23.7"
pytest-cov = "^5.0.0"
pytest = "^8.2.2"
requests-mock = "^1.12.1"
setuptools = "^75.1.0"

[tool.pytest.ini_options]
testpaths = "oidc-controller"

[tool.pyright]
pythonVersion = "3.11"

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

0 comments on commit eb4f86f

Please sign in to comment.