Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bugfix/385
Browse files Browse the repository at this point in the history
* origin/main:
  Bump 1.19.0
  Fix #483 -- Add Django 5.1 support (#485)
  Bump 1.18.3
  Refs #416 -- Allow combination of GFK and `_fill_optional` (#438)
  Bump 1.18.2
  Update ruff CI syntax (#481)
  Fix #28 -- allow make_recipe to work with _quantity (#480)
  Bump 1.18.1
  Replace expensive `count()` with cheap `exists()` (#478)
  Update CI Python version to 3.12
  Delete hard action requirement for a changelog
  Bump 1.18.0
  Fix #265 -- drop hard dependency on `contenttypes` framework (#476)
  Bump GitHub Actions artifacts to v4 (#470)
  Drop Django 3.2 support (#475)
  Bump actions/setup-python from 4 to 5 (#466)
  Drop Django 4.1 support (reached end of life) (#465)
  Support Django 5.0 (#464)
  • Loading branch information
amureki committed Aug 9, 2024
2 parents 3ad58ec + 5aa3070 commit 38cf861
Show file tree
Hide file tree
Showing 22 changed files with 244 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ A clear and concise description of what the change is.

**PR Checklist**
- [ ] Change is covered with tests
- [ ] [CHANGELOG.md](CHANGELOG.md) is updated
- [ ] [CHANGELOG.md](CHANGELOG.md) is updated if needed
16 changes: 0 additions & 16 deletions .github/workflows/changelog.yml

This file was deleted.

24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
strategy:
matrix:
lint-command:
- ruff --output-format=github .
- ruff check --output-format=github .
- black --check --diff .
- mypy model_bakery
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: pip
- run: python -m pip install .[test]
- run: ${{ matrix.lint-command }}
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
psql template1 -c "CREATE EXTENSION postgis;" -U postgres -h localhost -p 5432
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand All @@ -79,10 +79,11 @@ jobs:
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Upload coverage data
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-data
name: coverage-data-${{ matrix.python-version }}
path: '.coverage.*'
if-no-files-found: ignore

coverage:
name: Coverage
Expand All @@ -91,17 +92,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: python -m pip install --upgrade coverage[toml]

- name: Download data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage-data
pattern: coverage-data-*
merge-multiple: true

- name: Combine coverage and fail if it's <95%
run: |
Expand All @@ -111,7 +113,7 @@ jobs:
- name: Upload HTML report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
cache: pip

- name: Build package
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,37 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Removed

## [1.19.0](https://pypi.org/project/model-bakery/1.19.0/)

### Added
- Add Django 5.1 support

## [1.18.3](https://pypi.org/project/model-bakery/1.18.3/)

### Changed
- Fix support of `GenericForeignKey` fields in combination with `_fill_optional`

## [1.18.2](https://pypi.org/project/model-bakery/1.18.2/)

### Changed
- Fix `make_recipe` to work with `_quantity` (#28)

## [1.18.1](https://pypi.org/project/model-bakery/1.18.1/)

### Changed
- Replace expensive `count()` with cheap `exists()`

## [1.18.0](https://pypi.org/project/model-bakery/1.18.0/)

### Added
- Add Django 5.0 support

### Changed
- Allow baking without `contenttypes` framework

### Removed
- Drop Django 3.2 and 4.1 support (reached end of life)

## [1.17.0](https://pypi.org/project/model-bakery/1.17.0/)

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To run `postgresql` and `postgis` specific tests:
1. [Install `docker`](https://docs.docker.com/get-docker/).

2. Install the `postgis` dependencies. Follow the
[instructions from the Django docs](https://docs.djangoproject.com/en/3.1/ref/contrib/gis/install/geolibs/):
[instructions from the Django docs](https://docs.djangoproject.com/en/stable/ref/contrib/gis/install/geolibs/):

If you are on Ubuntu/Debian you run the following:

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import sys

sys.path.insert(0, os.path.abspath(".."))
from model_bakery import __about__

from model_bakery import __about__ # noqa
sys.path.insert(0, os.path.abspath(".."))

project = "Model Bakery"
copyright = "2023, Rust Saiargaliev"
Expand Down
6 changes: 3 additions & 3 deletions docs/how_bakery_behaves.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Model Bakery should handle fields that:

## Currently supported fields

- `BooleanField`, `NullBooleanField`, `IntegerField`, `BigIntegerField`, `SmallIntegerField`, `PositiveIntegerField`, `PositiveSmallIntegerField`, `FloatField`, `DecimalField`
- `BooleanField`, `IntegerField`, `BigIntegerField`, `SmallIntegerField`, `PositiveIntegerField`, `PositiveBigIntegerField`, `PositiveSmallIntegerField`, `FloatField`, `DecimalField`
- `CharField`, `TextField`, `BinaryField`, `SlugField`, `URLField`, `EmailField`, `IPAddressField`, `GenericIPAddressField`, `ContentType`
- `ForeignKey`, `OneToOneField`, `ManyToManyField` (even with through model)
- `DateField`, `DateTimeField`, `TimeField`, `DurationField`
Expand Down Expand Up @@ -93,7 +93,7 @@ class CustomBaker(baker.Baker):
return [
field
for field in super(CustomBaker, self).get_fields()
if not field isinstance CustomField
if not isinstance(field, CustomField)
]

# in your settings.py file:
Expand All @@ -111,7 +111,7 @@ movie = baker.make(Movie, title='Old Boys', _from_manager='availables') # This
If you have overwritten the `save` method for a model, you can pass custom parameters to it using Model Bakery. Example:

```python
class ProjectWithCustomSave(models.Model)
class ProjectWithCustomSave(models.Model):
# some model fields
created_by = models.ForeignKey(settings.AUTH_USER_MODEL)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Model Bakery is a rename of the legacy [model_mommy\'s project](https://pypi.org

# Compatibility

Model Bakery supports Django \>= 3.2.
Model Bakery supports Django \>= 4.2.

# Install

Expand Down
2 changes: 1 addition & 1 deletion model_bakery/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.17.0"
__version__ = "1.19.0"
Loading

0 comments on commit 38cf861

Please sign in to comment.