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.
Files changed (50) hide show
  1. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.copier-answers.yml +1 -2
  2. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.devcontainer/devcontainer.json +5 -5
  3. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/CONTRIBUTING.md +1 -1
  4. rtems_proxy-0.5.2/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
  5. rtems_proxy-0.5.2/.github/ISSUE_TEMPLATE/issue.md +13 -0
  6. rtems_proxy-0.5.2/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +8 -0
  7. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/pages/index.html +1 -1
  8. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/pages/make_switcher.py +11 -7
  9. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_pypi.yml +3 -3
  10. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_release.yml +1 -1
  11. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/ci.yml +1 -1
  12. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.gitignore +1 -0
  13. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.pre-commit-config.yaml +1 -0
  14. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/extensions.json +1 -1
  15. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/settings.json +2 -1
  16. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/tasks.json +1 -1
  17. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/Dockerfile +1 -1
  18. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/PKG-INFO +6 -24
  19. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/README.md +2 -18
  20. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/pyproject.toml +20 -15
  21. rtems_proxy-0.5.2/src/rtems_proxy/__init__.py +11 -0
  22. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/__main__.py +3 -2
  23. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/_version.py +2 -2
  24. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/copy.py +11 -1
  25. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/rsync.sh.jinja +0 -1
  26. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/utils.py +2 -3
  27. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/PKG-INFO +6 -24
  28. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/SOURCES.txt +3 -1
  29. rtems_proxy-0.5.2/tests/conftest.py +21 -0
  30. rtems-proxy-0.5.0/catalog-info.yaml +0 -10
  31. rtems-proxy-0.5.0/src/rtems_proxy/__init__.py +0 -3
  32. rtems-proxy-0.5.0/tests/conftest.py +0 -15
  33. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/actions/install_requirements/action.yml +0 -0
  34. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/dependabot.yml +0 -0
  35. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_check.yml +0 -0
  36. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_dist.yml +0 -0
  37. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_test.yml +0 -0
  38. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.github/workflows/_tox.yml +0 -0
  39. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/.vscode/launch.json +0 -0
  40. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/LICENSE +0 -0
  41. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/proxy-start.sh +0 -0
  42. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/requirements.txt +0 -0
  43. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/setup.cfg +0 -0
  44. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/globals.py +0 -0
  45. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy/telnet.py +0 -0
  46. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
  47. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
  48. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/requires.txt +0 -0
  49. {rtems-proxy-0.5.0 → rtems_proxy-0.5.2}/src/rtems_proxy.egg-info/top_level.txt +0 -0
  50. {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
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
- // Some default things like git config
31
- "ghcr.io/devcontainers/features/common-utils:2": {
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.2/how-to.html).
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
@@ -0,0 +1,8 @@
1
+ Fixes #ISSUE
2
+
3
+ ### Instructions to reviewer on how to test:
4
+ 1. Do thing x
5
+ 2. Confirm thing y happens
6
+
7
+ ### Checks for reviewer
8
+ - [ ] Would the PR title make sense to a user on a set of release notes
@@ -8,4 +8,4 @@
8
8
  <link rel="canonical" href="main/index.html">
9
9
  </head>
10
10
 
11
- </html>
11
+ </html>
@@ -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) -> List[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) -> List[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() -> List[str]:
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: Optional[str]) -> List[str]:
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: List[str] = []
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
- PYPI_TOKEN:
5
- required: true
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
- password: ${{ secrets.PYPI_TOKEN }}
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@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
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.8", "3.9", "3.10", "3.11"]
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"
@@ -55,6 +55,7 @@ cov.xml
55
55
 
56
56
  # Sphinx documentation
57
57
  docs/_build/
58
+ docs/_api
58
59
 
59
60
  # PyBuilder
60
61
  target/
@@ -5,6 +5,7 @@ repos:
5
5
  - id: check-added-large-files
6
6
  - id: check-yaml
7
7
  - id: check-merge-conflict
8
+ - id: end-of-file-fixer
8
9
 
9
10
  - repo: local
10
11
  hooks:
@@ -2,4 +2,4 @@
2
2
  "recommendations": [
3
3
  "ms-vscode-remote.remote-containers",
4
4
  ]
5
- }
5
+ }
@@ -5,7 +5,8 @@
5
5
  "editor.codeActionsOnSave": {
6
6
  "source.organizeImports": "explicit"
7
7
  },
8
+ "files.insertFinalNewline": true,
8
9
  "[python]": {
9
10
  "editor.defaultFormatter": "charliermarsh.ruff",
10
11
  },
11
- }
12
+ }
@@ -13,4 +13,4 @@
13
13
  "problemMatcher": [],
14
14
  }
15
15
  ]
16
- }
16
+ }
@@ -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} as developer
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
1
+ Metadata-Version: 2.2
2
2
  Name: rtems-proxy
3
- Version: 0.5.0
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
- Requires-Python: >=3.7
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
  [![CI](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
236
234
  [![Coverage](https://codecov.io/gh/epics-containers/rtems-proxy/branch/main/graph/badge.svg)](https://codecov.io/gh/epics-containers/rtems-proxy)
237
235
  [![PyPI](https://img.shields.io/pypi/v/rtems-proxy.svg)](https://pypi.org/project/rtems-proxy)
238
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
236
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](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
  [![CI](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
2
2
  [![Coverage](https://codecov.io/gh/epics-containers/rtems-proxy/branch/main/graph/badge.svg)](https://codecov.io/gh/epics-containers/rtems-proxy)
3
3
  [![PyPI](https://img.shields.io/pypi/v/rtems-proxy.svg)](https://pypi.org/project/rtems-proxy)
4
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](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]>=6.2"]
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.7"
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
- write_to = "src/rtems_proxy/_version.py"
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", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
101
- "C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
102
- "E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
103
- "F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
104
- "W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
105
- "I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
106
- "UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-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"]
@@ -0,0 +1,11 @@
1
+ """Top level API.
2
+
3
+ .. data:: __version__
4
+ :type: str
5
+
6
+ Version number as calculated by https://github.com/pypa/setuptools_scm
7
+ """
8
+
9
+ from ._version import __version__
10
+
11
+ __all__ = ["__version__"]
@@ -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: Optional[bool] = typer.Option(
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()
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.5.0'
16
- __version_tuple__ = version_tuple = (0, 5, 0)
15
+ __version__ = version = '0.5.2'
16
+ __version_tuple__ = version_tuple = (0, 5, 2)
@@ -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.IOC_GROUP / GLOBALS.IOC_NAME
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)
@@ -28,4 +28,3 @@ done
28
28
  " > /tmp/rsync-background.sh
29
29
 
30
30
  nohup bash /tmp/rsync-background.sh &> /tmp/rsync-background.log &
31
-
@@ -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
- ) -> Union[str, bool]:
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: Union[str, bool] = p_result.returncode == 0
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
1
+ Metadata-Version: 2.2
2
2
  Name: rtems-proxy
3
- Version: 0.5.0
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
- Requires-Python: >=3.7
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
  [![CI](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
236
234
  [![Coverage](https://codecov.io/gh/epics-containers/rtems-proxy/branch/main/graph/badge.svg)](https://codecov.io/gh/epics-containers/rtems-proxy)
237
235
  [![PyPI](https://img.shields.io/pypi/v/rtems-proxy.svg)](https://pypi.org/project/rtems-proxy)
238
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
236
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](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,3 +0,0 @@
1
- from ._version import __version__
2
-
3
- __all__ = ["__version__"]
@@ -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