rtems-proxy 0.5.0__tar.gz → 0.5.2__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.
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.copier-answers.yml +1 -2
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.devcontainer/devcontainer.json +5 -5
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/CONTRIBUTING.md +1 -1
- rtems_proxy-0.5.2/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
- rtems_proxy-0.5.2/.github/ISSUE_TEMPLATE/issue.md +13 -0
- rtems_proxy-0.5.2/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +8 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/pages/index.html +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/pages/make_switcher.py +11 -7
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_pypi.yml +3 -3
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_release.yml +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/ci.yml +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.gitignore +1 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.pre-commit-config.yaml +1 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/extensions.json +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/settings.json +2 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/tasks.json +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/Dockerfile +1 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/PKG-INFO +6 -24
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/README.md +2 -18
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/pyproject.toml +20 -15
- rtems_proxy-0.5.2/src/rtems_proxy/__init__.py +11 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/__main__.py +3 -2
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/_version.py +2 -2
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/copy.py +11 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/rsync.sh.jinja +0 -1
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/utils.py +2 -3
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/PKG-INFO +6 -24
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/SOURCES.txt +3 -1
- rtems_proxy-0.5.2/tests/conftest.py +21 -0
- rtems-proxy-0.5.0/catalog-info.yaml +0 -10
- rtems-proxy-0.5.0/src/rtems_proxy/__init__.py +0 -3
- rtems-proxy-0.5.0/tests/conftest.py +0 -15
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/actions/install_requirements/action.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/dependabot.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_check.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_dist.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_test.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_tox.yml +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/launch.json +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/LICENSE +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/proxy-start.sh +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/requirements.txt +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/setup.cfg +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/globals.py +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/telnet.py +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/requires.txt +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/tests/test_cli.py +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Changes here will be overwritten by Copier
|
|
2
|
-
_commit: 2.0
|
|
2
|
+
_commit: 2.6.0
|
|
3
3
|
_src_path: gh:DiamondLightSource/python-copier-template
|
|
4
4
|
author_email: giles.knap@diamond.ac.uk
|
|
5
5
|
author_name: Giles Knap
|
|
6
|
-
component_owner: group:default/sscc
|
|
7
6
|
description: Support for a K8S proxy container in controlling and monitoring RTEMS
|
|
8
7
|
EPICS IOCs
|
|
9
8
|
distribution_name: rtems-proxy
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"features": {
|
|
30
|
-
//
|
|
31
|
-
"ghcr.io/
|
|
32
|
-
"upgradePackages": false
|
|
33
|
-
}
|
|
30
|
+
// add in eternal history and other bash features
|
|
31
|
+
"ghcr.io/diamondlightsource/devcontainer-features/bash-config:1.0.0": {}
|
|
34
32
|
},
|
|
33
|
+
// Create the config folder for the bash-config feature
|
|
34
|
+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/bash-config",
|
|
35
35
|
"runArgs": [
|
|
36
36
|
// Allow the container to access the host X11 display and EPICS CA
|
|
37
37
|
"--net=host",
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
|
|
43
43
|
// After the container is created, install the python project in editable form
|
|
44
44
|
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
|
|
45
|
-
}
|
|
45
|
+
}
|
|
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
|
|
|
24
24
|
|
|
25
25
|
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
|
|
26
26
|
|
|
27
|
-
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.0
|
|
27
|
+
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/2.6.0/how-to.html).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: The template to use for reporting bugs and usability issues
|
|
4
|
+
title: " "
|
|
5
|
+
labels: 'bug'
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Describe the bug, including a clear and concise description of the expected behavior, the actual behavior and the context in which you encountered it (ideally include details of your environment).
|
|
11
|
+
|
|
12
|
+
## Steps To Reproduce
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Go to '...'
|
|
15
|
+
2. Click on '....'
|
|
16
|
+
3. Scroll down to '....'
|
|
17
|
+
4. See error
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Acceptance Criteria
|
|
21
|
+
- Specific criteria that will be used to judge if the issue is fixed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Issue
|
|
3
|
+
about: The standard template to use for feature requests, design discussions and tasks
|
|
4
|
+
title: " "
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
A brief description of the issue, including specific stakeholders and the business case where appropriate
|
|
11
|
+
|
|
12
|
+
## Acceptance Criteria
|
|
13
|
+
- Specific criteria that will be used to judge if the issue is fixed
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
+
"""Make switcher.json to allow docs to switch between different versions."""
|
|
2
|
+
|
|
1
3
|
import json
|
|
2
4
|
import logging
|
|
3
5
|
from argparse import ArgumentParser
|
|
4
6
|
from pathlib import Path
|
|
5
7
|
from subprocess import CalledProcessError, check_output
|
|
6
|
-
from typing import List, Optional
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
def report_output(stdout: bytes, label: str) ->
|
|
10
|
+
def report_output(stdout: bytes, label: str) -> list[str]:
|
|
11
|
+
"""Print and return something received frm stdout."""
|
|
10
12
|
ret = stdout.decode().strip().split("\n")
|
|
11
13
|
print(f"{label}: {ret}")
|
|
12
14
|
return ret
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
def get_branch_contents(ref: str) ->
|
|
17
|
+
def get_branch_contents(ref: str) -> list[str]:
|
|
16
18
|
"""Get the list of directories in a branch."""
|
|
17
19
|
stdout = check_output(["git", "ls-tree", "-d", "--name-only", ref])
|
|
18
20
|
return report_output(stdout, "Branch contents")
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
def get_sorted_tags_list() ->
|
|
23
|
+
def get_sorted_tags_list() -> list[str]:
|
|
22
24
|
"""Get a list of sorted tags in descending order from the repository."""
|
|
23
25
|
stdout = check_output(["git", "tag", "-l", "--sort=-v:refname"])
|
|
24
26
|
return report_output(stdout, "Tags list")
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
def get_versions(ref: str, add:
|
|
29
|
+
def get_versions(ref: str, add: str | None) -> list[str]:
|
|
28
30
|
"""Generate the file containing the list of all GitHub Pages builds."""
|
|
29
31
|
# Get the directories (i.e. builds) from the GitHub Pages branch
|
|
30
32
|
try:
|
|
@@ -41,7 +43,7 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]:
|
|
|
41
43
|
tags = get_sorted_tags_list()
|
|
42
44
|
|
|
43
45
|
# Make the sorted versions list from main branches and tags
|
|
44
|
-
versions:
|
|
46
|
+
versions: list[str] = []
|
|
45
47
|
for version in ["master", "main"] + tags:
|
|
46
48
|
if version in builds:
|
|
47
49
|
versions.append(version)
|
|
@@ -53,7 +55,8 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]:
|
|
|
53
55
|
return versions
|
|
54
56
|
|
|
55
57
|
|
|
56
|
-
def write_json(path: Path, repository: str, versions: str):
|
|
58
|
+
def write_json(path: Path, repository: str, versions: list[str]):
|
|
59
|
+
"""Write the JSON switcher to path."""
|
|
57
60
|
org, repo_name = repository.split("/")
|
|
58
61
|
struct = [
|
|
59
62
|
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
|
|
@@ -65,6 +68,7 @@ def write_json(path: Path, repository: str, versions: str):
|
|
|
65
68
|
|
|
66
69
|
|
|
67
70
|
def main(args=None):
|
|
71
|
+
"""Parse args and write switcher."""
|
|
68
72
|
parser = ArgumentParser(
|
|
69
73
|
description="Make a versions.json file from gh-pages directories"
|
|
70
74
|
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
on:
|
|
2
2
|
workflow_call:
|
|
3
3
|
secrets:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
PYPI_TOKEN:
|
|
5
|
+
required: true
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
upload:
|
|
@@ -19,4 +19,4 @@ jobs:
|
|
|
19
19
|
- name: Publish to PyPI using trusted publishing
|
|
20
20
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
21
21
|
with:
|
|
22
|
-
|
|
22
|
+
attestations: false
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
- name: Create GitHub Release
|
|
24
24
|
# We pin to the SHA, not the tag, for security reasons.
|
|
25
25
|
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
|
|
26
|
-
uses: softprops/action-gh-release@
|
|
26
|
+
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
|
|
27
27
|
with:
|
|
28
28
|
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
|
|
29
29
|
files: "*"
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
strategy:
|
|
22
22
|
matrix:
|
|
23
23
|
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
|
|
24
|
-
python-version: ["3.
|
|
24
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
25
25
|
include:
|
|
26
26
|
# Include one that runs in the dev environment
|
|
27
27
|
- runs-on: "ubuntu-latest"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# The devcontainer should use the developer target and run as root with podman
|
|
2
2
|
# or docker with user namespaces.
|
|
3
3
|
ARG PYTHON_VERSION=3.11
|
|
4
|
-
FROM python:${PYTHON_VERSION}
|
|
4
|
+
FROM python:${PYTHON_VERSION} AS developer
|
|
5
5
|
|
|
6
6
|
# Add any system dependencies for the developer/build environment here
|
|
7
7
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
5
5
|
Author-email: Giles Knap <giles.knap@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -208,12 +208,10 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/rtems-proxy
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
212
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
213
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
214
211
|
Classifier: Programming Language :: Python :: 3.10
|
|
215
212
|
Classifier: Programming Language :: Python :: 3.11
|
|
216
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
+
Requires-Python: >=3.10
|
|
217
215
|
Description-Content-Type: text/markdown
|
|
218
216
|
License-File: LICENSE
|
|
219
217
|
Requires-Dist: jinja2
|
|
@@ -235,34 +233,18 @@ Requires-Dist: types-mock; extra == "dev"
|
|
|
235
233
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
236
234
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
237
235
|
[](https://pypi.org/project/rtems-proxy)
|
|
238
|
-
[](https://
|
|
236
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
239
237
|
|
|
240
238
|
# rtems_proxy
|
|
241
239
|
|
|
242
240
|
Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
243
241
|
|
|
244
|
-
This is where you should write a short paragraph that describes what your module does,
|
|
245
|
-
how it does it, and why people should use it.
|
|
246
242
|
|
|
247
243
|
Source | <https://github.com/epics-containers/rtems-proxy>
|
|
248
244
|
:---: | :---:
|
|
249
245
|
PyPI | `pip install rtems-proxy`
|
|
250
246
|
Releases | <https://github.com/epics-containers/rtems-proxy/releases>
|
|
251
247
|
|
|
252
|
-
This is where you should put some images or code snippets that illustrate
|
|
253
|
-
some relevant examples. If it is a library then you might put some
|
|
254
|
-
introductory code here:
|
|
255
|
-
|
|
256
|
-
```python
|
|
257
|
-
from rtems_proxy import __version__
|
|
258
|
-
|
|
259
|
-
print(f"Hello rtems_proxy {__version__}")
|
|
260
248
|
```
|
|
261
|
-
|
|
262
|
-
Or if it is a commandline tool then you might put some example commands here:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
python -m rtems_proxy --version
|
|
249
|
+
rtems_proxy --help
|
|
267
250
|
```
|
|
268
|
-
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
2
2
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
3
3
|
[](https://pypi.org/project/rtems-proxy)
|
|
4
|
-
[](https://
|
|
4
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
5
5
|
|
|
6
6
|
# rtems_proxy
|
|
7
7
|
|
|
8
8
|
Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
9
9
|
|
|
10
|
-
This is where you should write a short paragraph that describes what your module does,
|
|
11
|
-
how it does it, and why people should use it.
|
|
12
10
|
|
|
13
11
|
Source | <https://github.com/epics-containers/rtems-proxy>
|
|
14
12
|
:---: | :---:
|
|
15
13
|
PyPI | `pip install rtems-proxy`
|
|
16
14
|
Releases | <https://github.com/epics-containers/rtems-proxy/releases>
|
|
17
15
|
|
|
18
|
-
This is where you should put some images or code snippets that illustrate
|
|
19
|
-
some relevant examples. If it is a library then you might put some
|
|
20
|
-
introductory code here:
|
|
21
|
-
|
|
22
|
-
```python
|
|
23
|
-
from rtems_proxy import __version__
|
|
24
|
-
|
|
25
|
-
print(f"Hello rtems_proxy {__version__}")
|
|
26
16
|
```
|
|
27
|
-
|
|
28
|
-
Or if it is a commandline tool then you might put some example commands here:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
python -m rtems_proxy --version
|
|
17
|
+
rtems_proxy --help
|
|
33
18
|
```
|
|
34
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=64", "setuptools_scm[toml]>=
|
|
2
|
+
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -7,18 +7,16 @@ name = "rtems-proxy"
|
|
|
7
7
|
classifiers = [
|
|
8
8
|
"Development Status :: 3 - Alpha",
|
|
9
9
|
"License :: OSI Approved :: Apache Software License",
|
|
10
|
-
"Programming Language :: Python :: 3.7",
|
|
11
|
-
"Programming Language :: Python :: 3.8",
|
|
12
|
-
"Programming Language :: Python :: 3.9",
|
|
13
10
|
"Programming Language :: Python :: 3.10",
|
|
14
11
|
"Programming Language :: Python :: 3.11",
|
|
12
|
+
"Programming Language :: Python :: 3.12",
|
|
15
13
|
]
|
|
16
14
|
description = "Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs"
|
|
17
15
|
dependencies = ["jinja2", "pexpect", "ruamel.yaml", "telnetlib3", "typer"]
|
|
18
16
|
dynamic = ["version"]
|
|
19
17
|
license.file = "LICENSE"
|
|
20
18
|
readme = "README.md"
|
|
21
|
-
requires-python = ">=3.
|
|
19
|
+
requires-python = ">=3.10"
|
|
22
20
|
|
|
23
21
|
[project.optional-dependencies]
|
|
24
22
|
dev = [
|
|
@@ -45,7 +43,7 @@ name = "Giles Knap"
|
|
|
45
43
|
|
|
46
44
|
|
|
47
45
|
[tool.setuptools_scm]
|
|
48
|
-
|
|
46
|
+
version_file = "src/rtems_proxy/_version.py"
|
|
49
47
|
|
|
50
48
|
[tool.mypy]
|
|
51
49
|
ignore_missing_imports = true # Ignore missing stubs in imported modules
|
|
@@ -83,13 +81,13 @@ allowlist_externals =
|
|
|
83
81
|
pre-commit
|
|
84
82
|
mypy
|
|
85
83
|
commands =
|
|
86
|
-
pre-commit: pre-commit run --all-files {posargs}
|
|
84
|
+
pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
|
|
87
85
|
type-checking: mypy src tests {posargs}
|
|
88
86
|
tests: pytest --cov=rtems_proxy --cov-report term --cov-report xml:cov.xml {posargs}
|
|
89
87
|
"""
|
|
90
88
|
|
|
91
89
|
[tool.ruff]
|
|
92
|
-
ignore = [
|
|
90
|
+
lint.ignore = [
|
|
93
91
|
"B008", # Do not perform unnecessary work in __all__
|
|
94
92
|
"C408", # Unnecessary collection call - e.g. list(...) instead of [...]
|
|
95
93
|
"E501", # Line too long, should be fixed by black.
|
|
@@ -97,11 +95,18 @@ ignore = [
|
|
|
97
95
|
src = ["src", "tests"]
|
|
98
96
|
line-length = 88
|
|
99
97
|
lint.select = [
|
|
100
|
-
"B",
|
|
101
|
-
"C4",
|
|
102
|
-
"E",
|
|
103
|
-
"F",
|
|
104
|
-
"W",
|
|
105
|
-
"I",
|
|
106
|
-
"UP",
|
|
98
|
+
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
|
|
99
|
+
"C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
|
|
100
|
+
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
|
|
101
|
+
"F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
|
|
102
|
+
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
|
|
103
|
+
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
|
|
104
|
+
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
|
|
105
|
+
"SLF", # self - https://docs.astral.sh/ruff/settings/#lintflake8-self
|
|
107
106
|
]
|
|
107
|
+
|
|
108
|
+
[tool.ruff.lint.per-file-ignores]
|
|
109
|
+
# By default, private member access is allowed in tests
|
|
110
|
+
# See https://github.com/DiamondLightSource/python-copier-template/issues/154
|
|
111
|
+
# Remove this line to forbid private member access in tests
|
|
112
|
+
"tests/**/*" = ["SLF001"]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import Optional
|
|
3
2
|
|
|
4
3
|
import typer
|
|
5
4
|
from jinja2 import Template
|
|
@@ -23,7 +22,7 @@ def version_callback(value: bool):
|
|
|
23
22
|
|
|
24
23
|
@cli.callback()
|
|
25
24
|
def main(
|
|
26
|
-
version:
|
|
25
|
+
version: bool | None = typer.Option(
|
|
27
26
|
None,
|
|
28
27
|
"--version",
|
|
29
28
|
callback=version_callback,
|
|
@@ -144,5 +143,7 @@ def dev(
|
|
|
144
143
|
|
|
145
144
|
# test with:
|
|
146
145
|
# pipenv run python -m ibek
|
|
146
|
+
|
|
147
|
+
|
|
147
148
|
if __name__ == "__main__":
|
|
148
149
|
cli()
|
|
@@ -16,7 +16,7 @@ def copy_rtems():
|
|
|
16
16
|
# root of pvc mount into which we copy the IOC files for the RTEMS IOC to access
|
|
17
17
|
root = GLOBALS.RTEMS_TFTP_PATH
|
|
18
18
|
# root of the path that the RTEMS IOC expects to find the IOC files
|
|
19
|
-
RTEMS_TFTP_PATH = Path("/iocs") / GLOBALS.
|
|
19
|
+
RTEMS_TFTP_PATH = Path("/iocs") / GLOBALS.IOC_NAME
|
|
20
20
|
# where to copy the Generic IOC folder to (at present only holds the dbd folder)
|
|
21
21
|
ioc_dest = root / "ioc"
|
|
22
22
|
# where to copy the generated runtime assets to (st.cmd and ioc.db)
|
|
@@ -36,8 +36,18 @@ def copy_rtems():
|
|
|
36
36
|
shutil.copy(bin_rtems_src, bin_rtems_dest)
|
|
37
37
|
shutil.copytree(GLOBALS.RUNTIME, dest_runtime, dirs_exist_ok=True)
|
|
38
38
|
|
|
39
|
+
protocol_folder = RTEMS_TFTP_PATH / "protocol"
|
|
40
|
+
protocol_files = GLOBALS.SUPPORT.glob("**/*.proto*")
|
|
41
|
+
for proto_file in protocol_files:
|
|
42
|
+
dest = protocol_folder / proto_file.name
|
|
43
|
+
shutil.copy(proto_file, dest)
|
|
44
|
+
|
|
39
45
|
# because we moved the ioc files we need to fix up startup script paths
|
|
40
46
|
startup = dest_runtime / "st.cmd"
|
|
41
47
|
cmd_txt = startup.read_text()
|
|
42
48
|
cmd_txt = re.sub("/epics/", f"{str(RTEMS_TFTP_PATH)}/", cmd_txt)
|
|
49
|
+
# also fix up the protocol path to point to protocol_folder
|
|
50
|
+
cmd_txt = (
|
|
51
|
+
cmd_txt + f'\nepicsEnvSet("STREAM_PROTOCOL_PATH", "{str(protocol_folder)}")\n'
|
|
52
|
+
)
|
|
43
53
|
startup.write_text(cmd_txt)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import subprocess
|
|
2
|
-
from typing import Union
|
|
3
2
|
|
|
4
3
|
import typer
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
def run_command(
|
|
8
7
|
command: str, interactive=True, error_OK=False, show=False
|
|
9
|
-
) ->
|
|
8
|
+
) -> str | bool:
|
|
10
9
|
"""
|
|
11
10
|
Run a command and return the output
|
|
12
11
|
|
|
@@ -30,7 +29,7 @@ def run_command(
|
|
|
30
29
|
error_out = p_result.stderr.decode()
|
|
31
30
|
|
|
32
31
|
if interactive:
|
|
33
|
-
result:
|
|
32
|
+
result: str | bool = p_result.returncode == 0
|
|
34
33
|
else:
|
|
35
34
|
result = output + error_out
|
|
36
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
5
5
|
Author-email: Giles Knap <giles.knap@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -208,12 +208,10 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/rtems-proxy
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
212
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
213
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
214
211
|
Classifier: Programming Language :: Python :: 3.10
|
|
215
212
|
Classifier: Programming Language :: Python :: 3.11
|
|
216
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
+
Requires-Python: >=3.10
|
|
217
215
|
Description-Content-Type: text/markdown
|
|
218
216
|
License-File: LICENSE
|
|
219
217
|
Requires-Dist: jinja2
|
|
@@ -235,34 +233,18 @@ Requires-Dist: types-mock; extra == "dev"
|
|
|
235
233
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
236
234
|
[](https://codecov.io/gh/epics-containers/rtems-proxy)
|
|
237
235
|
[](https://pypi.org/project/rtems-proxy)
|
|
238
|
-
[](https://
|
|
236
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
239
237
|
|
|
240
238
|
# rtems_proxy
|
|
241
239
|
|
|
242
240
|
Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
243
241
|
|
|
244
|
-
This is where you should write a short paragraph that describes what your module does,
|
|
245
|
-
how it does it, and why people should use it.
|
|
246
242
|
|
|
247
243
|
Source | <https://github.com/epics-containers/rtems-proxy>
|
|
248
244
|
:---: | :---:
|
|
249
245
|
PyPI | `pip install rtems-proxy`
|
|
250
246
|
Releases | <https://github.com/epics-containers/rtems-proxy/releases>
|
|
251
247
|
|
|
252
|
-
This is where you should put some images or code snippets that illustrate
|
|
253
|
-
some relevant examples. If it is a library then you might put some
|
|
254
|
-
introductory code here:
|
|
255
|
-
|
|
256
|
-
```python
|
|
257
|
-
from rtems_proxy import __version__
|
|
258
|
-
|
|
259
|
-
print(f"Hello rtems_proxy {__version__}")
|
|
260
248
|
```
|
|
261
|
-
|
|
262
|
-
Or if it is a commandline tool then you might put some example commands here:
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
```
|
|
266
|
-
python -m rtems_proxy --version
|
|
249
|
+
rtems_proxy --help
|
|
267
250
|
```
|
|
268
|
-
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
Dockerfile
|
|
5
5
|
LICENSE
|
|
6
6
|
README.md
|
|
7
|
-
catalog-info.yaml
|
|
8
7
|
proxy-start.sh
|
|
9
8
|
pyproject.toml
|
|
10
9
|
requirements.txt
|
|
11
10
|
.devcontainer/devcontainer.json
|
|
12
11
|
.github/CONTRIBUTING.md
|
|
13
12
|
.github/dependabot.yml
|
|
13
|
+
.github/ISSUE_TEMPLATE/bug_report.md
|
|
14
|
+
.github/ISSUE_TEMPLATE/issue.md
|
|
15
|
+
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
|
|
14
16
|
.github/actions/install_requirements/action.yml
|
|
15
17
|
.github/pages/index.html
|
|
16
18
|
.github/pages/make_switcher.py
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
# Prevent pytest from catching exceptions when debugging in vscode so that break on
|
|
7
|
+
# exception works correctly (see: https://github.com/pytest-dev/pytest/issues/7409)
|
|
8
|
+
if os.getenv("PYTEST_RAISE", "0") == "1":
|
|
9
|
+
|
|
10
|
+
@pytest.hookimpl(tryfirst=True)
|
|
11
|
+
def pytest_exception_interact(call: pytest.CallInfo[Any]):
|
|
12
|
+
if call.excinfo is not None:
|
|
13
|
+
raise call.excinfo.value
|
|
14
|
+
else:
|
|
15
|
+
raise RuntimeError(
|
|
16
|
+
f"{call} has no exception data, an unknown error has occurred"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
@pytest.hookimpl(tryfirst=True)
|
|
20
|
+
def pytest_internalerror(excinfo: pytest.ExceptionInfo[Any]):
|
|
21
|
+
raise excinfo.value
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: Component
|
|
3
|
-
metadata:
|
|
4
|
-
name: rtems-proxy
|
|
5
|
-
title: rtems-proxy
|
|
6
|
-
description: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
7
|
-
spec:
|
|
8
|
-
type: documentation
|
|
9
|
-
lifecycle: experimental
|
|
10
|
-
owner: group:default/sscc
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
import pytest
|
|
4
|
-
|
|
5
|
-
# Prevent pytest from catching exceptions when debugging in vscode so that break on
|
|
6
|
-
# exception works correctly (see: https://github.com/pytest-dev/pytest/issues/7409)
|
|
7
|
-
if os.getenv("PYTEST_RAISE", "0") == "1":
|
|
8
|
-
|
|
9
|
-
@pytest.hookimpl(tryfirst=True)
|
|
10
|
-
def pytest_exception_interact(call):
|
|
11
|
-
raise call.excinfo.value
|
|
12
|
-
|
|
13
|
-
@pytest.hookimpl(tryfirst=True)
|
|
14
|
-
def pytest_internalerror(excinfo):
|
|
15
|
-
raise excinfo.value
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|