setup.cfg 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. [tool:pytest]
  2. addopts = --typeguard-packages=radicale
  3. [tox:tox]
  4. [testenv]
  5. extras = test
  6. deps =
  7. flake8
  8. isort
  9. # mypy installation fails with pypy<3.9
  10. mypy; implementation_name!='pypy' or python_version>='3.9'
  11. types-setuptools
  12. pytest-cov
  13. commands =
  14. flake8 .
  15. isort --check --diff .
  16. # Run mypy if it's installed
  17. python -c 'import importlib.util, subprocess, sys; \
  18. importlib.util.find_spec("mypy") \
  19. and sys.exit(subprocess.run(["mypy", "."]).returncode) \
  20. or print("Skipped: mypy is not installed")'
  21. pytest -r s --cov --cov-report=term --cov-report=xml .
  22. [tool:isort]
  23. known_standard_library = _dummy_thread,_thread,abc,aifc,argparse,array,ast,asynchat,asyncio,asyncore,atexit,audioop,base64,bdb,binascii,binhex,bisect,builtins,bz2,cProfile,calendar,cgi,cgitb,chunk,cmath,cmd,code,codecs,codeop,collections,colorsys,compileall,concurrent,configparser,contextlib,contextvars,copy,copyreg,crypt,csv,ctypes,curses,dataclasses,datetime,dbm,decimal,difflib,dis,distutils,doctest,dummy_threading,email,encodings,ensurepip,enum,errno,faulthandler,fcntl,filecmp,fileinput,fnmatch,formatter,fpectl,fractions,ftplib,functools,gc,getopt,getpass,gettext,glob,grp,gzip,hashlib,heapq,hmac,html,http,imaplib,imghdr,imp,importlib,inspect,io,ipaddress,itertools,json,keyword,lib2to3,linecache,locale,logging,lzma,macpath,mailbox,mailcap,marshal,math,mimetypes,mmap,modulefinder,msilib,msvcrt,multiprocessing,netrc,nis,nntplib,ntpath,numbers,operator,optparse,os,ossaudiodev,parser,pathlib,pdb,pickle,pickletools,pipes,pkgutil,platform,plistlib,poplib,posix,posixpath,pprint,profile,pstats,pty,pwd,py_compile,pyclbr,pydoc,queue,quopri,random,re,readline,reprlib,resource,rlcompleter,runpy,sched,secrets,select,selectors,shelve,shlex,shutil,signal,site,smtpd,smtplib,sndhdr,socket,socketserver,spwd,sqlite3,sre,sre_compile,sre_constants,sre_parse,ssl,stat,statistics,string,stringprep,struct,subprocess,sunau,symbol,symtable,sys,sysconfig,syslog,tabnanny,tarfile,telnetlib,tempfile,termios,test,textwrap,threading,time,timeit,tkinter,token,tokenize,trace,traceback,tracemalloc,tty,turtle,turtledemo,types,typing,unicodedata,unittest,urllib,uu,uuid,venv,warnings,wave,weakref,webbrowser,winreg,winsound,wsgiref,xdrlib,xml,xmlrpc,zipapp,zipfile,zipimport,zlib
  24. known_third_party = defusedxml,passlib,pkg_resources,pytest,vobject
  25. [flake8]
  26. # Only enable default tests (https://github.com/PyCQA/flake8/issues/790#issuecomment-812823398)
  27. select = E,F,W,C90,DOES-NOT-EXIST
  28. ignore = E121,E123,E126,E226,E24,E704,W503,W504,DOES-NOT-EXIST
  29. extend-exclude = ./build/
  30. [mypy]
  31. ignore_missing_imports = True
  32. show_error_codes = True
  33. exclude = ^build/
  34. [coverage:run]
  35. branch = True
  36. source = radicale
  37. omit = tests/*,*/tests/*
  38. [coverage:report]
  39. # Regexes for lines to exclude from consideration
  40. exclude_lines =
  41. # Have to re-enable the standard pragma
  42. pragma: no cover
  43. # Don't complain if tests don't hit defensive assertion code:
  44. raise AssertionError
  45. raise NotImplementedError
  46. # Don't complain if non-runnable code isn't run:
  47. if __name__ == .__main__.: