Skip to content
Merged
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
8 changes: 6 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@
#
import os
import sys
import tomllib
if sys.version_info < (3, 11):
from tomli import load as load_toml
else:
from tomllib import load as load_toml


sys.path.insert(0, os.path.abspath('../..'))
def get_project_metadata():
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../pyproject.toml"))
with open(path, "rb") as f:
return tomllib.load(f)['project']
return load_toml(f)['project']

metadata = get_project_metadata()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
]

[dependency-groups]
docs = ["sphinx"]
docs = ["sphinx", "tomli ; python_full_version < '3.11'"]
type_checking = [
"mypy",
"lxml",
Expand Down
12 changes: 10 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 33 additions & 26 deletions vars/runJenkinsPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,19 @@ def call(){
./venv/bin/uv run --group docs --no-dev sphinx-build docs/source build/docs/html -d build/docs/.doctrees -v -w logs/build_sphinx.log
'''
)
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/docs/html', reportFiles: 'index.html', reportName: 'Documentation', reportTitles: ''])
script{
def props = readTOML( file: 'pyproject.toml')['project']
def DOC_ZIP_FILENAME = "${props.name}-${props.version}.doc.zip"
zip archive: true, dir: 'build/docs/html', glob: '', zipFile: "dist/${DOC_ZIP_FILENAME}"
}
stash includes: 'build/docs/html/**,dist/*.doc.zip', name: 'DOCS_ARCHIVE'
}
post{
always {
recordIssues(tools: [sphinxBuild(name: 'Sphinx Documentation Build', pattern: 'logs/build_sphinx.log', id: 'sphinx_build')])
archiveArtifacts artifacts: 'logs/build_sphinx.log'
}
success{
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/docs/html', reportFiles: 'index.html', reportName: 'Documentation', reportTitles: ''])
script{
def props = readTOML( file: 'pyproject.toml')['project']
def DOC_ZIP_FILENAME = "${props.name}-${props.version}.doc.zip"
zip archive: true, dir: 'build/docs/html', glob: '', zipFile: "dist/${DOC_ZIP_FILENAME}"
}
stash includes: 'build/docs/html/**,dist/*.doc.zip', name: 'DOCS_ARCHIVE'
}
failure{
echo 'Failed to build Python package'
}
Expand Down Expand Up @@ -225,24 +223,33 @@ def call(){
steps{
script{
def envs = []
node('docker && linux'){
docker.image('python').inside('--mount source=python-tmp-packageValidation,target=/tmp'){
retry(2){
node('docker && linux'){
checkout scm
try{
checkout scm
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
envs = sh(
label: 'Get tox environments',
script: './venv/bin/uv run --only-group tox --with tox-uv --isolated --quiet tox list -d --no-desc',
returnStdout: true,
).trim().split('\n')
} finally{
cleanWs(
patterns: [
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '.tox', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
]
)
docker.image('python').inside('--mount source=python-tmp-packageValidation,target=/tmp'){
retry(2){
try{
sh(script: 'python3 -m venv venv && venv/bin/pip install --disable-pip-version-check uv')
envs = sh(
label: 'Get tox environments',
script: './venv/bin/uv run --only-group tox --with tox-uv --isolated --quiet tox list -d --no-desc',
returnStdout: true,
).trim().split('\n')
} catch (e){
cleanWs(
patterns: [
[pattern: 'venv/', type: 'INCLUDE'],
[pattern: '.tox', type: 'INCLUDE'],
[pattern: '**/__pycache__/', type: 'INCLUDE'],
]
)
throw e
}
}
}
} finally {
sh "${tool(name: 'Default', type: 'git')} clean -dfx"
}
}
}
Expand Down