Skip to content

Commit

Permalink
Merge pull request #195 from openedx/jenkins/cleanup-python-code-38c796f
Browse files Browse the repository at this point in the history
chore: Post Django32 Cleanup
  • Loading branch information
aht007 authored Jan 26, 2022
2 parents 38c796f + 0c2e587 commit ecec197
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 63 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [master]
pull_request:
branches:
- '**'
- '**'

jobs:
tests:
Expand All @@ -14,12 +14,9 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22-celery44-drflatest, django22-celery44-drf312, django22-celery50-drflatest,
django22-celery50-drf312, django30-celery44-drflatest, django30-celery44-drf312,
django30-celery50-drflatest, django30-celery50-drf312, django31-celery44-drflatest,
django31-celery44-drf312, django31-celery50-drflatest, django31-celery50-drf312,
django32-celery44-drflatest, django32-celery44-drf312, django32-celery50-drflatest,
django32-celery50-drf312, quality, docs]
toxenv: [django32-celery44-drf312, django32-celery44-drflatest, django32-celery50-drf312,
django32-celery50-drflatest, django40-celery44-drf312, django40-celery44-drflatest,
django40-celery50-drf312, django40-celery50-drflatest, quality, docs]

steps:
- uses: actions/checkout@v2
Expand All @@ -39,7 +36,7 @@ jobs:
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django22-celery44-drf312'
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32-celery50-drf312'
uses: codecov/codecov-action@v1
with:
flags: unittests
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Change Log
----------

..
All enhancements and patches to cookiecutter-django-app will be documented
All enhancements and patches to django-user-tasks will be documented
in this file. It adheres to the structure of http://keepachangelog.com/ ,
but in reStructuredText instead of Markdown (for ease of incorporation into
Sphinx documentation and the PyPI description).
Expand All @@ -16,6 +16,19 @@ Unreleased

*

[2.2.0] - 2022-01-26
~~~~~~~~~~~~~~~~~~~~

Removed
+++++++

* Removed Django22,30,31 support.

Added
+++++

* Added Django40 support in CI

[2.1.0] - 2021-07-07
~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ idna==3.3
# via requests
imagesize==1.3.0
# via sphinx
importlib-metadata==4.10.0
importlib-metadata==4.10.1
# via
# keyring
# sphinx
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ def is_requirement(line):
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
Expand Down
4 changes: 2 additions & 2 deletions test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
URLs for user_tasks test suite.
"""

from django.conf.urls import url
from django.urls import re_path
from django.contrib import admin

from user_tasks.urls import urlpatterns

urlpatterns += [url(r'^admin/', admin.site.urls)]
urlpatterns += [re_path(r'^admin/', admin.site.urls)]
88 changes: 43 additions & 45 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
[tox]
envlist = py38-django{22,30,31,32}-celery{44,50}-drf{312,latest},quality,docs
envlist = py38-django{32,40}-celery{44,50}-drf{312,latest},quality,docs

[testenv]
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<3.3
drf312: djangorestframework>=3.12,<3.13
drflatest: djangorestframework
celery44: -r{toxinidir}/requirements/celery44.txt
celery50: -r{toxinidir}/requirements/celery50.txt
-r{toxinidir}/requirements/test.txt
commands =
python -Wd -m pytest {posargs}
deps =
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
drf312: djangorestframework>=3.12,<3.13
drflatest: djangorestframework
celery44: -r{toxinidir}/requirements/celery44.txt
celery50: -r{toxinidir}/requirements/celery50.txt
-r{toxinidir}/requirements/test.txt
commands =
python -Wd -m pytest {posargs}

[testenv:docs]
allowlist_externals =
make
rm
deps =
-r{toxinidir}/requirements/doc.txt
commands =
doc8 --ignore-path docs/_build --ignore-path docs/rest_api.rst README.rst docs
rm -f docs/user_tasks.rst
rm -f docs/modules.rst
make -C docs clean
make -C docs html
python setup.py sdist bdist_wheel
twine check dist/*
allowlist_externals =
make
rm
deps =
-r{toxinidir}/requirements/doc.txt
commands =
doc8 --ignore-path docs/_build --ignore-path docs/rest_api.rst README.rst docs
rm -f docs/user_tasks.rst
rm -f docs/modules.rst
make -C docs clean
make -C docs html
python setup.py sdist bdist_wheel
twine check dist/*

[testenv:quality]
setenv=
setenv =
DJANGO_SETTINGS_MODULE=test_settings
allowlist_externals =
make
rm
touch
deps =
-r{toxinidir}/requirements/doc.txt
-r{toxinidir}/requirements/quality.txt
-r{toxinidir}/requirements/test.txt
commands =
touch tests/__init__.py
pylint user_tasks
pylint tests
pylint schema
rm tests/__init__.py
pycodestyle schema tests user_tasks
pydocstyle schema tests user_tasks
isort --check-only --diff --recursive schema tests user_tasks manage.py setup.py test_settings.py
make help
allowlist_externals =
make
rm
touch
deps =
-r{toxinidir}/requirements/doc.txt
-r{toxinidir}/requirements/quality.txt
-r{toxinidir}/requirements/test.txt
commands =
touch tests/__init__.py
pylint user_tasks
pylint tests
pylint schema
rm tests/__init__.py
pycodestyle schema tests user_tasks
pydocstyle schema tests user_tasks
isort --check-only --diff schema tests user_tasks manage.py setup.py test_settings.py
make help

5 changes: 3 additions & 2 deletions user_tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

from django.dispatch import Signal

__version__ = '2.1.0'
__version__ = '2.2.0'

default_app_config = 'user_tasks.apps.UserTasksConfig' # pylint: disable=invalid-name

# This signal is emitted when a user task reaches any final state:
# SUCCEEDED, FAILED, or CANCELED
user_task_stopped = Signal(providing_args=['status']) # pylint: disable=invalid-name
# providing_args = ['status']
user_task_stopped = Signal() # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion user_tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.db.models import Q
from django.db.models.expressions import F
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from model_utils.models import TimeStampedModel

Expand Down

0 comments on commit ecec197

Please sign in to comment.