Skip to content

Commit 7898d1e

Browse files
BilchreisPeter Braun
andauthored
Connect interface (#44)
* migrate to new connect paradigm, omit all comlex runengine handling * migrate to uv,pre-commit rework * cicd update * cicd fix test path * cicd add untracked config files * proper prefix handling --------- Co-authored-by: Peter Braun <[email protected]>
1 parent b324464 commit 7898d1e

27 files changed

+3567
-468
lines changed

.flake8

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[flake8]
2+
ignore = E203, W503, W505, F722, F811
3+
exclude =
4+
.git,
5+
__pycache__,
6+
.pytest_cache,
7+
build,
8+
dist,
9+
info,
10+
logs,
11+
pid,
12+
.vscode,
13+
.venv,
14+
.secop-ophyd,
15+
cfg/*,
16+
docs,
17+
max-line-length = 88

.github/workflows/code.yaml

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,14 @@ env:
1313

1414
jobs:
1515

16-
lint:
17-
name: Lint Codebase
16+
pre-commit:
17+
name: Static Code Checks
1818
# pull requests are a duplicate of a branch push if within the same repo.
1919
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
2020
runs-on: ubuntu-latest
21-
2221
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v4
25-
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
python -m pip install .[dev]
30-
31-
- name: Lint
32-
run: |
33-
tox -e pre-commit,mypy
34-
35-
22+
- uses: actions/checkout@v4
23+
- uses: pre-commit/[email protected]
3624

3725

3826
test:
@@ -47,28 +35,26 @@ jobs:
4735

4836
steps:
4937
- uses: actions/checkout@v4
50-
- name: Set up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v4
38+
39+
- name: Install uv and set the python version
40+
uses: astral-sh/setup-uv@v6
5241
with:
5342
python-version: ${{ matrix.python-version }}
54-
55-
43+
44+
5645

5746
- name: Install dependencies
58-
run: |
59-
python -m pip install --upgrade pip
60-
python -m pip install .[dev]
61-
47+
run: uv sync --all-extras
48+
6249
- name: Add PATH envirnoment variable for xprocess
6350
run: |
64-
pip freeze
6551
echo "PATH_VAR=$PATH" >> "$GITHUB_ENV"
66-
67-
- name: Run Tests
52+
53+
- name: Run Tests
6854
run: |
69-
tox -e pytest
70-
71-
55+
uv run pytest tests/ -v
56+
57+
7258
build:
7359
name: Build distribution 📦
7460
runs-on: ubuntu-latest
@@ -97,7 +83,7 @@ jobs:
9783
name: >-
9884
Publish to PyPI
9985
if: ${{startsWith(github.ref, 'refs/tags/')}} # only publish to PyPI on tag pushes
100-
needs: [lint,test,build]
86+
needs: [pre-commit,test,build]
10187
runs-on: ubuntu-latest
10288
environment:
10389
name: pypi
@@ -113,14 +99,3 @@ jobs:
11399
path: dist/
114100
- name: Publish distribution 📦 to PyPI
115101
uses: pypa/gh-action-pypi-publish@release/v1
116-
117-
118-
119-
120-
121-
122-
123-
124-
125-
126-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ dist
88
**/_version.py
99
pid
1010
logs
11-
.secop-ophyd
11+
.secop-ophyd

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile=black
3+
line_length = 88

.mypy.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[mypy]
2+
# Ignore missing stubs in imported modules
3+
ignore_missing_imports = true
4+
#plugins = ["numpy.typing.mypy_plugin"]
5+
check_untyped_defs = true
6+
exclude = [
7+
'^cfg'
8+
]

.pre-commit-config.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
repos:
2+
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
4+
rev: v6.0.0
45
hooks:
5-
- id: check-added-large-files
6-
- id: check-yaml
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-ast
9+
- id: check-case-conflict
710
- id: check-merge-conflict
8-
9-
- repo: local
10-
hooks:
11-
- id: black
12-
name: Run black
13-
stages: [pre-commit]
14-
language: system
15-
entry: black --check --diff src tests
16-
types: [python]
17-
exclude: |
18-
(?x)^(
19-
cfg/|
20-
frappy_modules/|
21-
logs/|
22-
pid/
23-
)
11+
- id: check-yaml
12+
- id: debug-statements
2413

2514
- repo: https://github.com/pycqa/flake8
26-
rev: '7.2.0' # You can use a more recent version if available
15+
rev: 6.1.0
2716
hooks:
2817
- id: flake8
29-
additional_dependencies: [flake8-pyproject]
30-
args: [src, tests, docs]
31-
exclude: |
32-
(?x)^(
33-
cfg/|
34-
frappy_modules/|
35-
logs/|
36-
pid/
37-
)
3818

19+
- repo: https://github.com/PyCQA/isort
20+
rev: 6.0.1
21+
hooks:
22+
- id: isort
3923

24+
- repo: https://github.com/psf/black
25+
rev: 25.1.0
26+
hooks:
27+
- id: black
28+
29+
- repo: https://github.com/kynan/nbstripout
30+
rev: 0.5.0
31+
hooks:
32+
- id: nbstripout
33+
34+
- repo: https://github.com/pre-commit/mirrors-mypy
35+
rev: 'v1.18.2' # Use the sha / tag you want to point at
36+
hooks:
37+
- id: mypy
38+
args: [--config-file=.mypy.ini]
39+
exclude: ^cfg/

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
//"postDebugTask": "stop server"
1515
}
1616
]
17-
}
17+
}

.vscode/settings.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"python.testing.pytestArgs": [
3-
"tests/."
3+
"tests"
44
],
55
"python.testing.unittestEnabled": false,
66
"python.testing.pytestEnabled": true,
@@ -16,10 +16,10 @@
1616

1717

1818

19-
20-
2119

2220

23-
24-
25-
}
21+
22+
23+
24+
25+
}

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"label": "start server",
66
"type": "shell",
77
"isBackground": true,
8-
//"command":"pwd",
8+
//"command":"pwd",
99
"command": "python",
1010
"args": ["${workspaceFolder}/frappy/bin/frappy-server","-c","${workspaceFolder}/frappy/cfg/cryo_cfg.py","cryo"],
1111
"presentation": { "reveal": "silent" },
@@ -34,4 +34,4 @@
3434
"command": "workbench.action.tasks.terminate",
3535
"args": "terminateAll"
3636
}]
37-
}
37+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This package allows seamless itegration of hardware that provides a SECoP interf
77

88

99

10-
## Getting Started
10+
## Getting Started
1111
A demo repository that shows the full functionality of the integration is provided here:
1212

1313
[secop-sim](https://codebase.helmholtz.cloud/rock-it-secop/secop-sim)

0 commit comments

Comments
 (0)