diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d4880e03 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + groups: + GitHub_Actions: + patterns: + - "*" # Group all Actions updates into a single larger pull request diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a06aae03..9d837066 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,8 +1,10 @@ name: Check on: - - push - - pull_request + push: + branches: + - "master" + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -25,10 +27,10 @@ jobs: TOXENV: ${{ matrix.tox-environment }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3' cache: pip diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index bbfdafd3..a8b6e7de 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -9,10 +9,10 @@ jobs: name: Linkcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc279ad4..9d734533 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,10 @@ name: Test on: - - push - - pull_request + push: + branches: + - "master" + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/Makefile b/Makefile index 0dbae867..9e0210bc 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ testall: tox # DOC: Run tests for the currently installed version -# Remove cgi warning when dropping support for Django<=4.1. +# Remove cgi warning when dropping support for Django 3.2. test: mypy --ignore-missing-imports tests/test_typing.py python \ diff --git a/docs/changelog.rst b/docs/changelog.rst index 6397f107..c5fc0767 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,7 @@ ChangeLog *Removed:* - Drop support for Django 4.0 +- Stop advertising and verifying support for Django 4.1 3.3.0 (2023-07-19) ------------------ diff --git a/factory/declarations.py b/factory/declarations.py index 70abe35c..951b45f3 100644 --- a/factory/declarations.py +++ b/factory/declarations.py @@ -536,7 +536,7 @@ def evaluate_post(self, instance, step, overrides): return target def evaluate_pre(self, instance, step, overrides): - choice = self.decider.evaluate(instance=instance, step=step, extra={}) + choice = self.decider.evaluate_pre(instance=instance, step=step, overrides={}) target = self.yes if choice else self.no # The value can't be POST_INSTANTIATION, checked in __init__; # evaluate it as `evaluate_pre` diff --git a/setup.cfg b/setup.cfg index 13b09b91..4f93b98c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,6 @@ classifiers = Development Status :: 5 - Production/Stable Framework :: Django Framework :: Django :: 3.2 - Framework :: Django :: 4.1 Framework :: Django :: 4.2 Framework :: Django :: 5.0 Intended Audience :: Developers diff --git a/tests/test_regression.py b/tests/test_regression.py index a9ea1c66..2cca0bda 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -51,3 +51,24 @@ class Params: unknown_author = AuthorFactory(unknown=True) self.assertEqual("", unknown_author.fullname) + + def test_evaluated_without_locale(self): + """Regression test for `KeyError: 'locale'` raised in `evaluate`. + + See #965 + + """ + class AuthorFactory(factory.Factory): + fullname = factory.Faker("name") + pseudonym = factory.Maybe( + decider=factory.Faker("pybool"), + yes_declaration="yes", + no_declaration="no", + ) + + class Meta: + model = Author + + author = AuthorFactory() + + self.assertIn(author.pseudonym, ["yes", "no"]) diff --git a/tox.ini b/tox.ini index d842c759..17dfdb50 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ envlist = linkcheck py{38,39,310,311,312,py39,py310}-sqlite py{38,39,310,311,py39,py310}-django32-mongo-alchemy-{sqlite,postgres} - py{38,39,310,311,py39,py310}-django41-mongo-alchemy-{sqlite,postgres} py{38,39,310,311,312}-django42-mongo-alchemy-{sqlite,postgres} py{py39,py310}-django42-mongo-alchemy-sqlite, # py{py39,py310}-django42-mongo-alchemy-postgres # TODO: Fix me! @@ -39,9 +38,8 @@ deps = alchemy: SQLAlchemy alchemy: sqlalchemy_utils mongo: mongoengine - django{32,41,42,50,main}: Pillow + django{32,42,50,main}: Pillow django32: Django>=3.2,<3.3 - django41: Django>=4.1,<4.2 django42: Django>=4.2,<5.0 django50: Django>=5.0,<5.1 djangomain: https://github.com/django/django/archive/main.tar.gz