tox.ini 2.16 KB
Newer Older
Yann Voté's avatar
Yann Voté committed
1
[tox]
Denis Laxalde's avatar
Denis Laxalde committed
2
envlist = py27, py3, flake8, check-manifest
Yann Voté's avatar
Yann Voté committed
3
4

[testenv]
Sylvain Thénault's avatar
Sylvain Thénault committed
5
deps =
6
  -rdev-requirements.txt
Sylvain Thénault's avatar
Sylvain Thénault committed
7
commands = {envpython} -m pytest {posargs:{toxinidir}/test}
Yann Voté's avatar
Yann Voté committed
8

9
10
[pytest]
python_files = *test_*.py
11
log_capture = false
12

13
14
15
16
17
18
19
20
[testenv:check-manifest]
skip_install = true
deps =
  check-manifest
commands =
  {envpython} -m check_manifest {toxinidir}


Yann Voté's avatar
Yann Voté committed
21
22
23
24
[testenv:flake8]
skip_install = true
deps =
  flake8
Sylvain Thénault's avatar
Sylvain Thénault committed
25
commands = flake8 {posargs:{toxinidir}}
Yann Voté's avatar
Yann Voté committed
26
27
28
29
30
31
32

[testenv:flake8-jenkins]
skip_install = true
deps =
  flake8
commands = flake8 --exit-zero --show-source --output-file=code_quality.log {toxinidir}

33
34
35
36
37
[flake8]
format = pylint
ignore = W503
max-line-length = 100
max-complexity = 12
38
exclude = doc/conf.py,cubicweb_seda/uiprops.py,cubicweb_seda/entities/generated.py,cubicweb_seda/views/uicfg.py,cubicweb_seda/schema/seda2.py,cubicweb_seda/migration/*,test/data/*,.tox/*
39
40


41
42
43
44
45
[testenv:make]
whitelist_externals =
  make
setenv =
    PYTHONHASHSEED = 0
46
commands = make -C cubicweb_seda {posargs}
47

48

49
50
51
52
53
[testenv:doc]
changedir = doc
deps =
  sphinx
commands = sphinx-build -b html -d {envtmpdir}/doctrees .  {envtmpdir}/html
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

[testenv:pypi-publish]
basepython = python3
skip_install = true
whitelist_externals = rm
deps =
  twine
passenv =
  TWINE_USERNAME
  TWINE_PASSWORD
commands =
  rm -rf build dist .egg .egg-info
  python3 setup.py sdist bdist_wheel
  twine check dist/*
  twine upload --skip-existing dist/*

[testenv:deb-publish]
passenv = JENKINS_USER JENKINS_TOKEN
basepython = python3
skip_install = true
whitelist_externals =
  rm
  sh
  hg
deps =
  httpie
commands =
  hg clean --all --dirs --files
  rm -rf build dist .egg .egg-info
  python3 setup.py sdist
  sh -c "PACKAGE_NAME=$(python3 setup.py --name) && VERSION=$(python3 setup.py --version) &&   cd dist &&   tar xf $PACKAGE_NAME-$VERSION.tar.gz &&   cd $PACKAGE_NAME-$VERSION &&   cp -a {toxinidir}/debian . &&   mk-origtargz --rename ../$PACKAGE_NAME-$VERSION.tar.gz &&   dpkg-buildpackage -us -uc --no-check-builddeps --build=source "
  sh -c "cd dist && dcmd zip latest.zip *.changes"
  http -f POST https://{env:JENKINS_USER}:{env:JENKINS_TOKEN}@jenkins.intra.logilab.fr/job/pkg-from-dsc/buildWithParameters DIST=buster source.zip@dist/latest.zip REPO=buster PUBLISH=true