Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
22c8b30
feat: use uv lockfile
SMoraisAnsys Aug 2, 2026
8ba8ed8
refactor: add missing flag
SMoraisAnsys Aug 2, 2026
b4bd070
refactor: extend uv lockfiles to other actions
SMoraisAnsys Aug 2, 2026
a367f76
chore: extend uv lockfile usage to pytest action
SMoraisAnsys Aug 3, 2026
547c33c
refactor: update conditions and log message
SMoraisAnsys Aug 3, 2026
dfd46bc
fix: if statement
SMoraisAnsys Aug 3, 2026
33e2abb
Update build-library/action.yml
SMoraisAnsys Aug 3, 2026
b8bd78f
fix: wrong env variable handling
SMoraisAnsys Aug 3, 2026
a1bba0d
fix: wrong use of working dir input
SMoraisAnsys Aug 3, 2026
cca932f
fix: add missing case with sync
SMoraisAnsys Aug 3, 2026
a91a9b0
tbr: point doc build to self reference
SMoraisAnsys Aug 3, 2026
a8b338c
fix: wrong check uv lockfile and requirements
SMoraisAnsys Aug 3, 2026
c474cb3
chore: add doc optionnal dependency and bump min python
SMoraisAnsys Aug 3, 2026
74f2ffd
fix: same issue with tests-pytest
SMoraisAnsys Aug 3, 2026
fa25240
chore: remove requirements_doc.txt file
SMoraisAnsys Aug 3, 2026
cb18ea1
ci: trigger update on python version 3.12+
SMoraisAnsys Aug 3, 2026
f60b8a8
ci: fix use of group dependency
SMoraisAnsys Aug 3, 2026
80917c3
Revert "ci: trigger update on python version 3.12+"
SMoraisAnsys Aug 3, 2026
2b6a343
chore: update requirements files
SMoraisAnsys Aug 3, 2026
59d66fb
ci: update doc-build to use uv lockfile
SMoraisAnsys Aug 3, 2026
4746502
fix: use correct command to install packages
SMoraisAnsys Aug 3, 2026
a252b9a
fix: content for powershell and homohenize
SMoraisAnsys Aug 3, 2026
316df63
chore: update dependabot cfg
SMoraisAnsys Aug 4, 2026
9fcd2c7
chore: add dev group and tox changes for uv lockfile
SMoraisAnsys Aug 4, 2026
16dfe7f
Update tox.ini
SMoraisAnsys Aug 5, 2026
ba92e7e
Update tox.ini
SMoraisAnsys Aug 5, 2026
c241a6e
Update tox.ini
SMoraisAnsys Aug 5, 2026
68bff35
Update tox.ini
SMoraisAnsys Aug 5, 2026
c7b3305
Update tox.ini
SMoraisAnsys Aug 5, 2026
f2246d2
Apply suggestions from code review
SMoraisAnsys Aug 5, 2026
35f38eb
Apply suggestion from @moe-ad
SMoraisAnsys Aug 5, 2026
f006f52
Update tests-pytest/action.yml
SMoraisAnsys Aug 6, 2026
fef99c9
refactor: follow up for code review
SMoraisAnsys Aug 6, 2026
88048da
refactor: use --no-dev in export and re export files
SMoraisAnsys Aug 6, 2026
8bb98f6
chore: remove self ref (cleanup)
SMoraisAnsys Aug 6, 2026
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
17 changes: 0 additions & 17 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
version: 2
updates:
- package-ecosystem: "pip"
directories:
- "/requirements"
schedule:
interval: "weekly"
day: "wednesday"
cooldown:
default-days: 7
include:
- "*" # Include all dependencies in cooldown
exclude:
- "ansys-sphinx-theme"
commit-message:
prefix: "build(pip)"
labels:
- "dependencies:requirements"

- package-ecosystem: "uv"
directory: "/"
schedule:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
echo " Processing: $dir_cleaned/requirements.txt (group: $group_name)"

# Run uv export command
uv export --format requirements.txt --group "$group_name" --output-file "$dir_cleaned/requirements.txt" --no-hashes
uv export --format requirements.txt --group "$group_name" --output-file "$dir_cleaned/requirements.txt" --no-hashes --no-dev
done

