Skip to content

Commit

Permalink
Django 3 and Python 3.8 support (#17)
Browse files Browse the repository at this point in the history
* Update setup

* Update tox and travis configs

* Update django stuff

* Merge and fix

* Update package version
  • Loading branch information
bertini36 authored Apr 20, 2021
1 parent 142ed1b commit 370e733
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ language: python
python:
- 3.6
- 3.7
- 3.8

install: pip install tox-travis coveralls

Expand Down
2 changes: 1 addition & 1 deletion billing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.7.19'
__version__ = '1.7.20'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
13 changes: 6 additions & 7 deletions billing/admin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from datetime import date, datetime
from typing import Dict

from django import forms
from django.urls import re_path
from django.contrib import admin, messages
from django.db import transaction
from django.db.models import Count, Max, Prefetch, Q
from django.http import HttpRequest, HttpResponseRedirect
from django.shortcuts import render
from django.urls import NoReverseMatch, reverse
from django.urls import NoReverseMatch, re_path, reverse
from django.utils.html import format_html, format_html_join
from django.utils.translation import gettext_lazy as _
from import_export import resources
Expand All @@ -16,7 +16,6 @@
from import_export.formats import base_formats
from moneyed.localization import format_money
from structlog import get_logger
from typing import Dict

from .actions import accounts, invoices
from .models import (
Expand Down Expand Up @@ -505,10 +504,10 @@ def get_queryset(self, request):

def get_urls(self):
custom_urls = [
re_path(r'^(?P<invoice_id>[0-9a-f-]+)/assign_funds_to_invoice/$',
re_path(r'(?P<invoice_id>[0-9a-f-]+)/assign_funds_to_invoice/',
self.admin_site.admin_view(do_assign_funds_to_invoice),
name='billing-assign-funds-to-invoice'),
re_path(r'^(?P<invoice_id>[0-9a-f-]+)/pay/$',
re_path(r'(?P<invoice_id>[0-9a-f-]+)/pay/',
self.admin_site.admin_view(do_pay_invoice_with_cc),
name='billing-pay-invoice-with-cc')
]
Expand Down Expand Up @@ -798,12 +797,12 @@ def get_urls(self):
urls = super().get_urls()
my_urls = [
re_path(
r'^(?P<account_id>[0-9a-f-]+)/create_invoices/$',
r'(?P<account_id>[0-9a-f-]+)/create_invoices/',
self.admin_site.admin_view(create_invoices_form),
name='billing-create-invoices'
),
re_path(
r'^(?P<account_id>[0-9a-f-]+)/assign_funds_to_pending_invoices/$',
r'(?P<account_id>[0-9a-f-]+)/assign_funds_to_pending_invoices/',
self.admin_site.admin_view(do_assign_funds_to_pending_invoices),
name='billing-assign-funds-to-pending-invoices'
)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)
4 changes: 2 additions & 2 deletions tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
from django.urls import include, path

urlpatterns = [
path(r'^billing/', include('billing.urls')),
path(r'^admin/', admin.site.urls),
path(r'billing/', include('billing.urls')),
path(r'admin/', admin.site.urls),
]
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[tox]
envlist =
{py36,py37}-{django22,django30}-test
py37-django30-{checkmigrations,flake,mypy,coverage}
{py36,py37,py38}-{django22,django31}-test
py38-django31-{checkmigrations,flake,mypy,coverage}

[testenv]
basepython =
py36: python3.6
py37: python3.7
py38: python3.8
commands =
test: py.test tests
checkmigrations: ./manage.py makemigrations --check --dry-run
Expand All @@ -15,7 +16,7 @@ commands =
coverage: py.test tests --cov=billing
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django-money
django-fsm
djangorestframework
Expand Down

0 comments on commit 370e733

Please sign in to comment.