From ff180ff5cc728625f9b5594e99d8d0374f264155 Mon Sep 17 00:00:00 2001 From: Rust Saiargaliev Date: Fri, 27 Oct 2023 10:44:22 +0200 Subject: [PATCH] Separate dependency group for bakery --- .github/workflows/ci.yml | 2 +- pyproject.toml | 2 +- tests/test_baker_generators.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4ed16b..a0cdc6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - run: python -m pip install .[test] + - run: python -m pip install .[test,bakery] - run: python -m pip install django~=${{ matrix.django-version }}.0 if: matrix.django-version != 'latest' - run: python -m pip install git+https://github.com/django/django.git@main#egg=django diff --git a/pyproject.toml b/pyproject.toml index 95c1567..d79c9f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,9 +43,9 @@ test = [ "pytest", "pytest-cov", "pytest-django", - "model-bakery", ] psycopg2 = ["psycopg2-binary"] +bakery = ["model-bakery"] [project.urls] Project-URL = "https://github.com/voiio/citext" diff --git a/tests/test_baker_generators.py b/tests/test_baker_generators.py index 06bfae4..a32a793 100644 --- a/tests/test_baker_generators.py +++ b/tests/test_baker_generators.py @@ -1,7 +1,8 @@ -from model_bakery import baker +import pytest from tests.testapp import models def test_generators(): + baker = pytest.importorskip("model_bakery.baker") assert baker.prepare(models.TestModel)