Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-37808: Update pre-commit dependencies #92

Merged
merged 5 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.8
language_version: python3.10
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion doc/lsst.pex.config/field-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Examples of `ChoiceField` and `ConfigField` and the use of the `Config` object's
.. code-block:: python

class InitialPsfConfig(pexConfig.Config):
"""A config that describes the initial PSF used
"""A config that describes the initial PSF used
for detection and measurement (before PSF
determination is done).
"""
Expand Down
2 changes: 1 addition & 1 deletion doc/lsst.pex.config/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Here is a config class that includes five fields:
.. code-block:: python

import lsst.pex.config as pexConfig

class IsrTaskConfig(pexConfig.Config):
doWrite = pexConfig.Field(
doc="Write output?",
Expand Down
2 changes: 1 addition & 1 deletion doc/lsst.pex.config/wrapping-cpp-control-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For example, here is a C++ control object:
struct FooControl {
LSST_CONTROL_FIELD(bar, int, "documentation for field 'bar'");
LSST_CONTROL_FIELD(baz, double, "documentation for field 'baz'");

FooControl() : bar(0), baz(0.0) {}
};

Expand Down
8 changes: 4 additions & 4 deletions doc/overview.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

\section secConfigIntro Overview

The lsst::pex::config package provides for configurations for the LSST
The lsst::pex::config package provides for configurations for the LSST
Data Management System.

Configurations are hierarchical trees of parameters used to control the
Expand Down Expand Up @@ -85,7 +85,7 @@ Configurations are *not* input data. They should not be used in place of functi
A Config subclass is instantiated to create a configuration object. If any default Field values need to be overridden, they can be set by assignment to the object's Field attributes (e.g. `config.param1 = 3.14`), often in a parent Config.setDefaults() method, or by loading from an external file. The code then uses the configuration values by accessing the object's Field attributes (e.g., `x = config.param1`).

The Config object can also be frozen; attempting to change the field
values of a frozen object will raise an exception. This is useful to
values of a frozen object will raise an exception. This is useful to
expose bugs that change configuration values after none should happen.

Finally, the contents of Config objects may easily be dumped, for
Expand Down Expand Up @@ -239,12 +239,12 @@ C++ control objects defined using the LSST_CONTROL_FIELD macro in lsst/pex/confi
struct FooControl {
LSST_CONTROL_FIELD(bar, int, "documentation for field 'bar'");
LSST_CONTROL_FIELD(baz, double, "documentation for field 'baz'");

FooControl() : bar(0), baz(0.0) {}
};
\endcode

Note that only bool, int, double, and std::string fields, along with std::list and std::vector containers of those types, are fully supported.
Note that only bool, int, double, and std::string fields, along with std::list and std::vector containers of those types, are fully supported.

Nested control objects are not supported.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ version = { attr = "lsst_versions.get_lsst_version" }

[tool.black]
line-length = 110
target-version = ["py38"]
target-version = ["py310"]

[tool.isort]
profile = "black"
Expand Down
6 changes: 2 additions & 4 deletions python/lsst/pex/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,7 @@ def __get__(self, instance, owner=None, at=None, label="default"):
return self
else:
raise AttributeError(
f"Config {instance} is missing "
"_storage attribute, likely"
" incorrectly initialized"
f"Config {instance} is missing _storage attribute, likely incorrectly initialized"
)

def __set__(
Expand Down Expand Up @@ -1690,7 +1688,7 @@ def _classFromPython(config_py):
if not matches:
first_line, second_line, _ = config_py.split("\n", 2)
raise ValueError(
"First two lines did not match expected form. Got:\n" f" - {first_line}\n" f" - {second_line}"
f"First two lines did not match expected form. Got:\n - {first_line}\n - {second_line}"
)

module_name = matches.group(1)
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/pex/config/configurableField.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def __reduce__(self):
raise UnexpectedProxyUsageError(
f"Proxy object for config field {self._field.name} cannot "
"be pickled; it should be converted to a normal `Config` instance "
f"via the `value` property before being assigned to other objects "
"via the `value` property before being assigned to other objects "
"or variables."
)

Expand Down Expand Up @@ -276,8 +276,8 @@ def validateTarget(self, target, ConfigClass):
raise AttributeError("'target' must define attribute 'ConfigClass'")
if not issubclass(ConfigClass, Config):
raise TypeError(
"'ConfigClass' is of incorrect type %s."
"'ConfigClass' must be a subclass of Config" % _typeStr(ConfigClass)
"'ConfigClass' is of incorrect type %s.'ConfigClass' must be a subclass of Config"
% _typeStr(ConfigClass)
)
if not hasattr(target, "__call__"):
raise ValueError("'target' must be callable")
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/pex/config/listField.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ def __init__(
raise ValueError("'maxLength' (%d) must be positive" % maxLength)
if minLength is not None and maxLength is not None and minLength > maxLength:
raise ValueError(
"'maxLength' (%d) must be at least"
" as large as 'minLength' (%d)" % (maxLength, minLength)
"'maxLength' (%d) must be at least as large as 'minLength' (%d)" % (maxLength, minLength)
)

if listCheck is not None and not hasattr(listCheck, "__call__"):
Expand Down