# Process requirements-<suffix>.txt files (e.g., code-style/requirements-prek.txt)
Expand Down Expand Up @@ -137,9 +137,9 @@ jobs:
> [!WARNING]
> If this dependabot update includes any changes to the `pyproject.toml`, ensure the version specifiers in the `pyproject.toml` are reverted to a valid `major.minor` range by taking the following steps:
> - Clone the branch locally.
> - Update any pinned versions modified by Dependabot in `pyproject.toml` to the appropriate `major.minor` version range. For example, if Dependabot changes `wcwidth<=0.7` to `wcwidth<=0.8.1`, it should be updated to `wcwidth<=0.9`. Likewise, if Dependabot changes `safety>=3.7,<4` to `safety>=3.8.0,<4`, it should be updated to `safety>=3.8,<4`. Do **not** modify any `requirement.txt` files.
> - Update any pinned versions modified by Dependabot in `pyproject.toml` to the appropriate `major.minor` version range. For example, if Dependabot changes `wcwidth<=0.7` to `wcwidth<=0.8.1`, it should be updated to `wcwidth<=0.9`. Likewise, if Dependabot changes `safety>=3.7,<4` to `safety>=3.8.0,<4`, it should be updated to `safety>=3.8,<4`. Do **not** modify any `requirement.txt` files.
> - Run `uv lock` to update the lock file.
> - Commit the changes to this PR and proceed to merge.
> - Commit the changes to this PR and proceed to merge.
EOF
printf '%s\n' "<!-- /ansys-actions:pyproject-note -->"
} > "${NEW_BODY_FILE}"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci_cd_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
steps:
- uses: ansys/actions/doc-build@main
with:
skip-install: true
group-dependencies-name: 'doc'
needs-quarto: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
skip-install: true
use-python-cache: false
needs-quarto: true

doc-deploy-dev:
name: "Deploy development documentation"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci_cd_night.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ jobs:
steps:
- uses: ansys/actions/doc-build@main
with:
skip-install: true
group-dependencies-name: 'doc'
needs-quarto: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
skip-install: true
use-python-cache: false
needs-quarto: true

doc-deploy-dev:
name: "Deploy development documentation"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_cd_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ jobs:
needs-quarto: true
uploaded-artifact-name-prefix: documentation-${{ matrix.os }}
checkout: false
group-dependencies-name: 'doc'

test-doc-build-pyansys-geometry:
name: "Test doc-build action for PyAnsys Geometry on ${{ matrix.os.name }}"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci_cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ jobs:
steps:
- uses: ansys/actions/doc-build@main
with:
skip-install: true
group-dependencies-name: 'doc'
needs-quarto: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
skip-install: true
use-python-cache: false
needs-quarto: true

tests:
name: "Tests"
Expand Down
65 changes: 52 additions & 13 deletions _doc-build-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ name: |
description: |
Build library documentation using `Sphinx
<https://www.sphinx-doc.org/en/master/>`_. The action installs documentation
dependencies provided either in a requirement file, e.g.
``requirements/requirements_doc.txt``, or in the ``[doc]`` section of the
additional dependencies in the ``pyproject.toml`` file. Assuming that
dependencies defined in a requirement file, e.g. ``requirements/requirements_doc.txt``,
in a lockfile, or as extra/group dependencies in the ``pyproject.toml`` file. Assuming that
`sphinx-build
<https://www.sphinx-doc.org/en/master/man/sphinx-build.html>`_ is available
after installing the documentation dependencies, the action uses it
Expand Down Expand Up @@ -296,6 +295,17 @@ runs:
run: |
python -m venv .venv

- name: "Auto-detect uv lockfile"
id: auto-detect-uv-lockfile
if: ${{ inputs.use-uv == 'true' }}
shell: bash
run: |
if [[ -f "uv.lock" ]]; then
echo "USE_UV_LOCKFILE=true" >> ${GITHUB_OUTPUT}
else
echo "USE_UV_LOCKFILE=false" >> ${GITHUB_OUTPUT}
fi

# ------------------------------------------------------------------------

- name: "Update pip"
Expand All @@ -311,15 +321,23 @@ runs:
fi

- name: "Check if requirements.txt file exists"
id: check-requirements-file-exists
id: check-exists-requirements-file
shell: bash
env:
REQUIREMENTS_FILE: ${{ inputs.requirements-file }}
run: |
echo "EXISTS_DOC_REQUIREMENTS=$(if [ -f "${REQUIREMENTS_FILE}" ]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_OUTPUT

- uses: ansys/actions/_logging@main
if: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE == 'true' && steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'true' }}
with:
level: "ERROR"
message: >
A uv.lock file was detected and a requirements file exists. Please, either use the
lock file or the requirements file, but not both.

- name: "Install documentation dependencies from requirements file"
if: steps.check-requirements-file-exists.outputs.EXISTS_DOC_REQUIREMENTS == 'true'
if: steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'true'
shell: bash
env:
REQUIREMENTS_FILE: ${{ inputs.requirements-file }}
Expand All @@ -337,23 +355,29 @@ runs:
if: inputs.skip-install == 'false'
env:
BUILD_BACKEND: ${{ steps.environment-variables.outputs.BUILD_BACKEND }}
USE_UV_LOCKFILE: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE }}
run: |
source .venv/bin/activate
if [[ "${BUILD_BACKEND}" == 'poetry' ]]; then
poetry install
elif [[ "$BUILD_BACKEND" == 'uv' ]]; then
uv pip install .
if [[ "${USE_UV_LOCKFILE}" == 'true' ]]; then
uv sync --frozen --no-dev
else
uv pip install .
fi
else
python -m pip install .
fi

