Skip to content

Commit 34e1442

Browse files
committed
Squashed commit of the following:
commit 5d8457c4495491490ed220564e1002284f0a9215 Author: David Meyer <dihm@users.noreply.github.com> Date: Fri Feb 9 12:09:00 2024 -0500 Merge pull request #112 from dihm/setuptools_scm_fix Ensure setuptools_scm always uses `release-branch-semver`. commit 03c7e19c7afa35fc088212907f5fbb714007162a Author: David Meyer <dihm@users.noreply.github.com> Date: Fri Feb 9 12:05:59 2024 -0500 Merge pull request #113 from dihm/update_workflow Update workflow pins to upgrade node.js to 20. commit 0ab9b30678e4bc5582c791e67659618b30ad6211 Author: David Meyer <dihm@users.noreply.github.com> Date: Thu Jan 18 20:59:22 2024 -0500 Merge pull request #111 from dihm/rtd_build Modernize RTD build commit 00ffd6c498178e11a7c8fa275632543126313db9 Author: David Meyer <dihm@users.noreply.github.com> Date: Thu Oct 12 16:17:57 2023 -0400 Merge pull request #110 from dihm/get_shot_globals_deprecation Get shot globals deprecation
1 parent c355ffc commit 34e1442

File tree

8 files changed

+41
-59
lines changed

8 files changed

+41
-59
lines changed

.github/workflows/release.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
if: github.repository == 'labscript-suite/runmanager' && (github.event_name != 'create' || github.event.ref_type != 'branch')
6565
steps:
6666
- name: Checkout
67-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
6868
with:
6969
fetch-depth: 0
7070

@@ -73,7 +73,7 @@ jobs:
7373
run: git tag -d $(git tag --points-at HEAD)
7474

7575
- name: Install Python
76-
uses: actions/setup-python@v4
76+
uses: actions/setup-python@v5
7777
with:
7878
python-version: ${{ matrix.python }}
7979
architecture: ${{ matrix.arch }}
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Upload Artifact
9595
if: strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux')
96-
uses: actions/upload-artifact@v3
96+
uses: actions/upload-artifact@v4
9797
with:
9898
name: dist
9999
path: ./dist
@@ -111,7 +111,7 @@ jobs:
111111
112112
- name: Install Miniconda
113113
if: matrix.conda
114-
uses: conda-incubator/setup-miniconda@v2
114+
uses: conda-incubator/setup-miniconda@v3
115115
with:
116116
auto-update-conda: true
117117
python-version: ${{ matrix.python }}
@@ -140,7 +140,7 @@ jobs:
140140
141141
- name: Upload Artifact
142142
if: matrix.conda
143-
uses: actions/upload-artifact@v3
143+
uses: actions/upload-artifact@v4
144144
with:
145145
name: conda_packages
146146
path: ./conda_packages
@@ -153,7 +153,7 @@ jobs:
153153
steps:
154154
- name: Checkout
155155
if: env.PURE == 'false'
156-
uses: actions/checkout@v3
156+
uses: actions/checkout@v4
157157
with:
158158
fetch-depth: 0
159159

@@ -170,7 +170,7 @@ jobs:
170170

