Skip to content

Commit 31b15ee

Browse files
committed
Fixed some config issues with __version__ reenabled strict type checking and docs building
1 parent 8832c4e commit 31b15ee

File tree

8 files changed

+22
-12
lines changed

8 files changed

+22
-12
lines changed

.github/workflows/_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json
4545

4646
- name: Publish Docs to gh-pages
47-
# if: github.ref_type == 'tag' || github.ref_name == 'main'
47+
if: github.ref_type == 'tag' || github.ref_name == 'main'
4848
# We pin to the SHA, not the tag, for security reasons.
4949
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
5050
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0

.vscode/launch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
"program": "${file}",
88
"console": "integratedTerminal"
99
},
10+
{
11+
"name": "Python Debugger: Virtac",
12+
"type": "debugpy",
13+
"request": "launch",
14+
"program": "/venv/bin/virtac",
15+
"console": "integratedTerminal"
16+
},
1017
{
1118
"name": "Debug Unit Test",
1219
"type": "debugpy",

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ name = "Phil Smith"
6464
version_file = "src/atip/_version.py"
6565

6666
[tool.pyright]
67-
typeCheckingMode = "off" # TODO: This should be switched back to "standard" at some point!
67+
typeCheckingMode = "standard" # TODO: This should be switched back to "standard" at some point!
6868
reportMissingImports = false # Ignore missing stubs in imported modules
69+
ignore = ["tests"] #Not currently type checking tests
6970

7071
[tool.pytest.ini_options]
7172
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
@@ -105,9 +106,11 @@ commands =
105106
pre-commit: pre-commit run --all-files --show-diff-on-failure {posargs}
106107
type-checking: pyright src tests {posargs}
107108
tests: pytest --cov=atip --cov-report term --cov-report xml:cov.xml {posargs}
108-
docs: sphinx-{posargs:build -E --keep-going} -T docs build/html
109+
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
109110
"""
110111

112+
#TODO: ^ Add/remove the -W flag from sphinx to enable/disable exiting on docs build errors
113+
111114
[tool.ruff]
112115
src = ["src", "tests"]
113116
line-length = 88

src/atip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""ATIP: Accelerator Toolbox Interface for Pytac.
2-
See README.rst & INSTALL.rst for more information.
2+
See README.md for more information.
33
44
.. data:: __version__
55
:type: str

src/atip/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytac
88

99
import atip
10-
from atip import __version__
1110

1211
__all__ = ["main"]
1312

@@ -19,7 +18,7 @@ def main(args: Sequence[str] | None = None) -> None:
1918
"-v",
2019
"--version",
2120
action="version",
22-
version=__version__,
21+
version=atip.__version__,
2322
)
2423
parser.parse_args(args)
2524

src/virtac/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
Version number as calculated by https://github.com/pypa/setuptools_scm
88
"""
99

10-
from atip._version import __version__
11-
1210
from . import __main__, atip_server, create_csv, masks, mirror_objects
1311

1412
__all__ = [
15-
"__version__",
1613
"__main__",
1714
"atip_server",
1815
"create_csv",

src/virtac/__main__.py

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

1313
from softioc import builder, softioc
1414
from . import atip_server
15-
from atip._version import __version__
15+
from atip import __version__
1616

1717
__all__ = ["main"]
1818

src/virtac/create_csv.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def generate_mirrored_pvs(lattice):
126126
127127
value: The inital value of the output record.
128128
"""
129-
data = [("output type", "mirror type", "in", "out", "value")]
129+
data: list[tuple[str, str, str, str, int]] = [
130+
("output type", "mirror type", "in", "out", 0)
131+
]
130132
# Tune PV aliases.
131133
tune = [
132134
lattice.get_value("tune_x", pytac.RB, data_source=pytac.SIM),
@@ -171,7 +173,9 @@ def generate_mirrored_pvs(lattice):
171173
)
172174
)
173175
# Electron BPMs enabled.
174-
bpm_enabled_pvs = lattice.get_element_pv_names("BPM", "enabled", pytac.RB)
176+
bpm_enabled_pvs: list[str] = lattice.get_element_pv_names(
177+
"BPM", "enabled", pytac.RB
178+
)
175179
data.append(
176180
(
177181
"Waveform",

0 commit comments

Comments
 (0)