Skip to content

Commit

Permalink
Merge pull request #6 from thorgate/chore/update-supported-versions
Browse files Browse the repository at this point in the history
Chore/update supported versions
  • Loading branch information
rivol authored Mar 12, 2018
2 parents a42dc4a + 5883ec7 commit 81f0a9d
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 45 deletions.
54 changes: 24 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
language: python

python:
- "3.4"
- "3.5"
- "3.6"

env:
- TOX_ENV=py35-django18
- TOX_ENV=py35-django19
- TOX_ENV=py34-django18
- TOX_ENV=py34-django19
- TOX_ENV=py27-django18
- TOX_ENV=py27-django19
- TOX_ENV=lint
- TOX_ENV=coverage
- TOX_ENV=docs
- DJANGO=1.8
- DJANGO=1.11
- DJANGO=2.0

install:
- pip install -U tox
- pip install tox tox-travis

script:
- tox

jobs:
include:
- stage: deploy
env: TOX_ENV=py35-django19
deploy:
provider: pypi
user: thorgate
password:
secure: >
gsOZAUv7GMDdQ5PVyi8+qpZSLZJ0bGs+iX8i7acIHFZU3jHpMm3NevMIuka8Xkd0cpnEW9xmAqGf6UyEW0pLa/dp5NWlggUIsRdFS0JH9aQ7c
A0cRbAPQo5ZjAaVqcHDjmKHAVjfRvHOvAcceRe/AODm/EBXx2pzxHb2YSOolFuSmK0OWjaAoJ0kK1DoWI2gltOoPC3NebdTJCmcdn1thmh1su
LanvkOn9v6363KrGz7t3y4h7qvmAYH0iM3xyarHPwodd1vChnvHdXEJoNFHzPuMcvI44nOlrf6phhFyyGyzsJQrwITwAROzLLRuKq1VbFS+nc
yj7vPa8CRh9J26ccA/W4tx0AqkwsFVxHdDIrbQ7apZ8TXIWDovv9nxRoN8e8fr+5u4umUbKLBgBKINfW2BA9LyqMCBj7YaNUwNAYxxMu8xBO4
m6DUuCDZqXyMQVgZraJwrn0p1qmyacAcOJMbcNNlmwvo6+4kMgKVvsoFBAB9MOqH1y4UFgXsvvbx2sN46XDqmvagjtlyZMcHh6L5riRhhTl8r
YZLCmM62WKM05hjx03KDVHlNVSs4VWVCXVXkrIlDm8rHM0wy6pWUov9LREoazaDL11vAFbKBM0D3qOhDzZlD1xECa3lRWW1K3g1Pa5/DatozO
NyOCYve/jqlkfFKV3VEvgEBBBqF5g=
on:
tags: true
distributions: sdist bdist_wheel
repo: thorgate/tg-utils
deploy:
provider: pypi
user: thorgate
password:
secure: >
gsOZAUv7GMDdQ5PVyi8+qpZSLZJ0bGs+iX8i7acIHFZU3jHpMm3NevMIuka8Xkd0cpnEW9xmAqGf6UyEW0pLa/dp5NWlggUIsRdFS0JH9aQ7c
A0cRbAPQo5ZjAaVqcHDjmKHAVjfRvHOvAcceRe/AODm/EBXx2pzxHb2YSOolFuSmK0OWjaAoJ0kK1DoWI2gltOoPC3NebdTJCmcdn1thmh1su
LanvkOn9v6363KrGz7t3y4h7qvmAYH0iM3xyarHPwodd1vChnvHdXEJoNFHzPuMcvI44nOlrf6phhFyyGyzsJQrwITwAROzLLRuKq1VbFS+nc
yj7vPa8CRh9J26ccA/W4tx0AqkwsFVxHdDIrbQ7apZ8TXIWDovv9nxRoN8e8fr+5u4umUbKLBgBKINfW2BA9LyqMCBj7YaNUwNAYxxMu8xBO4
m6DUuCDZqXyMQVgZraJwrn0p1qmyacAcOJMbcNNlmwvo6+4kMgKVvsoFBAB9MOqH1y4UFgXsvvbx2sN46XDqmvagjtlyZMcHh6L5riRhhTl8r
YZLCmM62WKM05hjx03KDVHlNVSs4VWVCXVXkrIlDm8rHM0wy6pWUov9LREoazaDL11vAFbKBM0D3qOhDzZlD1xECa3lRWW1K3g1Pa5/DatozO
NyOCYve/jqlkfFKV3VEvgEBBBqF5g=
distributions: sdist bdist_wheel
on:
repo: thorgate/tg-utils
tags: true
python: "3.6"
condition: "$DJANGO = 2.0"