171171
- name: Upload Artifact
172172
if: env.PURE == 'false'
173-
uses: actions/upload-artifact@v3
173+
uses: actions/upload-artifact@v4
174174
with:
175175
name: dist
176176
path: dist/*manylinux*.whl
@@ -182,13 +182,13 @@ jobs:
182182
steps:
183183

184184
- name: Download Artifact
185-
uses: actions/download-artifact@v3
185+
uses: actions/download-artifact@v4
186186
with:
187187
name: dist
188188
path: ./dist
189189

190190
- name: Download Artifact
191-
uses: actions/download-artifact@v3
191+
uses: actions/download-artifact@v4
192192
with:
193193
name: conda_packages
194194
path: ./conda_packages
@@ -226,7 +226,7 @@ jobs:
226226
password: ${{ secrets.pypi }}
227227

228228
- name: Install Miniconda
229-
uses: conda-incubator/setup-miniconda@v2
229+
uses: conda-incubator/setup-miniconda@v3
230230
with:
231231
auto-update-conda: true
232232

docs/source/conf.py

+3-19
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import copy
1414
import os
1515
from pathlib import Path
16-
from m2r import MdInclude
17-
from recommonmark.transform import AutoStructify
1816
from jinja2 import FileSystemLoader, Environment
1917
try:
2018
import importlib.metadata as importlib_metadata
@@ -51,7 +49,7 @@
5149
"sphinx.ext.todo",
5250
"sphinx.ext.viewcode",
5351
"sphinx_rtd_theme",
54-
"recommonmark",
52+
"myst_parser",
5553
]
5654

5755
autodoc_typehints = 'description'
@@ -108,6 +106,7 @@ def set_process_name(self,*args,**kwargs):
108106

109107
# Prefix each autosectionlabel with the name of the document it is in and a colon
110108
autosectionlabel_prefix_document = True
109+
myst_heading_anchors = 2
111110

112111
# Add any paths that contain templates here, relative to this directory.
113112
templates_path = ['_templates']
@@ -246,23 +245,8 @@ def set_process_name(self,*args,**kwargs):
246245
# Customize the html_theme
247246
html_theme_options = {'navigation_depth': 3}
248247

249-
# Use m2r only for mdinclude and recommonmark for everything else
250-
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
251248
def setup(app):
252-
config = {
253-
# 'url_resolver': lambda url: github_doc_root + url,
254-
'auto_toc_tree_section': 'Contents',
255-
'enable_eval_rst': True,
256-
}
257-
app.add_config_value('recommonmark_config', config, True)
258-
app.add_transform(AutoStructify)
259-
260-
# from m2r to make `mdinclude` work
261-
app.add_config_value('no_underscore_emphasis', False, 'env')
262-
app.add_config_value('m2r_parse_relative_links', False, 'env')
263-
app.add_config_value('m2r_anonymous_references', False, 'env')
264-
app.add_config_value('m2r_disable_inline_math', False, 'env')
265-
app.add_directive('mdinclude', MdInclude)
249+
266250
app.add_css_file('custom.css')
267251

268252
# generate the components.rst file dynamically so it points to stable/latest

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "setuptools_scm"]
2+
requires = ["setuptools>=64", "wheel", "setuptools_scm>=8"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]

readthedocs.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# Required
55
version: 2
66

7+
# Set build environment options
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
713
# Build documentation in the docs/ directory with Sphinx
814
sphinx:
915
builder: dirhtml
@@ -15,13 +21,11 @@ formats:
1521
- pdf
1622
- epub
1723

18-
# Optionally set the version of Python and requirements required to build your docs
24+
# Optionally set the requirements required to build your docs
1925
python:
20-
version: 3.7
2126
install:
2227
- method: pip
2328
path: .
2429
extra_requirements:
2530
- docs
26-
system_packages: true
2731

runmanager/__init__.py

+12-18
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
import json
2626
import tokenize
2727
import io
28+
import warnings
2829

2930
import labscript_utils.h5_lock
3031
import h5py
3132
import numpy as np
3233

3334
from labscript_utils.ls_zprocess import ProcessTree, zmq_push_multipart
3435
from labscript_utils.labconfig import LabConfig
36+
import labscript_utils.shot_utils
3537
process_tree = ProcessTree.instance()
3638

3739
from .__version__ import __version__
@@ -915,24 +917,16 @@ def compile_labscript_with_globals_files_async(labscript_file, globals_files, ou
915917
def get_shot_globals(filepath):
916918
"""Returns the evaluated globals for a shot, for use by labscript or lyse.
917919
Simple dictionary access as in dict(h5py.File(filepath).attrs) would be fine
918-
except we want to apply some hacks, so it's best to do that in one place."""
919-
params = {}
920-
with h5py.File(filepath, 'r') as f:
921-
for name, value in f['globals'].attrs.items():
922-
# Convert numpy bools to normal bools:
923-
if isinstance(value, np.bool_):
924-
value = bool(value)
925-
# Convert null HDF references to None:
926-
if isinstance(value, h5py.Reference) and not value:
927-
value = None
928-
# Convert numpy strings to Python ones.
929-
# DEPRECATED, for backward compat with old files.
930-
if isinstance(value, np.str_):
931-
value = str(value)
932-
if isinstance(value, bytes):
933-
value = value.decode()
934-
params[name] = value
935-
return params
920+
except we want to apply some hacks, so it's best to do that in one place.
921+
922+
Deprecated: use identical function `labscript_utils.shot_utils.get_shot_globals`
923+
"""
924+
925+
warnings.warn(
926+
FutureWarning("get_shot_globals has moved to labscript_utils.shot_utils. "
927+
"Please update your code to import it from there."))
928+
929+
return labscript_utils.shot_utils.get_shot_globals(filepath)
936930

937931

938932
def dict_diff(dict1, dict2):

runmanager/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import importlib_metadata
77

88
VERSION_SCHEME = {
9-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
9+
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"),
1010
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
1111
}
1212

setup.cfg

+4-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install_requires =
3131
desktop-app>=0.1.2
3232
importlib_metadata
3333
labscript>=3.0.0
34-
labscript_utils>=3.0.0
34+
labscript_utils>=3.3.0
3535
pandas>=0.13
3636
qtutils>=2.2.2
3737
matplotlib
@@ -46,8 +46,6 @@ gui_scripts =
4646
pyqt = PyQt5
4747
docs =
4848
PyQt5
49-
Sphinx==4.4.0
50-
sphinx-rtd-theme==0.5.2
51-
recommonmark==0.6.0
52-
m2r==0.2.1
53-
mistune<2.0.0
49+
Sphinx==7.2.6
50+
sphinx-rtd-theme==2.0.0
51+
myst_parser==2.0.0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup
33

44
VERSION_SCHEME = {
5-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
5+
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"),
66
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
77
}
88

0 commit comments

Comments
 (0)