Skip to content

Commit

Permalink
chore: post django32 cleanup (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
aht007 authored Feb 16, 2022
1 parent 4126038 commit 6636602
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 76 deletions.
56 changes: 24 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,39 @@ on:
branches:
- main
pull_request:
branches:
- '**'

jobs:
run_tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
python-version:
- 3.8
node-version:
- 10
toxenv:
- django22
- quality
- pii_check
- rst_validation
os: [ubuntu-20.04]
python-version: ["3.8"]
node-version: ["10"]
toxenv: [django32, django40, quality, pii_check, rst_validation]

steps:
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v1
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip-tools.txt
- name: Install pip
run: pip install -r requirements/pip-tools.txt

- name: Install requirements
run: pip install -r requirements/ci.txt
- name: Install requirements
run: pip install -r requirements/ci.txt

- name: Run tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
- name: Run tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run Coverage
if: matrix.toxenv == 'django22'
uses: codecov/codecov-action@v1
with:
flags: unittests
fail_ci_if_error: true
- name: Run Coverage
if: matrix.toxenv == 'django32'
uses: codecov/codecov-action@v2
with:
flags: unittests
fail_ci_if_error: true
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Change Log
Unreleased
~~~~~~~~~~

[2.2.0] - 2022-02-14
~~~~~~~~~~~~~~~~~~~~
* Added Django40 testing and dropped Django22, 30 and 31 support

[2.1.0] - 2022-01-11
~~~~~~~~~~~~~~~~~~~~
* Add optional `statuses_to_exclude` argument to `get_verified_name` in order to filter out one or
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
$(PIP_COMPILE) -o requirements/celery44.txt requirements/celery44.in
$(PIP_COMPILE) -o requirements/celery50.txt requirements/celery50.in
# Let tox control the Django version for tests
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
Expand Down
2 changes: 1 addition & 1 deletion edx_name_affirmation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Django app housing name affirmation logic.
"""

__version__ = '2.1.0'
__version__ = '2.2.0'

default_app_config = 'edx_name_affirmation.apps.EdxNameAffirmationConfig' # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion edx_name_affirmation/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from django.dispatch import Signal

VERIFIED_NAME_APPROVED = Signal(providing_args=['user_id', 'profile_name'])
VERIFIED_NAME_APPROVED = Signal()
29 changes: 12 additions & 17 deletions edx_name_affirmation/urls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
"""
URLs for edx_name_affirmation.
"""
from django.conf.urls import include, url

from django.urls import include, path

from edx_name_affirmation import views

app_name = 'edx_name_affirmation'

urlpatterns = [
url(
r'edx_name_affirmation/v1/verified_name$',
views.VerifiedNameView.as_view(),
name='verified_name'
),
path('edx_name_affirmation/v1/verified_name', views.VerifiedNameView.as_view(),
name='verified_name'
),

url(
r'edx_name_affirmation/v1/verified_name/history$',
views.VerifiedNameHistoryView.as_view(),
name='verified_name_history'
),
path('edx_name_affirmation/v1/verified_name/history', views.VerifiedNameHistoryView.as_view(),
name='verified_name_history'
),

url(
r'edx_name_affirmation/v1/verified_name/config$',
views.VerifiedNameConfigView.as_view(),
name='verified_name_config'
),
path('edx_name_affirmation/v1/verified_name/config', views.VerifiedNameConfigView.as_view(),
name='verified_name_config'
),

url(r'^', include('rest_framework.urls', namespace='rest_framework')),
path('', include('rest_framework.urls', namespace='rest_framework')),
]
1 change: 1 addition & 0 deletions requirements/celery44.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
celery>=4.4,<4.5
20 changes: 20 additions & 0 deletions requirements/celery44.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/celery44.txt requirements/celery44.in
#
amqp==2.6.1
# via kombu
billiard==3.6.4.0
# via celery
celery==4.4.7
# via -r requirements/celery44.in
kombu==4.6.11
# via celery
pytz==2021.3
# via celery
vine==1.3.0
# via
# amqp
# celery
1 change: 1 addition & 0 deletions requirements/celery50.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
celery>=5.0,<6.0
35 changes: 34 additions & 1 deletion requirements/celery50.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/celery50.txt requirements/celery50.in
#
amqp==5.0.9
# via kombu
billiard==3.6.4.0
# via celery
celery==5.2.3
# via -r requirements/celery50.in
click==8.0.3
# via
# celery
# click-didyoumean
# click-plugins
# click-repl
click-didyoumean==0.3.0
# via celery
click-plugins==1.1.1
# via celery
click-repl==0.2.0
# via celery
kombu==5.2.3
prompt-toolkit==3.0.26
# via celery
prompt-toolkit==3.0.28
# via click-repl
pytz==2021.3
# via celery
six==1.16.0
# via click-repl
vine==5.0.0
# via
# amqp
# celery
# kombu
wcwidth==0.2.5
# via prompt-toolkit

# The following packages are considered to be unsafe in a requirements file:
# setuptools
4 changes: 2 additions & 2 deletions test_urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf.urls import include, url
from django.urls import path, include

urlpatterns = [
url(r'^', include('edx_name_affirmation.urls', namespace='edx_name_affirmation')),
path('', include('edx_name_affirmation.urls', namespace='edx_name_affirmation')),
]
44 changes: 22 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tox]
envlist = py38-django{22,30}-celery{44,50}, quality, rst_validation, docs, pii_check
envlist = py38-django{32,40}-celery{44,50}, quality, rst_validation, docs, pii_check

[doc8]
; D001 = Line too long
ignore=D001
ignore = D001

[pycodestyle]
exclude = .git,.tox,migrations
Expand Down Expand Up @@ -35,34 +34,34 @@ addopts = --cov edx_name_affirmation --cov-report term-missing --cov-report xml
norecursedirs = .* docs requirements site-packages

[testenv]
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
deps =
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
-r{toxinidir}/requirements/test.txt
celery44: celery>=4.0,<5.0
celery50: -r{toxinidir}/requirements/celery50.txt
commands =
celery44: -r{toxinidir}/requirements/celery44.txt
celery50: -r{toxinidir}/requirements/celery50.txt
commands =
python manage.py check
pytest {posargs}

[testenv:rst_validation]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
-r{toxinidir}/requirements/quality.txt
commands =
commands =
make quality-rst

[testenv:docs]
setenv =
setenv =
DJANGO_SETTINGS_MODULE = test_settings
PYTHONPATH = {toxinidir}
whitelist_externals =
whitelist_externals =
make
rm
deps =
deps =
-r{toxinidir}/requirements/doc.txt
commands =
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/edx_name_affirmation.rst
rm -f docs/modules.rst
Expand All @@ -71,18 +70,19 @@ commands =
python setup.py check --restructuredtext --strict

[testenv:quality]
deps =
deps =
-r{toxinidir}/requirements/quality.txt
-r{toxinidir}/requirements/test.txt
commands =
commands =
pylint edx_name_affirmation
pycodestyle edx_name_affirmation
isort --check-only --diff --recursive edx_name_affirmation manage.py setup.py
isort --check-only --diff edx_name_affirmation manage.py setup.py

[testenv:pii_check]
setenv =
setenv =
DJANGO_SETTINGS_MODULE = test_settings
deps =
deps =
-r{toxinidir}/requirements/quality.txt
commands =
commands =
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage

0 comments on commit 6636602

Please sign in to comment.