- name: "Install documentation dependencies from pyproject.toml"
shell: bash
if: steps.check-requirements-file-exists.outputs.EXISTS_DOC_REQUIREMENTS == 'false'
if: steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'false'
env:
BUILD_BACKEND: ${{ steps.environment-variables.outputs.BUILD_BACKEND }}
GROUP_DEPENDENCIES_NAME: ${{ inputs.group-dependencies-name }}
OPTIONAL_DEPENDENCIES_NAME: ${{ inputs.optional-dependencies-name }}
USE_UV_LOCKFILE: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE }}
run: |
source .venv/bin/activate
if [[ "${BUILD_BACKEND}" == 'poetry' ]]; then
Expand All @@ -363,12 +387,23 @@ runs:
poetry install --extras "${OPTIONAL_DEPENDENCIES_NAME}"
fi
else
# Optional dependencies
optional_dependencies_flag=""
# Optional dependencies handling
extra_dependencies_flags=""
project_spec="."
if [ -n "${OPTIONAL_DEPENDENCIES_NAME}" ]; then
optional_dependencies_flag="[${OPTIONAL_DEPENDENCIES_NAME}]"
if [[ "${BUILD_BACKEND}" == 'uv' && "${USE_UV_LOCKFILE}" == 'true' ]]; then
IFS=',' read -ra extras_list <<< "${OPTIONAL_DEPENDENCIES_NAME}"
for extra in "${extras_list[@]}"; do
trimmed_extra="$(echo "${extra}" | xargs)"
if [[ -n "${trimmed_extra}" ]]; then
extra_dependencies_flags="$extra_dependencies_flags --extra ${trimmed_extra}"
fi
done
else
project_spec=".[${OPTIONAL_DEPENDENCIES_NAME}]"
fi
fi
# Group dependencies
# Group dependencies handling
group_dependencies_flag=""
if [ -n "${GROUP_DEPENDENCIES_NAME}" ]; then
IFS=',' read -ra group_list <<< "${GROUP_DEPENDENCIES_NAME}"
Expand All @@ -378,9 +413,13 @@ runs:
fi
# Install dependencies (potentially mix of optional and group)
if [[ "${BUILD_BACKEND}" == 'uv' ]]; then
uv pip install $group_dependencies_flag .$optional_dependencies_flag
if [[ "${USE_UV_LOCKFILE}" == 'true' ]]; then
uv sync --frozen --no-dev $group_dependencies_flag $extra_dependencies_flags
else
uv pip install $group_dependencies_flag $project_spec
fi
else
python -m pip install $group_dependencies_flag .$optional_dependencies_flag
python -m pip install $project_spec
fi
fi

Expand Down
77 changes: 57 additions & 20 deletions _doc-build-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ name: |
description: |
Build library documentation using `Sphinx
<https://www.sphinx-doc.org/en/master/>`_. The action installs documentation
dependencies provided either in a requirement file, e.g.
``requirements/requirements_doc.txt``, or in the ``[doc]`` section of the
additional dependencies in the ``pyproject.toml`` file. Assuming that
dependencies defined in a requirement file, e.g. ``requirements/requirements_doc.txt``,
in a lockfile, or as extra/group dependencies in the ``pyproject.toml`` file. Assuming that
`sphinx-build
<https://www.sphinx-doc.org/en/master/man/sphinx-build.html>`_ is available
after installing the documentation dependencies, the action uses it
Expand Down Expand Up @@ -350,6 +349,17 @@ runs:
shell: powershell
run: python -m venv .venv

- name: "Auto-detect uv lockfile"
id: auto-detect-uv-lockfile
if: ${{ inputs.use-uv == 'true' }}
shell: bash
run: |
if [[ -f "uv.lock" ]]; then
echo "USE_UV_LOCKFILE=true" >> ${GITHUB_OUTPUT}
else
echo "USE_UV_LOCKFILE=false" >> ${GITHUB_OUTPUT}
fi

# ------------------------------------------------------------------------

- name: "Update pip"
Expand All @@ -365,19 +375,27 @@ runs:
}

- name: "Check if requirements.txt file exists"
id: check-requirements-file-exists
id: check-exists-requirements-file
shell: powershell
env:
REQUIREMENTS_FILE: ${{ inputs.requirements-file }}
run: |
echo "EXISTS_DOC_REQUIREMENTS=$(if (Test-Path "$env:REQUIREMENTS_FILE") { echo 'true' } else { echo 'false' })" | Out-File -Append -FilePath $env:GITHUB_OUTPUT -Encoding utf8

