Skip to content

Commit

Permalink
feat: ✨ Add support for python3.9 and django3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiabhi94 committed Apr 18, 2021
1 parent 08c42e9 commit 9fb8fd7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Expand Up @@ -18,6 +18,7 @@ jobs:
- 3.6
- 3.7
- 3.8
- 3.9

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,6 +9,7 @@ docs/_build

.tox
.coverage
coverage*

# editor files
.idea
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Expand Up @@ -6,7 +6,7 @@
BASE_DIR = os.path.dirname(os.path.abspath(__file__))


def get_version(rel_path):
def get_version():
return importlib.import_module('flag').__version__


Expand All @@ -20,7 +20,7 @@ def read(rel_path):

setuptools.setup(
name='django-flag-app',
version=get_version('flag/__init__.py'),
version=get_version(),
author='Abhyudai',
author_email='',
description='A pluggable django application that adds the ability for users to flag(or report) your models',
Expand All @@ -39,18 +39,20 @@ def read(rel_path):
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'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',
'Programming Language :: Python :: 3.9',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
python_requires='>=3.6',
install_requires=['django'],
keywords='django flag report',
keywords='django flag report moderate',
zip_safe=False,
)
15 changes: 5 additions & 10 deletions testapp/settings.py
@@ -1,16 +1,8 @@
"""
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
import os

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import django

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))


Expand Down Expand Up @@ -134,6 +126,9 @@
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = LOGIN_URL

if django.VERSION >= (3, 2):
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', 'user@domain')
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD', 'password')
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
@@ -1,13 +1,16 @@
[tox]
envlist =
py{36,37,38}-{dj21, dj22, dj30, dj31}
py{38}-{djmain}
py36-dj{21, 22, 30, 31, 32}
py37-dj{21, 22, 30, 31, 32}
py38-dj{21, 22, 30, 31, 32, main}
py39-dj{21, 22, 30, 31, 32, main}

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39

[testenv:docs]
deps =
Expand All @@ -21,13 +24,13 @@ deps =
flake8
Pillow
djangorestframework
coverage
pytest-django
pytest-cov
dj21: Django>=2.1,<2.2
dj22: Django>=2.2,<2.3
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2,<3.3
djmain: https://github.com/django/django/archive/main.tar.gz

usedevelop = True
Expand Down

0 comments on commit 9fb8fd7

Please sign in to comment.