diff --git a/hyperion_other/workflows/pre_release_workflow.yml b/.github/workflows/pre_release_workflow.yml similarity index 100% rename from hyperion_other/workflows/pre_release_workflow.yml rename to .github/workflows/pre_release_workflow.yml diff --git a/.vscode/mx-bluesky.code-workspace b/.vscode/mx-bluesky.code-workspace index 917ea26af..4c58385b0 100644 --- a/.vscode/mx-bluesky.code-workspace +++ b/.vscode/mx-bluesky.code-workspace @@ -9,11 +9,12 @@ ], "settings": { "python.languageServer": "Pylance", + "terminal.integrated.gpuAcceleration": "off", + "esbonio.sphinx.confDir": "", "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" }, - "python.defaultInterpreterPath": ".venv/bin/python", - "terminal.integrated.gpuAcceleration": "off", - "esbonio.sphinx.confDir": "" + "python.formatting.provider": "none", + "python.analysis.enablePytestExtra": false } } diff --git a/hyperion_other/workflows/pin_versions.py b/hyperion_other/workflows/pin_versions.py index 26a0fba1c..b849732a5 100755 --- a/hyperion_other/workflows/pin_versions.py +++ b/hyperion_other/workflows/pin_versions.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 import argparse import locale import os @@ -7,17 +6,44 @@ from functools import partial from sys import stderr, stdout -SETUP_CFG_PATTERN = re.compile("(.*?\\S)\\s*(@(.*))?$") -SETUP_UNPINNED_PATTERN = re.compile("(.*?\\S)\\s*([<>=]+(.*))?$") +import requests + +PYPROJECT_TOML_PATTERN = re.compile("(.*?\\S)\\s*(@(.*))?$") +PYPROJECT_UNPINNED_PATTERN = re.compile("(.*?\\S)\\s*([<>=]+(.*))?$") PIP = "pip" def rename_original(suffix): - os.rename("setup.cfg", "setup.cfg" + suffix) + os.rename("pyproject.toml", "pyproject.toml" + suffix) def normalize(package_name: str): - return re.sub(r"[-_.]+", "-", package_name).lower() + # Replace underscore and dots with hyphen, and convert to lower case + package_name = re.sub(r"[-_.]+", "-", package_name).lower() + + package_name = package_name.replace('"', "") + package_name = package_name.replace(",", "") + + # Remove square brackets in pip freeze, eg "fastapi[all]"" to "fastapi" + package_name = re.sub(r"\[.*\]$", "", package_name) + print(package_name) + return package_name + + +# Returns latest version of dodal by looking at most recent tag on github +def _get_dodal_version() -> str: + url = "https://api.github.com/repos/DiamondLightSource/dodal/tags" + response = requests.get(url) + + if response.status_code == 200: + tags = response.json() + if tags: + return str(tags[0]["name"]) + else: + stderr.write("Unable to find latest dodal tag") + + stderr.write("Unable to find dodal on github") + raise Exception("Error finding the latest dodal version") def fetch_pin_versions() -> dict[str, str]: @@ -29,9 +55,18 @@ def fetch_pin_versions() -> dict[str, str]: for line in lines: kvpair = line.split("==") if len(kvpair) != 2: - stderr.write(f"Unable to parse {line} - ignored\n") + # mx_bluesky will appear as '-e git+ssh://git@github.com/DiamondLightSource/mx-bluesky', + # and same for dodal unless it has manually been pinned beforehand + if line and not ("dls_dodal" in line or "mx_bluesky" in line): + stderr.write( + f"Unable to parse {line} - make sure this dependancy isn't pinned to a git hash\n" + ) else: pin_versions[normalize(kvpair[0]).strip()] = kvpair[1].strip() + + # Handle dodal separately to save us from having to manually set it + pin_versions["dls-dodal"] = _get_dodal_version() + return pin_versions else: stderr.write(f"pip freeze failed with error code {process.returncode}\n") @@ -41,12 +76,14 @@ def fetch_pin_versions() -> dict[str, str]: def run_pip_freeze(): process = subprocess.run( - [PIP, "freeze"], capture_output=True, encoding=locale.getpreferredencoding() + [PIP, "list --format=freeze"], + capture_output=True, + encoding=locale.getpreferredencoding(), ) return process -def process_setup_cfg(input_fname, output_fname, dependency_processor): +def process_pyproject_toml(input_fname, output_fname, dependency_processor): with open(input_fname) as input_file: with open(output_fname, "w") as output_file: process_files(input_file, output_file, dependency_processor) @@ -55,9 +92,9 @@ def process_setup_cfg(input_fname, output_fname, dependency_processor): def process_files(input_file, output_file, dependency_processor): while line := input_file.readline(): output_file.write(line) - if line.startswith("install_requires"): + if line.startswith("dependencies"): break - while (line := input_file.readline()) and not line.startswith("["): + while (line := input_file.readline()) and not line.startswith("]"): if line.isspace(): output_file.write(line) else: @@ -79,9 +116,9 @@ def write_with_comment(comment, text, output_file): output_file.write("\n") -def update_setup_cfg_line(version_map: dict[str, str], line, output_file): +def update_pyproject_toml_line(version_map: dict[str, str], line, output_file): stripped_line, comment = strip_comment(line) - if match := SETUP_UNPINNED_PATTERN.match(stripped_line): + if match := PYPROJECT_UNPINNED_PATTERN.match(stripped_line): normalized_name = normalize(match[1].strip()) if normalized_name not in version_map: stderr.write( @@ -91,7 +128,7 @@ def update_setup_cfg_line(version_map: dict[str, str], line, output_file): write_with_comment( comment, - f" {normalized_name} == {version_map[normalized_name]}", + f' "{normalized_name} == {version_map[normalized_name]}",', output_file, ) else: @@ -105,32 +142,34 @@ def write_commit_message(pinned_versions: dict[str, str]): def unpin_versions(line, output_file): stripped_line, comment = strip_comment(line) - if match := SETUP_CFG_PATTERN.match(stripped_line): + if match := PYPROJECT_TOML_PATTERN.match(stripped_line): if match[3] and match[3].strip().startswith("git+"): - write_with_comment(comment, match[1], output_file) + write_with_comment(comment, match[1] + '",', output_file) return output_file.write(line) if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Pin dependency versions in setup.cfg") + parser = argparse.ArgumentParser( + description="Pin dependency versions in pyproject.toml" + ) parser.add_argument( "--unpin", - help="remove pinned hashes from setup.cfg prior to pip installing latest", + help="remove pinned hashes from pyproject.toml prior to pip installing latest", action="store_true", ) args = parser.parse_args() if args.unpin: rename_original(".orig") - process_setup_cfg("setup.cfg.orig", "setup.cfg", unpin_versions) + process_pyproject_toml("pyproject.toml.orig", "pyproject.toml", unpin_versions) else: rename_original(".unpinned") installed_versions = fetch_pin_versions() - process_setup_cfg( - "setup.cfg.unpinned", - "setup.cfg", - partial(update_setup_cfg_line, installed_versions), + process_pyproject_toml( + "pyproject.toml.unpinned", + "pyproject.toml", + partial(update_pyproject_toml_line, installed_versions), ) write_commit_message(installed_versions) diff --git a/hyperion_other/workflows/test_data/pip_freeze.txt b/hyperion_other/workflows/test_data/pip_freeze.txt index 8f9669f0b..567eda032 100644 --- a/hyperion_other/workflows/test_data/pip_freeze.txt +++ b/hyperion_other/workflows/test_data/pip_freeze.txt @@ -1,248 +1,8 @@ -accessible-pygments==0.0.4 -aioca==1.7 -aiohttp==3.9.1 -aiosignal==1.3.1 -alabaster==0.7.16 -aniso8601==9.0.1 -anyio==4.2.0 -appdirs==1.4.4 -asciitree==0.3.3 -asttokens==2.4.1 -async-timeout==4.0.3 -attrs==23.2.0 -Babel==2.14.0 -beautifulsoup4==4.12.3 -bidict==0.22.1 -black==24.1.0 -blinker==1.7.0 -blueapi==0.3.15 -bluesky==1.12.0 -bluesky-kafka==0.10.0 -bluesky-live==0.0.8 -boltons==23.1.1 -build==1.0.3 -cachetools==5.3.2 caproto==1.1.1 -certifi==2023.11.17 -cfgv==3.4.0 -chardet==5.2.0 -charset-normalizer==3.3.2 -click==8.1.3 -cloudpickle==3.0.0 -colorama==0.4.6 -comm==0.2.1 -confluent-kafka==2.3.0 -contourpy==1.2.0 -coverage==7.4.0 -cycler==0.12.1 -dask==2024.1.0 -databroker==1.2.5 -dataclasses-json==0.6.3 -decorator==5.1.1 -Deprecated==1.2.14 -diff_cover==8.0.3 -distlib==0.3.8 -dls-bluesky-core==0.0.3 -dls-dodal==1.13.1 -dnspython==2.5.0 -docopt==0.6.2 -doct==1.1.0 -docutils==0.20.1 -email-validator==2.1.0.post1 -entrypoints==0.4 -epicscorelibs==7.0.7.99.0.2 -event-model==1.19.9 -exceptiongroup==1.2.0 -executing==2.0.1 -fastapi==0.98.0 -fasteners==0.19 -filelock==3.13.1 -Flask==3.0.1 +annotated-types==0.7.0 +fastapi==0.99.1 Flask-RESTful==0.3.10 -fonttools==4.47.2 -freephil==0.2.1 -frozenlist==1.4.1 -fsspec==2023.12.2 -gitdb==4.0.11 -GitPython==3.1.41 -googleapis-common-protos==1.59.1 -graypy==2.1.0 -greenlet==3.0.3 -grpcio==1.60.0 -h11==0.14.0 -h5py==3.10.0 -hdf5plugin==4.3.0 -HeapDict==1.0.1 -historydict==1.2.6 -httpcore==1.0.2 -httptools==0.6.1 -httpx==0.26.0 -humanize==4.9.0 --e git+ssh://git@github.com/DiamondLightSource/hyperion.git@5b88ce8b69483397adb66f78da5970a5186fcae2#egg=hyperion -identify==2.5.33 -idna==3.6 -imageio==2.33.1 -imagesize==1.4.1 -importlib-metadata==6.11.0 -importlib-resources==6.1.1 -iniconfig==2.0.0 -intake==0.6.4 -ipython==8.20.0 -ipywidgets==8.1.1 -ispyb==10.0.0 -itsdangerous==2.1.2 -jedi==0.19.1 -Jinja2==3.1.3 -jsonschema==4.21.1 -jsonschema-specifications==2023.12.1 -jupyterlab-widgets==3.0.9 -kiwisolver==1.4.5 -livereload==2.6.3 -locket==1.0.0 -MarkupSafe==2.1.4 -marshmallow==3.20.2 -matplotlib==3.8.2 -matplotlib-inline==0.1.6 -mockito==1.4.0 -mongoquery==1.4.2 -msgpack==1.0.7 -msgpack-numpy==0.4.8 -multidict==6.0.4 -mypy==1.8.0 -mypy-extensions==1.0.0 -mysql-connector-python==8.3.0 -networkx==3.2.1 -nexgen==0.8.4 -nodeenv==1.8.0 -nose2==0.14.0 -nslsii==0.9.1 -numcodecs==0.12.1 -numpy==1.26.3 -opencv-python-headless==4.9.0.80 -opentelemetry-api==1.22.0 -opentelemetry-distro==0.43b0 -opentelemetry-exporter-jaeger==1.21.0 -opentelemetry-exporter-jaeger-proto-grpc==1.21.0 -opentelemetry-exporter-jaeger-thrift==1.21.0 -opentelemetry-instrumentation==0.43b0 -opentelemetry-sdk==1.22.0 -opentelemetry-semantic-conventions==0.43b0 -ophyd==1.9.0 -ophyd-async @ git+https://github.com/bluesky/ophyd-async@ec5729640041ee5b77b4614158793af3a34cf9d8 -orjson==3.9.12 -p4p==4.1.12 -packaging==23.2 -pandas==2.2.0 -parso==0.8.3 -partd==1.4.1 -pathlib2==2.3.7.post1 -pathspec==0.12.1 -pexpect==4.9.0 -pika==1.3.2 -pillow==10.2.0 -PIMS==0.6.1 -Pint==0.23 -pipdeptree==2.13.2 -platformdirs==4.1.0 -pluggy==1.4.0 -ply==3.11 -pre-commit==3.6.0 -prettytable==3.9.0 -prompt-toolkit==3.0.43 -protobuf==4.25.2 -psutil==5.9.8 -ptyprocess==0.7.0 -pure-eval==0.2.2 -pvxslibs==1.3.1 -py==1.11.0 -pydantic==1.10.14 -pydata-sphinx-theme==0.15.2 -pyepics==3.5.2 -Pygments==2.17.2 -pymongo==4.6.1 -pyOlog==4.5.0 -pyparsing==3.1.1 -pyproject-api==1.6.1 -pyproject_hooks==1.0.0 -pyright==1.1.348 -pyright_diff_quality_plugin @ git+https://github.com/DiamondLightSource/pyright_diff_quality_plugin.git@77fc0819e708eb16ffdcaea06552a2804294b53e -pytest==7.4.4 -pytest-asyncio==0.23.3 -pytest-cov==4.1.0 -pytest-random-order==1.1.1 -python-dateutil==2.8.2 -python-dotenv==1.0.1 -python-multipart==0.0.6 -pytz==2023.3.post1 -PyYAML==6.0.1 -pyzmq==25.1.2 -redis==5.0.1 -referencing==0.32.1 -requests==2.31.0 -rpds-py==0.17.1 -ruff==0.1.14 -scanspec==0.6.5 -scipy==1.12.0 semver==3.0.2 -setuptools-dso==2.10 -six==1.16.0 -slicerator==1.1.0 -smmap==5.0.1 -sniffio==1.3.0 -snowballstemmer==2.2.0 -soupsieve==2.5 -Sphinx==7.2.6 -sphinx-autobuild==2021.3.14 -sphinx-copybutton==0.5.2 -sphinx_design==0.5.0 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 -SQLAlchemy==1.4.51 -stack-data==0.6.3 -starlette==0.27.0 -stomp.py==8.1.0 -suitcase-mongo==0.4.0 -suitcase-msgpack==0.3.0 -suitcase-utils==0.5.4 -super-state-machine==2.0.2 -tabulate==0.9.0 -thrift==0.16.0 -tifffile==2023.12.9 -tomli==2.0.1 -toolz==0.12.1 -tornado==6.4 -tox==3.28.0 -tox-direct==0.4 -tqdm==4.66.1 -traitlets==5.14.1 -types-mock==5.1.0.20240106 -types-PyYAML==6.0.12.12 -types-requests==2.31.0.20240125 -typing-inspect==0.9.0 -typing_extensions==4.5.0 -tzdata==2023.4 -tzlocal==5.2 -ujson==5.9.0 -urllib3==2.1.0 -uvicorn==0.27.0 -uvloop==0.19.0 -virtualenv==20.25.0 -watchfiles==0.21.0 -wcwidth==0.2.13 -websocket-client==1.7.0 -websockets==12.0 -Werkzeug==3.0.1 -widgetsnbextension==4.0.9 -workflows==2.26 -wrapt==1.16.0 -xarray==2024.1.1 -yarl==1.9.4 -zarr==2.16.1 -zict==2.2.0 -zipp==3.17.0 -zmq==0.0.0 -zocalo==0.30.2 +blueapi==0.4.5a1 +nexgen==0.9.5 +-e git+ssh://git@github.com/DiamondLightSource/dodal.git@851a0027c2cdacb29f5060c33ac7e9d27aa99881#egg=dls_dodal diff --git a/hyperion_other/workflows/test_data/pyproject.toml b/hyperion_other/workflows/test_data/pyproject.toml new file mode 100644 index 000000000..984bc5755 --- /dev/null +++ b/hyperion_other/workflows/test_data/pyproject.toml @@ -0,0 +1,148 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm[toml]>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "mx-bluesky" +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +description = "Bluesky tools for MX Beamlines at DLS" +dependencies = [ + # + # If a constraint is not set here or if the dependency is pinned to a hash + # it will be auto-pinned to the latest release version by the pre-release workflow + # + "annotated-types", + "caproto", + "fastapi", + "flask-restful", + "semver", + # + # These dependencies may be issued as pre-release versions and should have a pin constraint + # as by default pip-install will not upgrade to a pre-release. + # + "blueapi == 0.4.5a1", + "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git", +] + +dynamic = ["version"] +license.file = "LICENSE" +readme = "README.rst" +requires-python = ">=3.10" + +[project.scripts] +mx-bluesky = "mx_bluesky.__main__:main" +run_extruder = "mx_bluesky.beamlines.i24.serial.run_serial:run_extruder" +run_fixed_target = "mx_bluesky.beamlines.i24.serial.run_serial:run_fixed_target" +hyperion = "mx_bluesky.hyperion.__main__:main" +hyperion-callbacks = "mx_bluesky.hyperion.external_interaction.callbacks.__main__:main" +hyperion-generate-test-nexus = "mx_bluesky.hyperion.utils.validation:generate_test_nexus" +hyperion-populate-test-and-meta-files = "mx_bluesky.hyperion.utils.validation:copy_test_meta_data_files" + +[project.urls] +GitHub = "https://github.com/DiamondLightSource/mx-bluesky" + +[[project.authors]] # Further authors may be added by duplicating this section +email = "dominic.oram@diamond.ac.uk" +name = "Dominic Oram" + + +[tool.setuptools_scm] +version_file = "src/mx_bluesky/_version.py" + +[tool.pyright] +reportMissingImports = false # Ignore missing stubs in imported modules + +[tool.pytest.ini_options] +# Run pytest with all our checkers, and don't spam us with massive tracebacks on error +asyncio_mode = "auto" +markers = [ + "s03: marks tests as requiring the s03 simulator running (deselect with '-m \"not s03\"')", + "dlstbx: marks tests as requiring dlstbx (deselect with '-m \"not dlstbx\"')", + "skip_log_setup: marks tests so that loggers are not setup before the test.", +] +addopts = """ + --tb=native -vv --doctest-modules --doctest-glob="*.rst" + """ +# https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings +filterwarnings = [ + "error", + # Ignore deprecation warning from zocalo (https://github.com/DiamondLightSource/python-zocalo/issues/256) + "ignore::DeprecationWarning:zocalo", + "ignore::DeprecationWarning:pkg_resources", + # Ignore incorrect errors from bluesky (remove when https://github.com/bluesky/bluesky/issues/1797 is released) + "ignore:((.|\n)*)was never iterated.*:RuntimeWarning", + # Ignore deprecation warning from sqlalchemy + "ignore::sqlalchemy.exc.MovedIn20Warning", + # Ignore deprecation warning from setuptools_dso (remove when https://github.com/epics-base/setuptools_dso/issues/36 is released) + "ignore::DeprecationWarning:wheel", + # Ophyd status objects in tests + "ignore:.*The 'done' and 'success' parameters will be removed.*:DeprecationWarning", + # Ignore nondeterministic closing of log, RE, etc. before test end + "ignore:(.*)unclosed file(.*)name='(.*)dodal.log'(.*):ResourceWarning", + "ignore:(.*)unclosed =64", "setuptools_scm[toml]>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "mx-bluesky" +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +description = "Bluesky tools for MX Beamlines at DLS" +dependencies = [ + # + # If a constraint is not set here or if the dependency is pinned to a hash + # it will be auto-pinned to the latest release version by the pre-release workflow + # + "annotated-types == 0.7.0", + "caproto == 1.1.1", + "fastapi == 0.99.1", + "flask-restful == 0.3.10", + "semver == 3.0.2", + # + # These dependencies may be issued as pre-release versions and should have a pin constraint + # as by default pip-install will not upgrade to a pre-release. + # + "blueapi == 0.4.5a1", + "dls-dodal == 1.30.0", +] + +dynamic = ["version"] +license.file = "LICENSE" +readme = "README.rst" +requires-python = ">=3.10" + +[project.scripts] +mx-bluesky = "mx_bluesky.__main__:main" +run_extruder = "mx_bluesky.beamlines.i24.serial.run_serial:run_extruder" +run_fixed_target = "mx_bluesky.beamlines.i24.serial.run_serial:run_fixed_target" +hyperion = "mx_bluesky.hyperion.__main__:main" +hyperion-callbacks = "mx_bluesky.hyperion.external_interaction.callbacks.__main__:main" +hyperion-generate-test-nexus = "mx_bluesky.hyperion.utils.validation:generate_test_nexus" +hyperion-populate-test-and-meta-files = "mx_bluesky.hyperion.utils.validation:copy_test_meta_data_files" + +[project.urls] +GitHub = "https://github.com/DiamondLightSource/mx-bluesky" + +[[project.authors]] # Further authors may be added by duplicating this section +email = "dominic.oram@diamond.ac.uk" +name = "Dominic Oram" + + +[tool.setuptools_scm] +version_file = "src/mx_bluesky/_version.py" + +[tool.pyright] +reportMissingImports = false # Ignore missing stubs in imported modules + +[tool.pytest.ini_options] +# Run pytest with all our checkers, and don't spam us with massive tracebacks on error +asyncio_mode = "auto" +markers = [ + "s03: marks tests as requiring the s03 simulator running (deselect with '-m \"not s03\"')", + "dlstbx: marks tests as requiring dlstbx (deselect with '-m \"not dlstbx\"')", + "skip_log_setup: marks tests so that loggers are not setup before the test.", +] +addopts = """ + --tb=native -vv --doctest-modules --doctest-glob="*.rst" + """ +# https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings +filterwarnings = [ + "error", + # Ignore deprecation warning from zocalo (https://github.com/DiamondLightSource/python-zocalo/issues/256) + "ignore::DeprecationWarning:zocalo", + "ignore::DeprecationWarning:pkg_resources", + # Ignore incorrect errors from bluesky (remove when https://github.com/bluesky/bluesky/issues/1797 is released) + "ignore:((.|\n)*)was never iterated.*:RuntimeWarning", + # Ignore deprecation warning from sqlalchemy + "ignore::sqlalchemy.exc.MovedIn20Warning", + # Ignore deprecation warning from setuptools_dso (remove when https://github.com/epics-base/setuptools_dso/issues/36 is released) + "ignore::DeprecationWarning:wheel", + # Ophyd status objects in tests + "ignore:.*The 'done' and 'success' parameters will be removed.*:DeprecationWarning", + # Ignore nondeterministic closing of log, RE, etc. before test end + "ignore:(.*)unclosed file(.*)name='(.*)dodal.log'(.*):ResourceWarning", + "ignore:(.*)unclosed =64", "setuptools_scm[toml]>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "mx-bluesky" +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +description = "Bluesky tools for MX Beamlines at DLS" +dependencies = [ + # + # If a constraint is not set here or if the dependency is pinned to a hash + # it will be auto-pinned to the latest release version by the pre-release workflow + # + "annotated-types", + "caproto", + "fastapi", + "flask-restful", + "semver", + # + # These dependencies may be issued as pre-release versions and should have a pin constraint + # as by default pip-install will not upgrade to a pre-release. + # + "blueapi == 0.4.5a1", + "dls-dodal", +] + +dynamic = ["version"] +license.file = "LICENSE" +readme = "README.rst" +requires-python = ">=3.10" + +[project.scripts] +mx-bluesky = "mx_bluesky.__main__:main" +run_extruder = "mx_bluesky.beamlines.i24.serial.run_serial:run_extruder" +run_fixed_target = "mx_bluesky.beamlines.i24.serial.run_serial:run_fixed_target" +hyperion = "mx_bluesky.hyperion.__main__:main" +hyperion-callbacks = "mx_bluesky.hyperion.external_interaction.callbacks.__main__:main" +hyperion-generate-test-nexus = "mx_bluesky.hyperion.utils.validation:generate_test_nexus" +hyperion-populate-test-and-meta-files = "mx_bluesky.hyperion.utils.validation:copy_test_meta_data_files" + +[project.urls] +GitHub = "https://github.com/DiamondLightSource/mx-bluesky" + +[[project.authors]] # Further authors may be added by duplicating this section +email = "dominic.oram@diamond.ac.uk" +name = "Dominic Oram" + + +[tool.setuptools_scm] +version_file = "src/mx_bluesky/_version.py" + +[tool.pyright] +reportMissingImports = false # Ignore missing stubs in imported modules + +[tool.pytest.ini_options] +# Run pytest with all our checkers, and don't spam us with massive tracebacks on error +asyncio_mode = "auto" +markers = [ + "s03: marks tests as requiring the s03 simulator running (deselect with '-m \"not s03\"')", + "dlstbx: marks tests as requiring dlstbx (deselect with '-m \"not dlstbx\"')", + "skip_log_setup: marks tests so that loggers are not setup before the test.", +] +addopts = """ + --tb=native -vv --doctest-modules --doctest-glob="*.rst" + """ +# https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings +filterwarnings = [ + "error", + # Ignore deprecation warning from zocalo (https://github.com/DiamondLightSource/python-zocalo/issues/256) + "ignore::DeprecationWarning:zocalo", + "ignore::DeprecationWarning:pkg_resources", + # Ignore incorrect errors from bluesky (remove when https://github.com/bluesky/bluesky/issues/1797 is released) + "ignore:((.|\n)*)was never iterated.*:RuntimeWarning", + # Ignore deprecation warning from sqlalchemy + "ignore::sqlalchemy.exc.MovedIn20Warning", + # Ignore deprecation warning from setuptools_dso (remove when https://github.com/epics-base/setuptools_dso/issues/36 is released) + "ignore::DeprecationWarning:wheel", + # Ophyd status objects in tests + "ignore:.*The 'done' and 'success' parameters will be removed.*:DeprecationWarning", + # Ignore nondeterministic closing of log, RE, etc. before test end + "ignore:(.*)unclosed file(.*)name='(.*)dodal.log'(.*):ResourceWarning", + "ignore:(.*)unclosed