Skip to content
Open

Ci #577

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ envlist = py{39,310,311,312,313}-{PySide6,cli}
isolated_build = true

[tool:pytest]
;testpath = tests
addopts = --verbose --faulthandler-timeout=10

[testenv]
deps =
pytest
pytest-mock
-c requirements-dev.txt

download=true
commands = {env_bin_dir}{/}pytest --basetemp={envtmpdir} {env:pytest_args:} {posargs}
Expand All @@ -23,15 +23,20 @@ set_env =
QT_QPA_PLATFORM=offscreen
download=true
deps =
-r requirements-dev.txt
-r requirements-gui.txt
pytest
pytest-mock
PySide6
pytest-qt
-c requirements-dev.txt
-c requirements-gui.txt
commands = {env_bin_dir}{/}pytest --basetemp={envtmpdir} {env:pytest_args:} {posargs}

extras = QT
; ======================== tests ========================
[testenv:docs]
deps=
sphinx
sphinx-argparse
-c requirements-dev.txt
commands=
sphinx-build {env:sphinx_args:-W -b html -d "{envtmpdir}/doctrees" docs/source "{distdir}/html"}

Expand All @@ -41,7 +46,7 @@ deps =
lxml
types-PyYAML
types-requests

-c requirements-dev.txt
skip_install=True
setenv = MYPY_CACHE_DIR = {temp_dir}/.mypy_cache
commands = mypy {posargs: -p speedwagon}
Expand All @@ -50,44 +55,48 @@ commands = mypy {posargs: -p speedwagon}
description = check the code style
deps =
flake8
-c requirements-dev.txt
skip_install=True
commands = flake8 {posargs: speedwagon}


[testenv:pylint]
description = check the code style
deps =
pylint
-c requirements-dev.txt
skip_install=True
commands = pylint {posargs: speedwagon} --disable import-error


[testenv:doctest]
skip_install = true
deps=
sphinx
sphinx-argparse
PyYAML
pluggy
-r requirements-vendor.txt
-c requirements-dev.txt
commands = python -m sphinx -b doctest docs/source "{envtmpdir}/build/docs" -d "{envtmpdir}/build/docs/doctrees"

[testenv:pydocstyle]
skip_install = true
deps=
pydocstyle
toml
-c requirements-dev.txt
commands =
pydocstyle {posargs: {toxinidir}/speedwagon}

[testenv:bandit]
skip_install = true
deps=
bandit
-c requirements-dev.txt

commands =
bandit {posargs: --recursive {toxinidir}/speedwagon}

[testenv:ruff]
skip_install = true
deps=
ruff
-c requirements-dev.txt

