Skip to content

Commit

Permalink
Drop Django 2 support (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhiebert authored Oct 7, 2020
1 parent b76a6bc commit 5831d31
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 46 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build

on: push

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8.6
uses: actions/setup-python@v2
with:
python-version: 3.8.6
- name: Install poetry
run: python -m pip install --upgrade pip poetry
- name: Install dependencies
run: poetry install
- name: Run pytest
run: poetry run pytest --cov --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8.6
uses: actions/setup-python@v2
with:
python-version: 3.8.6
- name: Install black
run: python -m pip install --upgrade pip black
- name: Check formatting
run: black --check .
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.0 (2020-10-07)
++++++++++++++++

* Drop support for Django<3.


2.1 (2019-12-05)
++++++++++++++++

Expand Down
39 changes: 0 additions & 39 deletions azure-pipelines.yml

This file was deleted.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ build-backend = "poetry.masonry.api"

[tool.poetry]
name = "django-safemigrate"
version = "2.1"
version = "3.0"
description = "Safely run migrations before deployment"
authors = ["Ryan Hiebert <ryan@aspiredu.com>"]
license = "MIT"
readme = "README.rst"

[tool.poetry.dependencies]
python = "^3.6"
django = ">=2.1,<4.0"
django = "^3.0"

[tool.poetry.dev-dependencies]
pytest = "^5.1"
black = "^19.3b0"
pytest = "^6.1"
black = "^20.8b1"
codecov = "^2.0"
pytest-cov = "^2.6"
pytest-django = "^3.4"
pytest-pythonpath = "^0.7.3"
pytest-mock = "^1.10"
pytest-mock = "^3.3"
2 changes: 1 addition & 1 deletion src/django_safemigrate/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Add a safemigrate command."""
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class SafeMigrateConfig(AppConfig):
Expand Down
4 changes: 3 additions & 1 deletion src/django_safemigrate/management/commands/safemigrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def pre_migrate_receiver(self, *, plan, **_):

# Check for invalid safe properties
invalid = [
migration for migration in migrations if safety(migration) not in Safe
migration
for migration in migrations
if not isinstance(safety(migration), Safe) or safety(migration) not in Safe
]
if invalid:
self.stdout.write(self.style.MIGRATE_HEADING("Invalid migrations:"))
Expand Down

0 comments on commit 5831d31

Please sign in to comment.