diff --git a/.gitignore b/.gitignore index be5101843..a3d55c97d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ debug/* # Unit test and coverage reports .coverage tests/file/* +tests/db.sqlite3.test .pytest_cache # Plugin development diff --git a/.travis.yml b/.travis.yml index e85b67eb0..2432d19ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,6 +98,17 @@ matrix: - mypy openslides/ tests/ - pytest --cov --cov-fail-under=73 + - name: "Server: Tests Python 3.8" + language: python + python: + - "3.8" + script: + - flake8 openslides tests + - isort --check-only --diff --recursive openslides tests + - black --check --diff --target-version py36 openslides tests + - mypy openslides/ tests/ + - pytest --cov --cov-fail-under=73 + - name: "Client: Linting" language: node_js node_js: "10.9" diff --git a/manage.py b/manage.py index 27d6ee2d0..93e992d35 100755 --- a/manage.py +++ b/manage.py @@ -7,5 +7,5 @@ from openslides.__main__ import main if __name__ == "__main__": if len(sys.argv) == 1: - sys.argv.append('--help') + sys.argv.append("--help") exit(main()) diff --git a/requirements/big_mode.txt b/requirements/big_mode.txt index 4b89a3b1f..65dab43c4 100644 --- a/requirements/big_mode.txt +++ b/requirements/big_mode.txt @@ -1,5 +1,5 @@ # Requirements for Redis and PostgreSQL support -channels-redis>=2.2,<2.4 +channels-redis>=2.2,<2.5 django-redis-sessions>=0.6.1,<0.7 psycopg2-binary>=2.7.3.2,<2.9 aioredis>=1.1.0,<1.3 diff --git a/requirements/production.txt b/requirements/production.txt index 76231f0d9..365f7194d 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -3,8 +3,8 @@ autobahn==19.5.1 # Requirements for OpenSlides in production in alphabetical order bleach>=1.5.0,<3.2 -channels>=2.1.2,<2.2 -daphne>=2.2,<2.3 +channels>=2.1.2,<2.4 +daphne>=2.2,<2.5 Django>=2.1,<2.3 djangorestframework>=3.9.4,<3.10 jsonfield2>=3.0,<3.1 diff --git a/setup.py b/setup.py index cfc8b6074..49695fc1a 100644 --- a/setup.py +++ b/setup.py @@ -8,38 +8,39 @@ from openslides import __version__ as openslides_version from openslides import __license__ as openslides_license from openslides import __url__ as openslides_url -with open('README.rst') as readme: +with open("README.rst") as readme: long_description = readme.read() -with open('requirements/production.txt') as requirements_production: +with open("requirements/production.txt") as requirements_production: install_requires = requirements_production.readlines() -with open('requirements/big_mode.txt') as requirements_big_mode: +with open("requirements/big_mode.txt") as requirements_big_mode: extras_requires = requirements_big_mode.readlines() setup( - name='openslides', + name="openslides", author=openslides_author, - author_email='support@openslides.com', + author_email="support@openslides.com", description=openslides_description, license=openslides_license, long_description=long_description, url=openslides_url, version=openslides_version, - classifiers=[ # http://pypi.python.org/pypi?%3Aaction=list_classifiers # 'Development Status :: 3 - Alpha', - 'Development Status :: 4 - Beta', + "Development Status :: 4 - Beta", # 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - 'Framework :: Django', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', ], - packages=find_packages(exclude=['tests', 'tests.*']), + "Environment :: Web Environment", + "Framework :: Django", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + ], + packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, install_requires=install_requires, - extras_require={'big_mode': extras_requires}, - entry_points={'console_scripts': ['openslides = openslides.__main__:main']}) + extras_require={"big_mode": extras_requires}, + entry_points={"console_scripts": ["openslides = openslides.__main__:main"]}, +) diff --git a/tests/settings.py b/tests/settings.py index c37f2a677..c8355d661 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -38,7 +38,12 @@ DEBUG = False # Change this setting to use e. g. PostgreSQL or MySQL. -DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}} +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "TEST": {"NAME": os.path.join(OPENSLIDES_USER_DATA_PATH, "db.sqlite3.test")}, + } +} SESSION_ENGINE = "django.contrib.sessions.backends.cache"