Skip to content

Commit

Permalink
Declare packaging extra for coverage; bump minimum Python
Browse files Browse the repository at this point in the history
  • Loading branch information
tcjennings committed Dec 16, 2024
1 parent 26df69f commit 5b10c89
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/changes/DM-47159.bugfix.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Makes coverage package optional and lazy-loads it only when needed.
Declares packaging extra for coverage, i.e., `pip install lsst-ctrl-mpexec[coverage]`.
Updates minimum supported Python to 3.11 (dependency-driven change).
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lsst-ctrl-mpexec"
requires-python = ">=3.10.0"
requires-python = ">=3.11.0"
description = "Pipeline execution infrastructure for the Rubin Observatory LSST Science Pipelines."
license = {text = "BSD 3-Clause License"}
readme = "README.rst"
Expand All @@ -16,8 +16,9 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Astronomy",
]
keywords = ["lsst"]
Expand All @@ -38,6 +39,7 @@ dynamic = ["version"]
"Homepage" = "https://github.com/lsst/ctrl_mpexec"

[project.optional-dependencies]
coverage = ["coverage"]
test = ["pytest >= 3.2"]

[tool.setuptools.packages.find]
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/ctrl/mpexec/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ def coverage_context(kwargs: dict[str, Any]) -> Iterator[None]:
try:
import coverage
except ModuleNotFoundError:
raise click.ClickException(
"coverage was requested but the coverage package is not installed."
)
raise click.ClickException("coverage was requested but the coverage package is not installed.")

Check warning on line 151 in python/lsst/ctrl/mpexec/cli/cmd/commands.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/mpexec/cli/cmd/commands.py#L148-L151

Added lines #L148 - L151 were not covered by tests
with NamedTemporaryFile("w") as rcfile:
rcfile.write(
"""
Expand Down
4 changes: 3 additions & 1 deletion python/lsst/ctrl/mpexec/cli/opt/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
"--debug", help="Enable debugging output using lsstDebug facility (imports debug.py).", is_flag=True
)

coverage_option = MWOptionDecorator("--coverage", help="Enable coverage output.", is_flag=True)
coverage_option = MWOptionDecorator(
"--coverage", help="Enable coverage output (requires coverage package).", is_flag=True
)

coverage_report_option = MWOptionDecorator(
"--cov-report/--no-cov-report",
Expand Down

0 comments on commit 5b10c89

Please sign in to comment.