Commit 42be660d authored by Laurent Peuch's avatar Laurent Peuch
Browse files

init

parents
[testenv:black-run]
basepython = python3
skip_install = true
deps =
black >= 19.10b0
commands = black -t py37 .
[testenv:black]
basepython = python3
skip_install = true
deps =
black >= 19.10b0
commands = black -t py37 --check .
[testenv:yamllint]
skip_install = true
deps = yamllint
commands =
yamllint .
from setuptools import setup
setup(
name="tox-include",
py_modules=["tox_include"],
entry_points={"tox": ["include = tox_include"]},
classifiers=["Framework:: tox"],
)
[tox]
envlist =
check-manifest,flake8,
py3-{server,web,misc},
py3-from-forge-server,
py3-from-forge-web,
py3-from-forge-misc,
doc8,
black,
yamllint,
includes =
includes/yamllint.ini
includes/black.ini
[testenv]
basepython=python3
deps =
-r{toxinidir}/requirements/dev.txt
misc: -r{toxinidir}/requirements/test-misc.txt
server: -r{toxinidir}/requirements/test-server.txt
web: -r{toxinidir}/requirements/test-web.txt
commands =
misc: {envpython} -m pip install --upgrade --no-deps --quiet https://github.com/logilab/yapps/tarball/master#egg=yapps
misc: {envpython} -m pytest --durations=20 --cov-report xml:{toxinidir}/reports/coverage-misc.xml --cov=cubicweb -rs --html=misc.html --self-contained-html --junitxml=misc.xml {posargs} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
server: {envpython} -m pytest --durations=20 --cov-report xml:{toxinidir}/reports/coverage-server.xml --cov=cubicweb -rs --html=server.html --self-contained-html --junitxml=server.xml {posargs} {toxinidir}/cubicweb/server/test
web: {envpython} -m pytest --durations=20 --cov-report xml:{toxinidir}/reports/coverage-web.xml --cov=cubicweb -rs --html=web.html --self-contained-html --junitxml=web.xml {posargs} {toxinidir}/cubicweb/web/test
[testenv:py3-from-forge-misc]
basepython=python3
deps =
-r{toxinidir}/requirements/from-forge.txt
-r{toxinidir}/requirements/dev.txt
-r{toxinidir}/requirements/test-misc.txt
commands =
{envpython} -m pip install --upgrade --no-deps --quiet https://github.com/logilab/yapps/tarball/master#egg=yapps
{envpython} -m pip install -U git+https://github.com/Psycojoker/pytest
{envpython} -m pytest {posargs} -rs --html=from-forge-misc.html --junitxml=from-forge-misc.xml --self-contained-html {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
[testenv:py3-from-forge-server]
basepython=python3
deps =
-r{toxinidir}/requirements/from-forge.txt
-r{toxinidir}/requirements/dev.txt
-r{toxinidir}/requirements/test-server.txt
commands =
{envpython} -m pip install -U git+https://github.com/Psycojoker/pytest
{envpython} -m pytest {posargs} -rs --html=from-forge-server.html --junitxml=from-forge-server.xml --self-contained-html {toxinidir}/cubicweb/server/test
[testenv:py3-from-forge-web]
basepython=python3
deps =
-r{toxinidir}/requirements/from-forge.txt
-r{toxinidir}/requirements/dev.txt
-r{toxinidir}/requirements/test-web.txt
commands =
{envpython} -m pip install -U git+https://github.com/Psycojoker/pytest
{envpython} -m pytest -rs --html=from-forge-web.html --self-contained-html --junitxml=from-forge-web.xml {posargs} {toxinidir}/cubicweb/web/test
[testenv:flake8]
skip_install = true
deps =
flake8 >= 3.6
whitelist_externals =
/bin/sh
commands = /bin/sh -c "flake8 {posargs} `xargs -a {toxinidir}/flake8-ok-files.txt`"
[testenv:doc]
skip_install = true
changedir = doc
deps =
sphinx
-r{toxinidir}/requirements/doc.txt
commands =
{envpython} -m sphinx -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:check-manifest]
skip_install = true
deps =
check-manifest
commands =
{envpython} -m check_manifest {toxinidir}
[testenv:doc8]
skip_install = true
deps =
doc8
commands=
doc8 --ignore-path doc/_build --ignore-path .tox --ignore-path .hg doc
[pytest]
python_files = *test_*.py
log_print = false
[flake8]
basepython = python3
format = pylint
ignore = W503, E203, E731, E231
max-line-length = 100
exclude = doc/*,.tox/*
[doc8]
#max-line-length=199
#ignore-path-errors=SOURCES.txt;D005
# D000 - Interpreted text role "index" everywhere
# D001 - line too long... to much of it right now
ignore=D000,D001,D005
# FIXME - can't get ignore-path-error to ignore D000, so ignoring files
ignore-path=doc/_build
extension=.rst
[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
python3
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
import pluggy
from tox.config import ParseIni, parseconfig
from py._path.local import LocalPath
hookimpl = pluggy.HookimplMarker("tox")
def _merge_tox_section(config, included_config):
pass
@hookimpl
def tox_configure(config):
"""Post process config after parsing."""
resulting_config = open(config._cfg.path, "r").read()
for to_include in config._cfg.sections.get("tox", {}).get("includes", "").split("\n"):
if not to_include:
continue
resulting_config += "\n" + open(to_include, "r").read()
to_include = parseconfig(["-c", to_include])
config._cfg.sections.update(to_include._cfg.sections)
ParseIni(config, LocalPath(config._cfg.path), resulting_config)
return
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment