Skip to content

Commit

Permalink
Merge branch 'release/2.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Feb 11, 2023
2 parents 7ca09f0 + 9b1b686 commit 7275ad2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[report]
fail_under = 100
show_missing = True
exclude_lines =
pragma: no cover
def __repr__
Expand All @@ -16,6 +17,7 @@ source =
test_project

branch = True
parallel = True
omit =
*/__about__.py
*/test_project/*
Expand Down
2 changes: 1 addition & 1 deletion django_admin_generator/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__package_name__ = 'django-admin-generator'
__version__ = '2.5.0'
__version__ = '2.6.0'
__author__ = 'Rick van Hattem'
__author_email__ = '[email protected]'
__description__ = ' '.join(('''
Expand Down
9 changes: 5 additions & 4 deletions django_admin_generator/management/commands/admin_generator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re
import sys

import python_utils
import six
from django.apps.registry import apps
from django.db import models
Expand Down Expand Up @@ -178,10 +179,10 @@ def __init__(
no_query_db=NO_QUERY_DB, **options
):
self.model = model
self.list_display = []
self.list_filter = []
self.raw_id_fields = []
self.search_fields = []
self.list_display = python_utils.UniqueList()
self.list_filter = python_utils.UniqueList()
self.raw_id_fields = python_utils.UniqueList()
self.search_fields = python_utils.UniqueList()
self.prepopulated_fields = {}
self.date_hierarchy = None
self.search_field_names = search_field_names
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ python_files =
addopts =
--cov django_admin_generator
--cov-report term-missing
--cov-report html

DJANGO_SETTINGS_MODULE=test_project.settings

21 changes: 2 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
import os
import sys

import setuptools
from setuptools.command.test import test as TestCommand

# To prevent importing about and thereby breaking the coverage info we use this
# exec hack
about = {}
with open('django_admin_generator/__about__.py') as fp:
exec(fp.read(), about)


if os.path.isfile('README.rst'):
long_description = open('README.rst').read()
else:
long_description = ('See http://pypi.python.org/pypi/' +
about['__package_name__'])


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


if __name__ == '__main__':
setuptools.setup(
name=about['__package_name__'],
Expand All @@ -42,6 +26,7 @@ def run_tests(self):
packages=setuptools.find_packages(),
install_requires=[
'django-utils2>=2.12.1',
'python-utils>=3.5.2',
'six',
],
extras_require={
Expand All @@ -58,7 +43,6 @@ def run_tests(self):
],
},
long_description=long_description,
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
Expand All @@ -72,4 +56,3 @@ def run_tests(self):
'Programming Language :: Python :: 3.11',
],
)

22 changes: 20 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ envlist =
; py3{8,9,10,11}-django51,
; py3{8,9,10,11}-django52,
; py3{8,9,10,11}-django60,
report,
flake8,
docs

skip_missing_interpreters = True
usedevelop = True
;use_develop = True

[testenv]
deps =
Expand All @@ -25,6 +26,8 @@ deps =
; django52: Django>=5.2,<5.3
; django60: Django>=6.0,<6.1
-e{toxinidir}[tests]
depends =
report: py3{7,8,9,10,11}-django32,py3{8,9,10,11}-django40,py3{8,9,10,11}-django41

envlist =
py3{7,8,9,10,11}-django32,
Expand All @@ -36,8 +39,23 @@ envlist =
; py3{8,9,10,11}-django52,
; py3{8,9,10,11}-django60,

setenv =
COVERAGE_FILE = {toxinidir}/.coverage.{envname}

commands =
python setup.py test
py.test --cov-config={toxinidir}/.coveragerc {posargs:-v}
skip_install = True
changedir = {toxinidir}

[testenv:report]
skip_install = true
deps = coverage
commands =
coverage combine
coverage html
coverage report --fail-under=100
setenv =
COVERAGE_FILE =

[testenv:flake8]
deps = flake8
Expand Down

0 comments on commit 7275ad2

Please sign in to comment.