pyvista-build 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyvista_build-0.1.0/.github/dependabot.yml +15 -0
- pyvista_build-0.1.0/.github/exclude_typing_lines.py +72 -0
- pyvista_build-0.1.0/.github/release.yml +9 -0
- pyvista_build-0.1.0/.github/workflows/build-vtk.yml +131 -0
- pyvista_build-0.1.0/.github/workflows/ci.yml +182 -0
- pyvista_build-0.1.0/.gitignore +16 -0
- pyvista_build-0.1.0/.pre-commit-config.yaml +45 -0
- pyvista_build-0.1.0/LICENSE +21 -0
- pyvista_build-0.1.0/PKG-INFO +76 -0
- pyvista_build-0.1.0/README.md +39 -0
- pyvista_build-0.1.0/codecov.yml +26 -0
- pyvista_build-0.1.0/doc/Makefile +14 -0
- pyvista_build-0.1.0/doc/_static/.gitkeep +0 -0
- pyvista_build-0.1.0/doc/building.rst +427 -0
- pyvista_build-0.1.0/doc/cli.rst +92 -0
- pyvista_build-0.1.0/doc/conf.py +68 -0
- pyvista_build-0.1.0/doc/index.rst +27 -0
- pyvista_build-0.1.0/doc/manifest.rst +278 -0
- pyvista_build-0.1.0/pyproject.toml +146 -0
- pyvista_build-0.1.0/pyvista_build/__init__.py +12 -0
- pyvista_build-0.1.0/pyvista_build/__main__.py +46 -0
- pyvista_build-0.1.0/pyvista_build/_version.py +24 -0
- pyvista_build-0.1.0/pyvista_build/cli.py +308 -0
- pyvista_build-0.1.0/pyvista_build/manifest.py +660 -0
- pyvista_build-0.1.0/pyvista_build/manifests/vtk.toml +76 -0
- pyvista_build-0.1.0/pyvista_build/manylinux.py +258 -0
- pyvista_build-0.1.0/pyvista_build/phases.py +2341 -0
- pyvista_build-0.1.0/pyvista_build/py.typed +0 -0
- pyvista_build-0.1.0/pyvista_build/registry.py +79 -0
- pyvista_build-0.1.0/pyvista_build/tools.py +619 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/PKG-INFO +76 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/SOURCES.txt +44 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/dependency_links.txt +1 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/entry_points.txt +2 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/requires.txt +19 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/scm_file_list.json +39 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/scm_version.json +8 -0
- pyvista_build-0.1.0/pyvista_build.egg-info/top_level.txt +1 -0
- pyvista_build-0.1.0/setup.cfg +4 -0
- pyvista_build-0.1.0/tests/__init__.py +1 -0
- pyvista_build-0.1.0/tests/conftest.py +20 -0
- pyvista_build-0.1.0/tests/test_build.py +2340 -0
- pyvista_build-0.1.0/tests/test_build_manifest.py +349 -0
- pyvista_build-0.1.0/tests/test_build_tools.py +263 -0
- pyvista_build-0.1.0/tests/test_cli_build.py +794 -0
- pyvista_build-0.1.0/tests/test_version.py +9 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
multi-ecosystem-groups:
|
|
3
|
+
maintenance:
|
|
4
|
+
schedule:
|
|
5
|
+
interval: quarterly
|
|
6
|
+
labels: [maintenance, dependencies]
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: pip
|
|
9
|
+
directory: /
|
|
10
|
+
patterns: ['*']
|
|
11
|
+
multi-ecosystem-group: maintenance
|
|
12
|
+
- package-ecosystem: github-actions
|
|
13
|
+
directory: /
|
|
14
|
+
patterns: ['*']
|
|
15
|
+
multi-ecosystem-group: maintenance
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Drop the lines coverage excludes from mypy's Cobertura typing report."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import re
|
|
7
|
+
import sys
|
|
8
|
+
import tomllib
|
|
9
|
+
import xml.etree.ElementTree as ET
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _code(line: str) -> str:
|
|
13
|
+
"""Return ``line`` without its trailing comment and whitespace."""
|
|
14
|
+
return line.split('#', 1)[0].rstrip()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def excluded_lines(source: str, patterns: list[re.Pattern[str]]) -> set[int]:
|
|
18
|
+
"""Return the lines the patterns match, extended to whole statements and their blocks."""
|
|
19
|
+
lines = source.split('\n')
|
|
20
|
+
excluded: set[int] = set()
|
|
21
|
+
for pattern in patterns:
|
|
22
|
+
for match in pattern.finditer(source):
|
|
23
|
+
first = source.count('\n', 0, match.start()) + 1
|
|
24
|
+
if not lines[first - 1].strip():
|
|
25
|
+
first += 1
|
|
26
|
+
last = source.count('\n', 0, match.end()) + 1
|
|
27
|
+
depth = sum(
|
|
28
|
+
_code(line).count('(') - _code(line).count(')') for line in lines[first - 1 : last]
|
|
29
|
+
)
|
|
30
|
+
while depth > 0 and last < len(lines):
|
|
31
|
+
last += 1
|
|
32
|
+
depth += _code(lines[last - 1]).count('(') - _code(lines[last - 1]).count(')')
|
|
33
|
+
excluded.update(range(first, last + 1))
|
|
34
|
+
opener = lines[first - 1]
|
|
35
|
+
if _code(lines[last - 1]).endswith(':'):
|
|
36
|
+
indent = len(opener) - len(opener.lstrip())
|
|
37
|
+
for number in range(last + 1, len(lines) + 1):
|
|
38
|
+
line = lines[number - 1]
|
|
39
|
+
if line.strip() and len(line) - len(line.lstrip()) <= indent:
|
|
40
|
+
break
|
|
41
|
+
excluded.add(number)
|
|
42
|
+
return excluded
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def main(report: Path) -> None:
|
|
46
|
+
"""Rewrite ``report`` without the lines ``[tool.coverage.report]`` excludes."""
|
|
47
|
+
config = tomllib.loads(Path('pyproject.toml').read_text())
|
|
48
|
+
patterns = [
|
|
49
|
+
re.compile(p, re.MULTILINE) for p in config['tool']['coverage']['report']['exclude_also']
|
|
50
|
+
]
|
|
51
|
+
tree = ET.parse(report)
|
|
52
|
+
for cls in tree.iter('class'):
|
|
53
|
+
lines = cls.find('lines')
|
|
54
|
+
filename = cls.get('filename')
|
|
55
|
+
# A data directory inside the package shows up as a namespace package.
|
|
56
|
+
if lines is None or not filename or not Path(filename).is_file():
|
|
57
|
+
continue
|
|
58
|
+
excluded = excluded_lines(Path(filename).read_text(), patterns)
|
|
59
|
+
for line in list(lines):
|
|
60
|
+
if int(line.get('number', '0')) in excluded:
|
|
61
|
+
lines.remove(line)
|
|
62
|
+
total = sum(1 for _ in tree.iter('line'))
|
|
63
|
+
hit = sum(1 for line in tree.iter('line') if int(line.get('hits', '0')) > 0)
|
|
64
|
+
root = tree.getroot()
|
|
65
|
+
root.set('lines-valid', str(total))
|
|
66
|
+
root.set('lines-covered', str(hit))
|
|
67
|
+
root.set('line-rate', f'{hit / total:.4f}' if total else '1')
|
|
68
|
+
tree.write(report)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == '__main__':
|
|
72
|
+
main(Path(sys.argv[1]))
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
name: Build VTK
|
|
2
|
+
|
|
3
|
+
# Builds the shipped manifest's VTK release on all three operating systems with the
|
|
4
|
+
# command this package ships, then installs the wheel and imports it.
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
pull_request:
|
|
8
|
+
# labeled and unlabeled, so adding skip-build takes effect without a push.
|
|
9
|
+
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
10
|
+
# A pull request that only touches these never starts a build.
|
|
11
|
+
paths-ignore:
|
|
12
|
+
- '**.md'
|
|
13
|
+
- '**.rst'
|
|
14
|
+
- doc/**
|
|
15
|
+
- codecov.yml
|
|
16
|
+
- .pre-commit-config.yaml
|
|
17
|
+
- .github/dependabot.yml
|
|
18
|
+
- .github/release.yml
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
22
|
+
cancel-in-progress: true
|
|
23
|
+
|
|
24
|
+
permissions:
|
|
25
|
+
actions: read
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build:
|
|
30
|
+
# The skip-build label turns the build off for a pull request by hand.
|
|
31
|
+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-build') }}
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
36
|
+
runs-on: ${{ matrix.os }}
|
|
37
|
+
env:
|
|
38
|
+
CCACHE_MAXSIZE: 1G
|
|
39
|
+
SCCACHE_CACHE_SIZE: 1G
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
42
|
+
with:
|
|
43
|
+
persist-credentials: false
|
|
44
|
+
fetch-depth: 0
|
|
45
|
+
|
|
46
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
47
|
+
with:
|
|
48
|
+
python-version: '3.14'
|
|
49
|
+
|
|
50
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
51
|
+
|
|
52
|
+
- name: Install macOS build dependencies
|
|
53
|
+
if: runner.os == 'macOS'
|
|
54
|
+
run: brew install ccache
|
|
55
|
+
|
|
56
|
+
- name: Install pyvista-build
|
|
57
|
+
shell: bash
|
|
58
|
+
# `--manylinux` mounts this installed package into the container.
|
|
59
|
+
run: uv pip install --system '.[tools]'
|
|
60
|
+
|
|
61
|
+
# An artifact, not actions/cache: the repository's shared cache quota evicts a
|
|
62
|
+
# large entry before the next run can restore it.
|
|
63
|
+
- name: Find the newest compiler cache from this branch or main
|
|
64
|
+
id: find-compiler-cache
|
|
65
|
+
shell: bash
|
|
66
|
+
env:
|
|
67
|
+
GH_TOKEN: ${{ github.token }}
|
|
68
|
+
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
69
|
+
run: |
|
|
70
|
+
# Newest first: this branch's own upload, else main's, from this repository only.
|
|
71
|
+
if ! run_id="$(gh api "repos/${GITHUB_REPOSITORY}/actions/artifacts?name=compiler-cache-${RUNNER_OS}&per_page=50" \
|
|
72
|
+
--jq '[.artifacts[] | select((.expired | not) and .workflow_run.head_repository_id == .workflow_run.repository_id)] as $a
|
|
73
|
+
| ([$a[] | select(.workflow_run.head_branch == env.BRANCH)] + [$a[] | select(.workflow_run.head_branch == "main")])[0].workflow_run.id // empty')"; then
|
|
74
|
+
echo "::warning::Could not list the compiler cache artifacts; building cold"
|
|
75
|
+
run_id=""
|
|
76
|
+
fi
|
|
77
|
+
if [ -n "$run_id" ]; then
|
|
78
|
+
echo "Restoring the compiler cache uploaded by run $run_id"
|
|
79
|
+
else
|
|
80
|
+
echo "No compiler cache artifact found; building cold"
|
|
81
|
+
fi
|
|
82
|
+
echo "run-id=$run_id" >> "$GITHUB_OUTPUT"
|
|
83
|
+
|
|
84
|
+
- name: Restore compiler cache
|
|
85
|
+
if: steps.find-compiler-cache.outputs.run-id != ''
|
|
86
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
87
|
+
continue-on-error: true
|
|
88
|
+
with:
|
|
89
|
+
name: compiler-cache-${{ runner.os }}
|
|
90
|
+
run-id: ${{ steps.find-compiler-cache.outputs.run-id }}
|
|
91
|
+
github-token: ${{ github.token }}
|
|
92
|
+
path: compiler-cache
|
|
93
|
+
|
|
94
|
+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
|
95
|
+
if: runner.os == 'Windows'
|
|
96
|
+
|
|
97
|
+
- name: Set up sccache (Windows)
|
|
98
|
+
if: runner.os == 'Windows'
|
|
99
|
+
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.9
|
|
100
|
+
|
|
101
|
+
- name: Build the VTK wheel
|
|
102
|
+
shell: bash
|
|
103
|
+
# --manylinux (Linux) builds inside the manylinux_2_28 container.
|
|
104
|
+
env:
|
|
105
|
+
MANYLINUX: ${{ runner.os == 'Linux' && '--manylinux' || '' }}
|
|
106
|
+
FORCE_COLOR: '1'
|
|
107
|
+
run: |
|
|
108
|
+
pyvista-build vtk $MANYLINUX --yes --verbose \
|
|
109
|
+
--build-dir vtk-build --compiler-cache auto --cache-dir compiler-cache
|
|
110
|
+
|
|
111
|
+
# Fork pull requests read the cache but never upload one.
|
|
112
|
+
- name: Upload compiler cache
|
|
113
|
+
if: ${{ !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
|
|
114
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
115
|
+
with:
|
|
116
|
+
name: compiler-cache-${{ runner.os }}
|
|
117
|
+
path: compiler-cache
|
|
118
|
+
compression-level: 0
|
|
119
|
+
retention-days: 7
|
|
120
|
+
|
|
121
|
+
- name: Upload the wheel
|
|
122
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
123
|
+
with:
|
|
124
|
+
name: vtk-wheel-${{ runner.os }}
|
|
125
|
+
path: vtk-build/wheelhouse/*.whl
|
|
126
|
+
|
|
127
|
+
- name: Install the wheel and import it
|
|
128
|
+
shell: bash
|
|
129
|
+
run: |
|
|
130
|
+
uv pip install --system vtk-build/wheelhouse/*.whl
|
|
131
|
+
python -c "import vtk; print(vtk.vtkVersion.GetVTKVersion())"
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
# `pull_request` is deliberately unfiltered: filtering it by base branch would
|
|
4
|
+
# skip every pull request in a stack that does not target main.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
tags: [v*]
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
pre-commit:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
23
|
+
with:
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: false
|
|
29
|
+
- run: uv sync --group dev
|
|
30
|
+
- run: uv run pre-commit run --all-files --show-diff-on-failure
|
|
31
|
+
env:
|
|
32
|
+
# This hook exists to stop *local* commits straight to main; it
|
|
33
|
+
# would always fail here since CI checks out that branch/tag directly.
|
|
34
|
+
SKIP: no-commit-to-branch
|
|
35
|
+
|
|
36
|
+
test:
|
|
37
|
+
runs-on: ${{ matrix.os }}
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
os: [ubuntu-latest]
|
|
42
|
+
python-version: ['3.11', '3.12', '3.13', '3.14']
|
|
43
|
+
include:
|
|
44
|
+
- os: macos-latest
|
|
45
|
+
python-version: '3.14'
|
|
46
|
+
- os: windows-latest
|
|
47
|
+
python-version: '3.14'
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
50
|
+
with:
|
|
51
|
+
persist-credentials: false
|
|
52
|
+
fetch-depth: 0
|
|
53
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
54
|
+
with:
|
|
55
|
+
enable-cache: false
|
|
56
|
+
- run: uv sync --group dev --python ${{ matrix.python-version }}
|
|
57
|
+
- run: uv run pytest
|
|
58
|
+
- run: mv .coverage .coverage.test-${{ matrix.os }}-${{ matrix.python-version }}
|
|
59
|
+
shell: bash
|
|
60
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
61
|
+
with:
|
|
62
|
+
name: coverage-test-${{ matrix.os }}-${{ matrix.python-version }}
|
|
63
|
+
path: .coverage.test-${{ matrix.os }}-${{ matrix.python-version }}
|
|
64
|
+
include-hidden-files: true
|
|
65
|
+
|
|
66
|
+
coverage:
|
|
67
|
+
# Combine the matrix's coverage and gate the total and the patch.
|
|
68
|
+
needs: test
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
72
|
+
with:
|
|
73
|
+
persist-credentials: false
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
76
|
+
with:
|
|
77
|
+
enable-cache: false
|
|
78
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
79
|
+
with:
|
|
80
|
+
pattern: coverage-*
|
|
81
|
+
path: coverage-data
|
|
82
|
+
merge-multiple: true
|
|
83
|
+
- run: uv run --only-group coverage coverage combine coverage-data
|
|
84
|
+
- run: uv run --only-group coverage coverage xml
|
|
85
|
+
- run: uv run --only-group coverage coverage report --fail-under=95
|
|
86
|
+
- name: Patch coverage
|
|
87
|
+
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
|
|
88
|
+
run: uv run --only-group coverage diff-cover coverage.xml --compare-branch "origin/$GITHUB_BASE_REF" --fail-under 95 --format markdown:diff-cover.md
|
|
89
|
+
- if: ${{ !cancelled() && github.event_name == 'pull_request' }}
|
|
90
|
+
run: cat diff-cover.md >> "$GITHUB_STEP_SUMMARY" || true
|
|
91
|
+
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
92
|
+
if: ${{ !cancelled() }}
|
|
93
|
+
with:
|
|
94
|
+
files: ./coverage.xml
|
|
95
|
+
flags: tests
|
|
96
|
+
env:
|
|
97
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
98
|
+
|
|
99
|
+
typing:
|
|
100
|
+
# mypy's Cobertura report counts a line as covered when every expression on
|
|
101
|
+
# it has a precise type, so codecov shows typing coverage next to test coverage.
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
steps:
|
|
104
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
105
|
+
with:
|
|
106
|
+
persist-credentials: false
|
|
107
|
+
fetch-depth: 0
|
|
108
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
109
|
+
with:
|
|
110
|
+
enable-cache: false
|
|
111
|
+
- run: uv sync --group dev --python 3.14
|
|
112
|
+
- run: uv run --no-sync mypy --cobertura-xml-report typing-coverage --txt-report typing-coverage
|
|
113
|
+
- run: cat typing-coverage/index.txt
|
|
114
|
+
- run: uv run --no-sync python .github/exclude_typing_lines.py typing-coverage/cobertura.xml
|
|
115
|
+
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
116
|
+
with:
|
|
117
|
+
files: ./typing-coverage/cobertura.xml
|
|
118
|
+
flags: typing
|
|
119
|
+
env:
|
|
120
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
121
|
+
|
|
122
|
+
docs:
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
126
|
+
with:
|
|
127
|
+
persist-credentials: false
|
|
128
|
+
fetch-depth: 0
|
|
129
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
130
|
+
with:
|
|
131
|
+
enable-cache: false
|
|
132
|
+
- run: uv sync --group docs --python 3.14
|
|
133
|
+
- run: uv run --no-sync sphinx-build -W --keep-going -b html doc doc/_build/html
|
|
134
|
+
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
135
|
+
with:
|
|
136
|
+
path: doc/_build/html/
|
|
137
|
+
|
|
138
|
+
deploy-docs:
|
|
139
|
+
# Publishes directly from the workflow artifact; no gh-pages branch.
|
|
140
|
+
needs: docs
|
|
141
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
142
|
+
runs-on: ubuntu-latest
|
|
143
|
+
environment:
|
|
144
|
+
name: github-pages
|
|
145
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
146
|
+
permissions:
|
|
147
|
+
pages: write
|
|
148
|
+
id-token: write
|
|
149
|
+
steps:
|
|
150
|
+
- uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
|
151
|
+
id: deployment
|
|
152
|
+
|
|
153
|
+
dist:
|
|
154
|
+
needs: [pre-commit, test, coverage, typing, docs]
|
|
155
|
+
runs-on: ubuntu-latest
|
|
156
|
+
steps:
|
|
157
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
158
|
+
with:
|
|
159
|
+
persist-credentials: false
|
|
160
|
+
fetch-depth: 0
|
|
161
|
+
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
|
|
162
|
+
with:
|
|
163
|
+
enable-cache: false
|
|
164
|
+
- run: uv build
|
|
165
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
166
|
+
with:
|
|
167
|
+
name: dist
|
|
168
|
+
path: dist/
|
|
169
|
+
|
|
170
|
+
publish:
|
|
171
|
+
needs: dist
|
|
172
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
173
|
+
runs-on: ubuntu-latest
|
|
174
|
+
environment: release
|
|
175
|
+
permissions:
|
|
176
|
+
id-token: write
|
|
177
|
+
steps:
|
|
178
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
179
|
+
with:
|
|
180
|
+
name: dist
|
|
181
|
+
path: dist/
|
|
182
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autoupdate_commit_msg: 'chore: update pre-commit hooks'
|
|
3
|
+
autofix_prs: true
|
|
4
|
+
autoupdate_schedule: quarterly
|
|
5
|
+
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v5.0.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: check-merge-conflict
|
|
11
|
+
- id: debug-statements
|
|
12
|
+
- id: no-commit-to-branch
|
|
13
|
+
args: [--branch, main]
|
|
14
|
+
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.16.0
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff-check
|
|
19
|
+
args: [--fix, --show-fixes]
|
|
20
|
+
- id: ruff-format
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
|
|
23
|
+
rev: v1.11.0
|
|
24
|
+
hooks:
|
|
25
|
+
- id: zizmor
|
|
26
|
+
|
|
27
|
+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
|
28
|
+
rev: v2.15.0
|
|
29
|
+
hooks:
|
|
30
|
+
- id: pretty-format-yaml
|
|
31
|
+
args: [--autofix, --indent, '2']
|
|
32
|
+
|
|
33
|
+
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
|
34
|
+
rev: v1.0.2
|
|
35
|
+
hooks:
|
|
36
|
+
- id: sphinx-lint
|
|
37
|
+
# Same line length as the Python sources.
|
|
38
|
+
args: [--enable, line-too-long, --max-line-length, '99']
|
|
39
|
+
|
|
40
|
+
- repo: https://github.com/ComPWA/taplo-pre-commit
|
|
41
|
+
rev: v0.9.3
|
|
42
|
+
hooks:
|
|
43
|
+
- id: taplo-format
|
|
44
|
+
# See options: https://taplo.tamasfe.dev/configuration/formatter-options.html
|
|
45
|
+
args: [--option, reorder_arrays=true, --option, reorder_keys=true, --option, align_comments=false]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2026 The PyVista Developers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyvista-build
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Build a VTK backend wheel for PyVista from source, guided step by step.
|
|
5
|
+
Author-email: The PyVista Developers <info@pyvista.org>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/pyvista/pyvista-build
|
|
8
|
+
Keywords: cmake,pyvista,vtk,wheel
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: cyclopts>=4.0.0
|
|
25
|
+
Requires-Dist: packaging
|
|
26
|
+
Requires-Dist: rich
|
|
27
|
+
Provides-Extra: tools
|
|
28
|
+
Requires-Dist: auditwheel; sys_platform == "linux" and extra == "tools"
|
|
29
|
+
Requires-Dist: cmake>=3.22; extra == "tools"
|
|
30
|
+
Requires-Dist: delocate; sys_platform == "darwin" and extra == "tools"
|
|
31
|
+
Requires-Dist: delvewheel; sys_platform == "win32" and extra == "tools"
|
|
32
|
+
Requires-Dist: ninja>=1.11; extra == "tools"
|
|
33
|
+
Requires-Dist: patchelf; sys_platform == "linux" and extra == "tools"
|
|
34
|
+
Requires-Dist: setuptools; extra == "tools"
|
|
35
|
+
Requires-Dist: wheel; extra == "tools"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# pyvista-build
|
|
39
|
+
|
|
40
|
+
Build a VTK backend wheel for [PyVista](https://github.com/pyvista/pyvista) from source,
|
|
41
|
+
guided step by step.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv venv
|
|
45
|
+
uvx pyvista-build vtk --install
|
|
46
|
+
uv pip install pyvista
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`pyvista-build BACKEND` clones the backend, checks the tools it needs and offers to
|
|
50
|
+
install the missing ones, configures it with CMake, compiles it, packages the wheel,
|
|
51
|
+
bundles the libraries it links against, and installs it into the active virtual
|
|
52
|
+
environment, else `.venv` in the current directory, else the Python running the command
|
|
53
|
+
(`--python PATH` picks another one). It asks once before starting and prints every
|
|
54
|
+
command as it runs.
|
|
55
|
+
`--interactive` asks before each step, `--dry-run` prints the commands and runs nothing,
|
|
56
|
+
and `--manylinux` runs the build inside a manylinux container for a portable Linux wheel.
|
|
57
|
+
|
|
58
|
+
Each backend describes its build in a `pyvista-build.toml` manifest at the root of its
|
|
59
|
+
source tree. A manifest for stock VTK is shipped here, and `pyvista-build cvista` reads
|
|
60
|
+
the one in the [cvista](https://github.com/pyvista/cvista) tree. Any other backend builds
|
|
61
|
+
with `--url <git url>` or `--source <checkout>` when its tree carries a manifest. The
|
|
62
|
+
[manifest reference](https://pyvista.github.io/pyvista-build/manifest.html) lists every
|
|
63
|
+
key.
|
|
64
|
+
|
|
65
|
+
The package depends on neither `vtk` nor `pyvista`, so it runs in an environment that
|
|
66
|
+
has no VTK yet.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv sync --group dev
|
|
72
|
+
uv run pytest
|
|
73
|
+
uv run mypy
|
|
74
|
+
uv run pre-commit run --all-files
|
|
75
|
+
uv run --group docs sphinx-build -W doc doc/_build/html
|
|
76
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# pyvista-build
|
|
2
|
+
|
|
3
|
+
Build a VTK backend wheel for [PyVista](https://github.com/pyvista/pyvista) from source,
|
|
4
|
+
guided step by step.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
uv venv
|
|
8
|
+
uvx pyvista-build vtk --install
|
|
9
|
+
uv pip install pyvista
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`pyvista-build BACKEND` clones the backend, checks the tools it needs and offers to
|
|
13
|
+
install the missing ones, configures it with CMake, compiles it, packages the wheel,
|
|
14
|
+
bundles the libraries it links against, and installs it into the active virtual
|
|
15
|
+
environment, else `.venv` in the current directory, else the Python running the command
|
|
16
|
+
(`--python PATH` picks another one). It asks once before starting and prints every
|
|
17
|
+
command as it runs.
|
|
18
|
+
`--interactive` asks before each step, `--dry-run` prints the commands and runs nothing,
|
|
19
|
+
and `--manylinux` runs the build inside a manylinux container for a portable Linux wheel.
|
|
20
|
+
|
|
21
|
+
Each backend describes its build in a `pyvista-build.toml` manifest at the root of its
|
|
22
|
+
source tree. A manifest for stock VTK is shipped here, and `pyvista-build cvista` reads
|
|
23
|
+
the one in the [cvista](https://github.com/pyvista/cvista) tree. Any other backend builds
|
|
24
|
+
with `--url <git url>` or `--source <checkout>` when its tree carries a manifest. The
|
|
25
|
+
[manifest reference](https://pyvista.github.io/pyvista-build/manifest.html) lists every
|
|
26
|
+
key.
|
|
27
|
+
|
|
28
|
+
The package depends on neither `vtk` nor `pyvista`, so it runs in an environment that
|
|
29
|
+
has no VTK yet.
|
|
30
|
+
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv sync --group dev
|
|
35
|
+
uv run pytest
|
|
36
|
+
uv run mypy
|
|
37
|
+
uv run pre-commit run --all-files
|
|
38
|
+
uv run --group docs sphinx-build -W doc doc/_build/html
|
|
39
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Test coverage and typing coverage are uploaded under separate flags so
|
|
2
|
+
# neither number hides the other.
|
|
3
|
+
flags:
|
|
4
|
+
tests:
|
|
5
|
+
paths: [pyvista_build/]
|
|
6
|
+
carryforward: true
|
|
7
|
+
typing:
|
|
8
|
+
paths: [pyvista_build/]
|
|
9
|
+
carryforward: true
|
|
10
|
+
|
|
11
|
+
coverage:
|
|
12
|
+
status:
|
|
13
|
+
project:
|
|
14
|
+
tests:
|
|
15
|
+
flags: [tests]
|
|
16
|
+
target: 95%
|
|
17
|
+
typing:
|
|
18
|
+
flags: [typing]
|
|
19
|
+
target: 97.5%
|
|
20
|
+
patch:
|
|
21
|
+
tests:
|
|
22
|
+
flags: [tests]
|
|
23
|
+
target: 95%
|
|
24
|
+
typing:
|
|
25
|
+
flags: [typing]
|
|
26
|
+
target: 98.5%
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
|
|
3
|
+
SPHINXOPTS ?= -W --keep-going
|
|
4
|
+
SPHINXBUILD ?= sphinx-build
|
|
5
|
+
SOURCEDIR = .
|
|
6
|
+
BUILDDIR = _build
|
|
7
|
+
|
|
8
|
+
help:
|
|
9
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
10
|
+
|
|
11
|
+
.PHONY: help Makefile
|
|
12
|
+
|
|
13
|
+
%: Makefile
|
|
14
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
File without changes
|