Merge branch 'py310' into 'v2.9.x'

Python 3.10 Support

See merge request allianceauth/allianceauth!1367
This commit is contained in:
Ariel Rin 2021-11-27 03:35:40 +00:00
commit 89d4640e92
8 changed files with 25 additions and 30 deletions

1
.gitignore vendored
View File

@ -38,7 +38,6 @@ htmlcov/
.tox/ .tox/
.coverage .coverage
.cache .cache
nosetests.xml
coverage.xml coverage.xml
# Translations # Translations

View File

@ -65,6 +65,15 @@ test-3.9-core:
reports: reports:
cobertura: coverage.xml cobertura: coverage.xml
test-3.10-core:
image: python:3.10-bullseye
script:
- tox -e py310-core
artifacts:
when: always
reports:
cobertura: coverage.xml
test-3.7-all: test-3.7-all:
image: python:3.7-bullseye image: python:3.7-bullseye
script: script:
@ -92,9 +101,18 @@ test-3.9-all:
reports: reports:
cobertura: coverage.xml cobertura: coverage.xml
test-3.10-all:
image: python:3.10-bullseye
script:
- tox -e py310-all
artifacts:
when: always
reports:
cobertura: coverage.xml
deploy_production: deploy_production:
stage: deploy stage: deploy
image: python:3.9-bullseye image: python:3.10-bullseye
before_script: before_script:
- pip install twine wheel - pip install twine wheel

View File

@ -419,7 +419,7 @@ class TestUserAdmin(TestCaseWithTestData):
# actions # actions
@patch(MODULE_PATH + '.UserAdmin.message_user', auto_spec=True) @patch(MODULE_PATH + '.UserAdmin.message_user', auto_spec=True, unsafe=True)
@patch(MODULE_PATH + '.update_character') @patch(MODULE_PATH + '.update_character')
def test_action_update_main_character_model( def test_action_update_main_character_model(
self, mock_task, mock_message_user self, mock_task, mock_message_user

View File

@ -13,4 +13,3 @@ celery>5,<6
celery_once celery_once
passlib passlib
redis>=3.3.1,<4.0.0 redis>=3.3.1,<4.0.0
django-nose

View File

@ -39,7 +39,6 @@ install_requires = [
testing_extras = [ testing_extras = [
'coverage>=4.3.1', 'coverage>=4.3.1',
'requests-mock>=1.2.0', 'requests-mock>=1.2.0',
'django-nose',
'django-webtest', 'django-webtest',
] ]
@ -80,6 +79,7 @@ setup(
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
], ],

View File

@ -6,15 +6,6 @@ Testing all services and plug-in apps
from allianceauth.project_template.project_name.settings.base import * from allianceauth.project_template.project_name.settings.base import *
# Use nose to run all tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
#'--with-coverage',
#'--cover-package=',
#'--exe', # If your tests need this to be found/run, check they py files are not chmodded +x
]
# Celery configuration # Celery configuration
CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing
@ -36,7 +27,6 @@ INSTALLED_APPS += [
'allianceauth.services.modules.phpbb3', 'allianceauth.services.modules.phpbb3',
'allianceauth.services.modules.xenforo', 'allianceauth.services.modules.xenforo',
'allianceauth.services.modules.teamspeak3', 'allianceauth.services.modules.teamspeak3',
'django_nose',
] ]
ROOT_URLCONF = 'tests.urls' ROOT_URLCONF = 'tests.urls'

View File

@ -6,21 +6,9 @@ Testing core packages only
from allianceauth.project_template.project_name.settings.base import * from allianceauth.project_template.project_name.settings.base import *
# Use nose to run all tests
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
#'--with-coverage',
#'--cover-package=',
#'--exe', # If your tests need this to be found/run, check they py files are not chmodded +x
]
# Celery configuration # Celery configuration
CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing
INSTALLED_APPS += [
'django_nose',
]
ROOT_URLCONF = 'tests.urls' ROOT_URLCONF = 'tests.urls'

View File

@ -1,7 +1,7 @@
[tox] [tox]
skipsdist = true skipsdist = true
usedevelop = true usedevelop = true
envlist = py{37,38,39}-{all,core} envlist = py{37,38,39,310}-{all,core}
[testenv] [testenv]
setenv = setenv =
@ -11,11 +11,12 @@ basepython =
py37: python3.7 py37: python3.7
py38: python3.8 py38: python3.8
py39: python3.9 py39: python3.9
py310: python3.10
deps= deps=
coverage coverage
install_command = pip install -e ".[testing]" -U {opts} {packages} install_command = pip install -e ".[testing]" -U {opts} {packages}
commands = commands =
all: coverage run runtests.py -v 2 all: coverage run runtests.py -v 2 --debug-mode
core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2 core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2 --debug-mode
all: coverage report -m all: coverage report -m
all: coverage xml all: coverage xml