tox.ini 1.51 KB
Newer Older
1
[tox]
2
envlist = py27, py3, flake8
3
4
5
6

[testenv]
deps =
  pytest
7
  git+https://github.com/psycojoker/pytest-capture-deprecatedwarnings
8
9
10
11
12
13
14
commands =
  {envpython} -m pytest {posargs}

[pytest]
python_files = *test_*.py
testpaths = test
addopts = -r fEs
15
16
17
18
19
20
21
22
23

[testenv:flake8]
basepython = python3
skip_install = true
deps =
  flake8
commands = flake8

[flake8]
24
25
max-line-length = 120
exclude = cubicweb_geocoding/migration/*,.tox/*
Laurent Peuch's avatar
Laurent Peuch committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

[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/*
Laurent Peuch's avatar
Laurent Peuch committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

[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