Skip to content

Commit

Permalink
restore Django 1.11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamu committed Mar 22, 2018
1 parent d1aef55 commit 84334af
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ and learning more about the latest Pinax app releases.

#### Supported Django and Python versions

pinax-cli creates projects using Python v3.4+ and Django v2.0+
Django \ Python | 2.7 | 3.4 | 3.5 | 3.6
--------------- | --- | --- | --- | ---
1.11 | * | * | * | *
2.0 | | * | * | *


## Documentation
Expand Down Expand Up @@ -120,6 +123,10 @@ the project is created in a sub-directory named `my_project`.

## Change Log

### 1.1.4

* Restore support for Django 1.11 with Python 2.7

### 1.1.3

* Drop support for Python 2.7 and Django < 2.0; require Python 3.4+ and Django 2.0+
Expand Down
5 changes: 3 additions & 2 deletions pinaxcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import stat
import sys

import click
import django
from django.core.management import call_command, CommandError

import click
import requests

from .utils import format_help, order_manually
Expand Down Expand Up @@ -164,7 +165,7 @@ def validate_django_compatible_with_python():
"""
python_version = sys.version[:5]
django_version = django.get_version()
if sys.version_info == (2, 7) and django_version >= "1.12":
if sys.version_info == (2, 7) and django_version >= "2":
click.BadArgumentUsage("Please install Django v1.11 for Python {}, or switch to Python >= v3.4".format(python_version))


Expand Down
21 changes: 12 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from setuptools import setup

VERSION = "1.1.3"
VERSION = "1.1.4"
LONG_DESCRIPTION = """
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-blank.svg
:target: https://pypi.python.org/pypi/pinax-cli/
Expand Down Expand Up @@ -43,16 +43,16 @@
Supported Django and Python Versions
------------------------------------
pinax-cli creates projects using Python v3.4+ and Django v2.0+
+-----------------+-----+-----+-----+-----+
| Django / Python | 2.7 | 3.4 | 3.5 | 3.6 |
+=================+=====+=====+=====+=====+
| 1.11 | * | * | * | * |
+-----------------+-----+-----+-----+-----+
| 2.0 | | * | * | * |
+-----------------+-----+-----+-----+-----+
"""

# Check for valid Python.
if sys.version_info < (3, 4, 0):
print("Python {} is installed, but pinax-cli requires Python 3.4 or greater for compatibility with Django v2.x".format(sys.version.split()[0]))
sys.exit()


# Publish Helper.
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist bdist_wheel upload')
Expand All @@ -72,7 +72,8 @@
install_requires=[
"click>=6.7",
"crayons>=0.1.2",
"django>=2.0",
'django==1.11; python_version == "2.7"',
'django>=2.0; python_version >= "3"',
"requests>=2.18.4",
],
entry_points={
Expand All @@ -88,6 +89,8 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
Expand Down

0 comments on commit 84334af

Please sign in to comment.