File tree Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -41,15 +41,15 @@ include_package_data = true
41
41
install_requires =
42
42
django-contrib-comments >= 1.9
43
43
django >= 2.2
44
- filebrowser-safe >= 0.5
45
- grappelli-safe >= 0.5
46
44
tzlocal >= 2
47
45
bleach >= 2
48
46
beautifulsoup4 >= 4.5.3
49
47
requests >= 2.1.0
50
48
requests-oauthlib >= 1.3
51
49
pillow >= 7
52
- chardet
50
+ chardet >= 4
51
+ filebrowser_safe@https://github.com/stephenmcd/filebrowser-safe/archive/master.tar.gz
52
+ grappelli_safe@https://github.com/stephenmcd/grappelli-safe/archive/master.tar.gz
53
53
54
54
[options.extras_require]
55
55
testing =
Original file line number Diff line number Diff line change 1
1
import re
2
+ import subprocess
2
3
from unittest import skipUnless
3
4
from urllib .parse import urlencode
4
5
6
+ import pkg_resources
5
7
import pytest
6
8
import pytz
7
9
from django .conf .urls import url
45
47
from mezzanine .utils .tests import TestCase
46
48
from mezzanine .utils .urls import admin_url
47
49
50
+ BRANCH_NAME = (
51
+ subprocess .check_output (["git" , "rev-parse" , "--abbrev-ref" , "HEAD" ])
52
+ .decode ()
53
+ .strip ()
54
+ )
55
+ VERSION_WARN = (
56
+ "Unpinned or pre-release dependencies detected in Mezzanine's requirements: {}"
57
+ )
58
+
59
+
60
+ @pytest .mark .skipif (
61
+ BRANCH_NAME != "stable" , reason = "Only runs when publishing stable releases"
62
+ )
63
+ def test_stable_dependencies ():
64
+ """
65
+ This test is meant for CI. We want to make sure that when building the `stable`
66
+ branch of Mezzanine the dependencies are also stable so that we don't publish a
67
+ stable Mezzanine release with unstable dependencies.
68
+ """
69
+ # If a requirement is listed via a git or http url the `specs` attribute will be an
70
+ # empty list, so we use it to check for "pre-release" status
71
+ requirements = pkg_resources .working_set .by_key ["mezzanine" ].requires ()
72
+ prereleases = [r .name for r in requirements if not r .specs ]
73
+ assert not prereleases , VERSION_WARN .format (", " .join (prereleases ))
74
+
48
75
49
76
class CoreTests (TestCase ):
50
77
def test_tagcloser (self ):
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ envlist =
9
9
usedevelop = true
10
10
deps =
11
11
.[testing]
12
- https://github.com/stephenmcd/filebrowser-safe/archive/master.tar.gz# egg=filebrowser_safe
13
- https://github.com/stephenmcd/grappelli-safe/archive/master.tar.gz# egg=grappelli_safe
14
12
dj22: Django>=2.2, <3
15
13
dj30: Django>=3.0, <3.1
16
14
dj31: Django>=3.1, <3.2
You can’t perform that action at this time.
0 commit comments