chore: Adapt project env to memoorje

This commit is contained in:
aldrin 2021-10-21 09:43:01 +02:00
parent 5206f95e3f
commit 96f4a81a3b
7 changed files with 116 additions and 40 deletions

17
.editorconfig Normal file
View file

@ -0,0 +1,17 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[{Makefile,debian/rules,make.d/*}]
indent_style = tab
indent_size = 4

46
.gitignore vendored
View file

@ -1,35 +1,27 @@
# local env files
.env
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
node_modules
/dist
__pycache__/
/data/*
!/data/.gitkeep
/db.sqlite3
/venv/
/media/
/dist/
*.egg-info/
/build/
/.pybuild/
/.tox/
.coverage*
/debian/*debhelper*
/debian/*.substvars
/debian/files
/debian/python3-userausfall/
/debian/userausfall/
/debian/userausfall-webapp/
/.pybuild/
/build/
/userausfall.egg-info/
node_modules/
app/dist/
npm-debug.log*
.idea/
*.env*
*.swp

13
pyproject.toml Normal file
View file

@ -0,0 +1,13 @@
[tool.black]
line-length = 120
target-version = ['py39']
exclude = '''
(
/(
\.eggs
| \.git
| \.tox
| migrations
)
)
'''

View file

@ -1,4 +0,0 @@
setuptools~=40.8.0
django~=2.2.13
djangorestframework~=3.9.0
ldap3~=2.4.1

7
setup.cfg Normal file
View file

@ -0,0 +1,7 @@
[flake8]
max-line-length = 120
select = C,E,F,I,W,B,B950
ignore = E203, E501, W503
exclude = .tox, node_modules, src, **/migrations/*.py
import-order-style = google
application-import-names = userausfall

View file

@ -1,19 +1,45 @@
from setuptools import setup, find_packages
import os
from setuptools import find_namespace_packages, setup, find_packages
from userausfall import __version__
__dir__ = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(__dir__, "README.md")) as f:
long_description = "\n" + f.read()
except FileNotFoundError:
long_description = ""
setup(
name="userausfall",
version=__version__,
description="account management for systemausfall.org",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://git.systemausfall.org/systemausfall.org/userausfall",
author="Robert Waltemath",
author_email="rw@roko.li",
packages=find_packages(),
install_requires=(
"django>=2.2<3.0",
# "djangorestframework>=3.12<4.0",
# "djoser>=2.1<3.0",
),
author="userausfall developers",
author_email="hallo@roko.li",
license="AGPL-3.0-or-later",
packages=find_namespace_packages(include=["userausfall"]),
install_requires=[
"django~=3.2.8",
"djangorestframework~=3.12.1",
"djangorestframework-camel-case~=1.2.0",
"django-filter~=2.4.0",
"django-rest-registration~=0.6.4",
"djeveric@https://git.hack-hro.de/memoorje/djeveric/-/archive/main/djeveric-main.tar.gz",
"drf-spectacular~=0.18.2",
"ldap3~=2.8.1",
],
include_package_data=True,
classifiers=[
"Development Status :: 3 - Alpha",
"Framework :: Django :: 3.2",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Internet :: WWW/HTTP",
],
)

25
tox.ini Normal file
View file

@ -0,0 +1,25 @@
[tox]
envlist = lint, test-py3-app
skip_missing_interpreters = true
minversion = 3.21.0
[testenv:lint]
# no need to install package with deps to lint sources
skip_install = true
deps =
black
flake8
flake8-import-order
setenv =
FORMAT_PATHS = userausfall{/} setup.py libpy{/}
commands =
python3 -m flake8 {env:FORMAT_PATHS}
python3 -m black --check {env:FORMAT_PATHS}
[testenv:test-py3-app]
sitepackages = true
deps =
coverage
setenv = DJANGO_SETTINGS_MODULE=userausfall.settings
commands =
python3 -m coverage run --append --source='userausfall' -m django test --verbosity=2