notifications:
email: false
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
History
=======

0.3.0 (2018-03-12)
------------------

* Supported Django versions are now 1.8, 1.11, and 2.0.
`ClosableModel.created_by` and `closed_by` now have `on_delete=models.SET_NULL` attribute.
* Supported Python versions are now 3.4, 3.5, and 3.6.


0.2.0 (2016-01-27)
------------------

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ lint:
test:
py.test

test-full: test lint coverage

test-all:
tox

coverage:
coverage run --source tg_utils setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
py.test --cov-config .coveragerc --cov=tg_utils --cov-report html --cov-report term-missing

docs:
rm -f docs/tg_utils.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# General information about the project.
project = u'tg-utils'
copyright = u'2016, Thorgate'
copyright = u'2018, Thorgate'

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down
4 changes: 4 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
pytest==2.8.5
coverage==4.2
coveralls==1.1
pytest-cov==2.4.0
pytest-django==2.9.1
django_compressor==2.0
hashids==1.1.0
flake8==2.5.1
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ tag = True
[wheel]
universal = 1

[flake8]
max-line-length = 140
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
history = history_file.read()

requirements = [
'django>=1.8,<1.10',
'django>=1.8,<2.1',
]

setup(
Expand All @@ -43,10 +43,9 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)
2 changes: 1 addition & 1 deletion tests/django_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

DEBUG = True

SECRET_KEY='hunter2'
SECRET_KEY = 'hunter2'

SITE_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Expand Down
3 changes: 3 additions & 0 deletions tests/test_importing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# flake8: noqa


def test_imports():
""" Ensures all submodules are importable
Expand Down
2 changes: 1 addition & 1 deletion tg_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = 'Thorgate'
__email__ = 'code@thorgate.eu'
__version__ = '0.2.0'
__version__ = '0.3.0'
4 changes: 2 additions & 2 deletions tg_utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class ClosableModel(models.Model):
Also provides default manager that automatically filters queryset to only include active (non-closed) items plus a
.close() function to mark objects as closed.
"""
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='+', null=True, blank=True)
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, related_name='+', null=True, blank=True)
created_at = models.DateTimeField(default=timezone.now)

closed_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='+', null=True, blank=True)
closed_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, related_name='+', null=True, blank=True)
closed_at = models.DateTimeField(null=True, blank=True)

all_objects = models.Manager()
Expand Down
2 changes: 1 addition & 1 deletion tg_utils/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def profile_yappi(label):
func_stats = yappi.get_func_stats()
file_prefix = '/tmp/profile-yappi-%s-%s' % (label, timestamp.isoformat('T'))
with open(file_prefix + '-summary.txt', 'w') as f:
func_stats.print_all(out=f, columns={0:("name",140), 1:("ncall", 8), 2:("tsub", 8), 3:("ttot", 8), 4:("tavg",8)})
func_stats.print_all(out=f, columns={0: ("name", 140), 1: ("ncall", 8), 2: ("tsub", 8), 3: ("ttot", 8), 4: ("tavg", 8)})
func_stats.save(file_prefix + '.kgrind', 'CALLGRIND')
yappi.stop()
yappi.clear_stats()
Expand Down
14 changes: 12 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[tox]
envlist = py{27,34,35}-django{18,19}
envlist = py{34,35,36}-django{18,111,20}

[travis:env]
DJANGO =
1.8: django18
1.11: django111
2.0: django20

[testenv]
setenv =
Expand All @@ -8,5 +14,9 @@ whitelist_externals = make
commands = make test
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1
-r{toxinidir}/requirements_test.txt

[testenv:py36-django20]
commands = make test-full

0 comments on commit 81f0a9d

Please # to comment.