- uses: ansys/actions/_logging@main
if: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE == 'true' && steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'true' }}
with:
level: "ERROR"
message: >
A uv.lock file was detected and a requirements file exists. Please, either use the
lock file or the requirements file, but not both.

- name: Install documentation dependencies from requirements file
shell: powershell
env:
REQUIREMENTS_FILE: ${{ inputs.requirements-file }}
USE_UV: ${{ inputs.use-uv }}
if: ${{ steps.check-requirements-file-exists.outputs.EXISTS_DOC_REQUIREMENTS == 'true' }}
if: ${{ steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'true' }}
run: |
.venv\Scripts\Activate.ps1
if ($env:USE_UV -eq "true") {
Expand All @@ -391,57 +409,76 @@ runs:
if: ${{ inputs.skip-install == 'false' }}
env:
BUILD_BACKEND: ${{ steps.determine-environment-variables.outputs.BUILD_BACKEND }}
USE_UV_LOCKFILE: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE }}
run: |
.venv\Scripts\Activate.ps1
if ($env:BUILD_BACKEND -eq "poetry") {
poetry install
} elseif ($env:BUILD_BACKEND -eq "uv") {
uv pip install .
if ($env:USE_UV_LOCKFILE -eq "true") {
uv sync --frozen --no-dev
} else {
uv pip install .
}
} else {
python -m pip install .
}

- name: Install documentation dependencies from pyproject.toml
shell: powershell
if: ${{ steps.check-requirements-file-exists.outputs.EXISTS_DOC_REQUIREMENTS == 'false' }}
if: ${{ steps.check-exists-requirements-file.outputs.EXISTS_DOC_REQUIREMENTS == 'false' }}
env:
BUILD_BACKEND: ${{ steps.determine-environment-variables.outputs.BUILD_BACKEND }}
GROUP_DEPENDENCIES_NAME: ${{ inputs.group-dependencies-name }}
OPTIONAL_DEPENDENCIES_NAME: ${{ inputs.optional-dependencies-name }}
USE_UV_LOCKFILE: ${{ steps.auto-detect-uv-lockfile.outputs.USE_UV_LOCKFILE }}
run: |
.venv\Scripts\Activate.ps1
if ($env:BUILD_BACKEND -eq "poetry") {
$arguments = @("install")

if ($env:GROUP_DEPENDENCIES_NAME) {
$arguments += @("--with", "$env:GROUP_DEPENDENCIES_NAME")
$arguments += @("--with", "$env:GROUP_DEPENDENCIES_NAME")
}
if ($env:OPTIONAL_DEPENDENCIES_NAME) {
$arguments += @("--extras", "$env:OPTIONAL_DEPENDENCIES_NAME")
$arguments += @("--extras", "$env:OPTIONAL_DEPENDENCIES_NAME")
}

poetry @arguments
}
else {
# Optional dependencies
$optional_dependencies_flag = ""
# Optional dependencies handling
$extra_dependencies_flags = @()
$project_spec = "."
if ($env:OPTIONAL_DEPENDENCIES_NAME) {
$optional_dependencies_flag = "[{0}]" -f $env:OPTIONAL_DEPENDENCIES_NAME
if ($env:BUILD_BACKEND -eq "uv" -and $env:USE_UV_LOCKFILE -eq "true") {
$extras = $env:OPTIONAL_DEPENDENCIES_NAME -split ','
foreach ($extra in $extras) {
$extra_dependencies_flags += "--extra"
$extra_dependencies_flags += $extra
}
} else {
$project_spec = ".[${env:OPTIONAL_DEPENDENCIES_NAME}]"
}
}
# Group dependencies
# Group dependencies handling
$group_dependencies_flag = @()
if ($env:GROUP_DEPENDENCIES_NAME) {
$groups = $env:GROUP_DEPENDENCIES_NAME -split ','
foreach ($group in $groups) {
$group_dependencies_flag += "--group"
$group_dependencies_flag += $group
}
$groups = $env:GROUP_DEPENDENCIES_NAME -split ','
foreach ($group in $groups) {
$group_dependencies_flag += "--group"
$group_dependencies_flag += $group
}
}
# Install dependencies (potentially mix of optional and group)
if ($env:BUILD_BACKEND -eq "uv") {
uv pip install @group_dependencies_flag ".${optional_dependencies_flag}"
if ($env:USE_UV_LOCKFILE -eq "true") {
uv sync --frozen --no-dev @group_dependencies_flag @extra_dependencies_flags
} else {
uv pip install @group_dependencies_flag $project_spec
}
} else {
python -m pip install @group_dependencies_flag ".${optional_dependencies_flag}"
python -m pip install @group_dependencies_flag $project_spec
}
}

Expand Down
Loading
Loading