-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from ZLLentz/bld_pypi
BLD/TST: Get the pypi builds running on gha
- Loading branch information
Showing
7 changed files
with
83 additions
and
127 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,56 @@ | ||
# pmpsdb_client | ||
|
||
## Overview | ||
Client-side application for the PMPS database | ||
|
||
This is a cli/gui application and library for managing the deployment and | ||
inspection of PMPS database files on production PLCs at LCLS. | ||
This is a gui and cli application for managing the deployment and inspection of | ||
PMPS database files on production PLCs at LCLS. | ||
It provides tools to make deployment and verification of deployment seamless and easy. | ||
|
||
|
||
## Usage | ||
Once installed, this application can be invoked via `pmpsdb`. For example, here is | ||
the current output of `pmpsdb --help`: | ||
|
||
``` | ||
usage: pmpsdb [-h] [--version] [--verbose] {gui,plc} ... | ||
usage: pmpsdb [-h] [--version] [--verbose] [--export-dir EXPORT_DIR] {gui,list-files,upload-to,download-from,compare,reload} ... | ||
PMPS database deployment helpers | ||
positional arguments: | ||
{gui,plc} | ||
gui Open the pmpsdb gui. | ||
plc Read db from or write db to the plc harddrives. | ||
{gui,list-files,upload-to,download-from,compare,reload} | ||
gui Open the pmpsdb gui. | ||
list-files Show all files uploaded to a PLC. | ||
upload-to Upload a database export file to a PLC. | ||
download-from Download a database file previously exported to a PLC. | ||
compare Compare files beteween the local exports and the PLC. | ||
reload Force the PLC to re-read the database export while running. | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
--version Show version information and exit | ||
--verbose, -v Show tracebacks and debug statements | ||
-h, --help show this help message and exit | ||
--version Show version information and exit | ||
--verbose, -v Show tracebacks and debug statements | ||
--export-dir EXPORT_DIR, -e EXPORT_DIR | ||
The directory that contains database file exports. | ||
``` | ||
|
||
From a git clone, you can invoke the same script without needing to install the | ||
package. This is done from the root directory here by calling | ||
`python -m pmpsdb --help`, for example. | ||
|
||
This application will not work unless you have access to the LCLS controls networks. | ||
It is designed to run on an endstation's operator consoles. | ||
|
||
The most common usage will be to open the gui from an operator console as simply `pmpsdb gui`. | ||
|
||
|
||
## Installation | ||
This package can be installed using recent versions of `pip` that support | ||
the `pyproject.toml` format. To install, you can either clone this repo and run | ||
the following from the root directory: `pip install .`, or you can install | ||
directly from github via: | ||
`pip install 'pmpsdb_client @ git+https://github.com/pcdshub/[email protected]'` | ||
for example, to install version v1.0.0. | ||
the `pyproject.toml` format. | ||
|
||
To install, you can choose one of the following: | ||
- `pip install pmpsdb_client` to install from pypi | ||
- clone this repo, check out the desired tag, and run the following from the root directory: `pip install .` | ||
- install directly from github via: `pip install 'pmpsdb_client @ git+https://github.com/pcdshub/[email protected]'` for example, to install version v1.1.2. | ||
|
||
|
||
## PLC Configuration | ||
The PLC must have the following configuration: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
plc-lfe-motion: "PLC:LFE:MOTION" | ||
plc-lfe-optics: "PLC:LFE:OPTICS" | ||
plc-xrt-homs: "PLC:XRT:HOMS" | ||
plc-xrt-homs: "PLC:XRT:OPTICS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from pmpsdb_client import __version__ | ||
from pmpsdb_client.cli import main | ||
from pmpsdb_client.cli.parser import create_parser | ||
|
||
|
||
def test_version(capsys): | ||
""" | ||
Minimal test that we can parse input and do something | ||
""" | ||
parser = create_parser() | ||
assert main(parser.parse_args(["--version"])) == 0 | ||
captured = capsys.readouterr() | ||
assert str(__version__) in captured.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def test_gui_imports(): | ||
""" | ||
Minimal test that we can import the items needed to run the gui | ||
""" | ||
import pmpsdb_client.cli.run_gui # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,45 @@ | ||
[build-system] | ||
requires = ["setuptools", "setuptools-scm"] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ "setuptools>=45", "setuptools_scm[toml]>=6.2",] | ||
|
||
[project] | ||
name = "pmpsdb_client" | ||
classifiers = [ "Development Status :: 4 - Beta", "Natural Language :: English", "Programming Language :: Python :: 3",] | ||
description = "Client application for interfacing with the PMPS database and the deployed PLC files." | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
dynamic = [ "version", "readme", "dependencies", "optional-dependencies",] | ||
keywords = ["pmps", "pmpsdb", "lcls"] | ||
license = {text = "BSD 3-Clause License"} | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
] | ||
dependencies = [ | ||
"ophyd", | ||
"pcdscalc", | ||
"pcdsutils", | ||
"prettytable", | ||
"qtpy", | ||
] | ||
dynamic = ["version"] | ||
name = "pmpsdb_client" | ||
requires-python = ">=3.9" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "pmpsdb_client/_version.py" | ||
[[project.authors]] | ||
name = "SLAC National Accelerator Laboratory" | ||
|
||
[options] | ||
zip_safe = false | ||
include_package_data = true | ||
|
||
[project.optional-dependencies] | ||
gui = ["PyQt5"] | ||
[project.license] | ||
file = "LICENSE.md" | ||
|
||
[project.scripts] | ||
pmpsdb = "pmpsdb_client:cli.entrypoint" | ||
|
||
# ... other project metadata fields as specified in: | ||
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ | ||
[tool.setuptools_scm] | ||
write_to = "pmpsdb_client/_version.py" | ||
|
||
[tool.setuptools.packages.find] | ||
where = [ ".",] | ||
include = [ "pmpsdb_client*",] | ||
namespaces = false | ||
|
||
[tool.setuptools.dynamic.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[tool.setuptools.dynamic.dependencies] | ||
file = [ "requirements.txt",] | ||
|
||
[tool.setuptools.dynamic.optional-dependencies.test] | ||
file = "dev-requirements.txt" | ||
|
||
#[tool.setuptools.dynamic.optional-dependencies.docs] | ||
#file = "docs-requirements.txt" |