From 870060605e3955114766a979de1afadbea4dc603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Sat, 24 Aug 2019 14:57:46 +0200 Subject: Deprecate support for 'partial' versions. Their comparison semantics were ill-defined, and mostly an implementation detail for the old, 'native' specs. --- semantic_version/django_fields.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'semantic_version/django_fields.py') diff --git a/semantic_version/django_fields.py b/semantic_version/django_fields.py index 1af5bf5..db7e606 100644 --- a/semantic_version/django_fields.py +++ b/semantic_version/django_fields.py @@ -2,6 +2,7 @@ # Copyright (c) The python-semanticversion project # This code is distributed under the two-clause BSD License. +import warnings from django.db import models from django.utils.translation import ugettext_lazy as _ @@ -46,6 +47,12 @@ class VersionField(SemVerField): def __init__(self, *args, **kwargs): self.partial = kwargs.pop('partial', False) + if self.partial: + warnings.warn( + "Use of `partial=True` will be removed in 3.0.", + DeprecationWarning, + stacklevel=2, + ) self.coerce = kwargs.pop('coerce', False) super().__init__(*args, **kwargs) -- cgit v1.2.1