Skip to content

Commit

Permalink
fix(api): fix install failing without mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz committed Jan 11, 2023
1 parent 1b9f486 commit b984054
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python-version: "3.8"
cache: "poetry"
- name: Install dependencies
run: poetry install
run: poetry install --all-extras
- name: Run gitlint
run: poetry run gitlint --contrib contrib-title-conventional-commits
- name: Run flake8
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends util-linux unoconv libreoffice-writer
poetry install
poetry install --all-extras
- name: Set environment
run: |
echo "ENV=dev" >> .env
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV MEDIA_ROOT /var/lib/document-merge-service/media

ARG ENV=docker
COPY pyproject.toml poetry.lock $APP_HOME/
RUN poetry install $([ "$ENV" = "dev" ] || echo "--without dev") --no-interaction --no-ansi
RUN poetry install $([ "$ENV" = "dev" ] || echo "--without dev") --no-interaction --no-ansi --all-extras
COPY . $APP_HOME

EXPOSE 8000
Expand Down
11 changes: 8 additions & 3 deletions poetry.lock

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

10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ docx-mailmerge = "^0.5.0"
docxtpl = "^0.16.4"
Jinja2 = "^3.1.2"
jsonpath = "^0.82"
mysqlclient = "^2.1.1"
psycopg2-binary = "^2.9.5"
mysqlclient = { version = "^2.1.1", optional = true }
psycopg2-binary = { version = "^2.9.5", optional = true }
python-dateutil = "^2.8.2"
python-memcached = "^1.59"
requests = "^2.28.1"
uWSGI = "^2.0.21"
xltpl = "^0.16"
openpyxl = "^3.0.10"
django-generic-api-permissions = "^0.2.0"

[tool.poetry.group.dev.dependencies]
black = "22.10.0"
Expand Down Expand Up @@ -57,6 +58,11 @@ types-requests = "2.28.11.5"
types-setuptools = "65.5.0.3"
types-toml = "0.10.8.1"

[tool.poetry.extras]
mysql = ["mysqlclient"]
pgsql = ["psycopg2-binary"]
databases = ["mysqlclient", "psycopg2-binary"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down

0 comments on commit b984054

Please sign in to comment.