Skip to content

Commit 290cd3e

Browse files
committed
ci: use pyproject and ruff
1 parent 414545f commit 290cd3e

26 files changed

+213
-139
lines changed

.github/workflows/test_and_release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,17 @@ jobs:
9393
needs: [pre-commit, pytest]
9494
runs-on: ubuntu-latest
9595
if: github.event_name == 'push'
96+
environment:
97+
name: pypi
98+
url: https://pypi.org/p/trame
99+
permissions:
100+
id-token: write # IMPORTANT: mandatory for trusted publishing
101+
contents: write # IMPORTANT: mandatory for making GitHub Releases
102+
96103

97104
steps:
98105
- name: Checkout
99-
uses: actions/checkout@v2
106+
uses: actions/checkout@v4
100107
with:
101108
fetch-depth: 0
102109

@@ -105,8 +112,11 @@ jobs:
105112
bash .fetch_externals.sh
106113
107114
- name: Python Semantic Release
108-
uses: relekang/python-semantic-release@v7.34.6
115+
id: release
116+
uses: relekang/python-semantic-release@v9.15.2
109117
with:
110118
github_token: ${{ secrets.GITHUB_TOKEN }}
111-
repository_username: __token__
112-
repository_password: ${{ secrets.PYPI_API_TOKEN }}
119+
120+
- name: Publish package distributions to PyPI
121+
if: steps.release.outputs.released == 'true'
122+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 22.3.0
4-
hooks:
5-
- id: black
6-
entry: black --check
7-
82
- repo: https://github.com/codespell-project/codespell
93
rev: v2.1.0
104
hooks:
115
- id: codespell
12-
args: ['--ignore-words=.ignore-words.txt']
136

14-
- repo: https://github.com/PyCQA/flake8
15-
rev: 4.0.1
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.8.4
169
hooks:
17-
- id: flake8
10+
- id: ruff
11+
- id: ruff-format

examples/pyvista/ambient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from trame.app import get_server
44
from trame.ui.vuetify import SinglePageLayout
5-
from trame.widgets import html, vuetify
5+
from trame.widgets import vuetify
66
from trame.widgets.vtk import VtkLocalView, VtkRemoteView
77

88
import pyvista as pv

examples/pyvista/export_scene.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Export scene for offline rendering.
22
https://kitware.github.io/vtk-js/examples/OfflineLocalView.html
33
"""
4+
45
from trame.app import get_server
56
from trame.ui.vuetify import SinglePageLayout
67
from trame.widgets import vuetify

examples/pyvista/grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from trame.app import get_server
22
from trame.ui.vuetify import SinglePageLayout
3-
from trame.widgets import grid, vuetify
3+
from trame.widgets import grid
44

55
server = get_server()
66
state = server.state

examples/pyvista/lighting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from trame.app import get_server
44
from trame.ui.vuetify import SinglePageLayout
5-
from trame.widgets import html, vuetify
5+
from trame.widgets import vuetify
66
from trame.widgets.vtk import VtkLocalView, VtkRemoteView
77

88
import pyvista as pv

examples/pyvista/picking.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21
from trame.app import get_server
32
from trame.ui.vuetify import SinglePageLayout
43
from trame.widgets import vuetify
@@ -43,8 +42,7 @@ def toggle_edges():
4342

4443

4544
@ctrl.set("on_selection_change")
46-
def on_box_selection(event):
47-
...
45+
def on_box_selection(event): ...
4846

4947

5048
@state.change("selection_mode")

examples/pyvista/scalar_range.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from trame.widgets import vuetify
55

66
import pyvista as pv
7-
from pyvista import examples
87
from pyvista.trame.ui import plotter_ui
98

109
# -----------------------------------------------------------------------------

examples/pyvista/toggle_edge_lighting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Validate Int64 usage with VTK.js."""
22

3-
import numpy as np
43
from trame.app import get_server
54
from trame.ui.vuetify import SinglePageLayout
65
from trame.widgets import vuetify

examples/pyvista/toggle_edges_many_actors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# for remote view
22
from trame.app import get_server
33
from trame.ui.vuetify import SinglePageLayout
4-
from trame.widgets import html, vtk as vtk_widgets, vuetify
4+
from trame.widgets import vtk as vtk_widgets, vuetify
55
from vtkmodules.vtkFiltersSources import vtkConeSource
66
from vtkmodules.vtkInteractionStyle import vtkInteractorStyleSwitch # noqa
77
from vtkmodules.vtkRenderingCore import (

0 commit comments

Comments
 (0)