commands =
ruff check {posargs: {toxinidir}/speedwagon}
24 changes: 12 additions & 12 deletions vars/runJenkinsPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def call(){
trap "rm -rf venv" EXIT
. ./venv/bin/activate
pip install --disable-pip-version-check uv
uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b html -d build/docs/.doctrees -w logs/build_sphinx_html.log docs/source build/docs/html
uvx --from sphinx --with-editable . --with-requirements requirements-dev.txt sphinx-build -W --keep-going -b latex -d build/docs/.doctrees docs/source build/docs/latex
uvx --constraint=requirements-dev.txt --from sphinx --with sphinx-argparse --with-editable . sphinx-build -W --keep-going -b html -d build/docs/.doctrees -w logs/build_sphinx_html.log docs/source build/docs/html
uvx --constraint=requirements-dev.txt --from sphinx --with sphinx-argparse --with-editable . sphinx-build -W --keep-going -b latex -d build/docs/.doctrees docs/source build/docs/latex
''')
sh(label: 'Building PDF docs',
script: '''make -C build/docs/latex
Expand Down Expand Up @@ -482,7 +482,7 @@ def call(){
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
envs = sh(
label: 'Get tox environments',
script: './venv/bin/uvx --quiet --with tox-uv tox list -d --no-desc',
script: './venv/bin/uvx --constraint=requirements-dev.txt --quiet --with tox-uv tox list -d --no-desc',
returnStdout: true,
).trim().split('\n')
} finally{
Expand Down Expand Up @@ -514,7 +514,7 @@ def call(){
. ./venv/bin/activate
uv python install cpython-${version}
trap "rm -rf ./venv ./.tox" EXIT
uvx -p ${version} --with tox-uv tox run -e ${toxEnv}
uvx -p ${version} --constraint=requirements-dev.txt --with tox-uv tox run -e ${toxEnv}
"""
)
}
Expand Down Expand Up @@ -560,7 +560,7 @@ def call(){
bat(script: 'python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv')
envs = bat(
label: 'Get tox environments',
script: '@.\\venv\\Scripts\\uvx --quiet --with tox-uv tox list -d --no-desc',
script: '@.\\venv\\Scripts\\uvx --quiet --constraint=requirements-dev.txt --with tox-uv tox list -d --no-desc',
returnStdout: true,
).trim().split('\r\n')
}
Expand Down Expand Up @@ -589,7 +589,7 @@ def call(){
bat(label: 'Running Tox',
script: """python -m venv venv && venv\\Scripts\\pip install --disable-pip-version-check uv
venv\\Scripts\\uv python install cpython-${version}
venv\\Scripts\\uvx -p ${version} --with tox-uv tox run -e ${toxEnv}
venv\\Scripts\\uvx -p ${version} --constraint=requirements-dev.txt --with tox-uv tox run -e ${toxEnv}
"""
)
}
Expand Down Expand Up @@ -706,7 +706,7 @@ def call(){
script: '''python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv
trap "rm -rf venv" EXIT
. ./venv/bin/activate
uvx --with $(grep \'^twine\' requirements-dev.txt) twine check --strict dist/*
uvx --constraint requirements-dev.txt twine check --strict dist/*
'''
)
}
Expand Down Expand Up @@ -767,7 +767,7 @@ def call(){
script: """python3 -m venv venv
./venv/bin/pip install --disable-pip-version-check uv
./venv/bin/uv python install cpython-${entry.PYTHON_VERSION}
./venv/bin/uvx --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
./venv/bin/uvx --constraint=requirements-dev.txt --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
}
Expand All @@ -785,7 +785,7 @@ def call(){
script: """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
.\\venv\\Scripts\\uvx --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
.\\venv\\Scripts\\uvx --constraint=requirements-dev.txt --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
}
Expand All @@ -797,7 +797,7 @@ def call(){
label: 'Testing with tox',
script: """python3 -m venv venv
./venv/bin/pip install --disable-pip-version-check uv
./venv/bin/uvx --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
./venv/bin/uvx --constraint=requirements-dev.txt --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
} else {
Expand All @@ -806,7 +806,7 @@ def call(){
script: """python -m venv venv
.\\venv\\Scripts\\pip install --disable-pip-version-check uv
.\\venv\\Scripts\\uv python install cpython-${entry.PYTHON_VERSION}
.\\venv\\Scripts\\uvx --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
.\\venv\\Scripts\\uvx --constraint=requirements-dev.txt --with tox-uv tox --installpkg ${findFiles(glob: entry.PACKAGE_TYPE == 'wheel' ? 'dist/*.whl' : 'dist/*.tar.gz')[0].path} -e py${entry.PYTHON_VERSION.replace('.', '')}
"""
)
}
Expand Down Expand Up @@ -892,7 +892,7 @@ def call(){
trap "rm -rf venv" EXIT
. ./venv/bin/activate
pip install --disable-pip-version-check uv
uvx --with $(grep \'^twine\' requirements-dev.txt) twine upload --disable-progress-bar --non-interactive dist/*
uvx --constraint=requirements-dev.txt twine upload --disable-progress-bar --non-interactive dist/*
'''
)
}
Expand Down