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-44569: v27 release notes #109

Merged
merged 9 commits into from
May 29, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything for the git tags.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -31,25 +31,28 @@ jobs:
run: sudo apt-get install libyaml-dev

- name: Install prereqs for setuptools
run: pip install wheel
run: |
pip install uv
uv pip install --system wheel

- name: Install dependencies
run: pip install -r requirements.txt
run: uv pip install --system -r requirements.txt

# We have two cores so we can speed up the testing with xdist
- name: Install support package for pytest
run: pip install pytest-xdist pytest-openfiles pytest-cov
run: uv pip install --system pytest pytest-xdist pytest-cov

- name: Build and install
run: pip install --no-deps -v .
run: uv pip install --system --no-deps -v .

- name: Run tests
run: pytest -r a -v -n 3 --open-files --cov=tests --cov=lsst.pex.config --cov-report=xml --cov-report=term
run: pytest -r a -v -n 3 --cov=tests --cov=lsst.pex.config --cov-report=xml --cov-report=term

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

pypi:

Expand All @@ -58,13 +61,13 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
build_sphinx_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything to determine version from git.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docstyle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
numpydoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5

- name: Install numpydoc
run: |
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.12.0
rev: 24.4.2
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -20,15 +20,15 @@ repos:
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.8
rev: v0.4.6
hooks:
- id: ruff
- repo: https://github.com/numpy/numpydoc
rev: "v1.6.0"
rev: "v1.7.0"
hooks:
- id: numpydoc-validation
16 changes: 11 additions & 5 deletions doc/lsst.pex.config/CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
lsst-pex-config v27.0.0 (2024-05-29)
====================================

- Improved all docstrings to make them compliant with Numpydoc.
- Minor code cleanups driven by Ruff linting. (`DM-42116 <https://rubinobs.atlassian.net/browse/DM-42116>`_)

lsst-pex-config v26.0.0 (2023-09-22)
====================================

New Features
------------

- Added a dynamic-default callback argument to ``RegistryField``. (`DM-31924 <https://jira.lsstcorp.org/browse/DM-31924>`_)
- Introduced ``ConfigurableActions``. These are ``pex_config`` fields and config types which function as a functor, state is set at config time, but the ``ConfigurableActions`` are callable at runtime to produce an action. (`DM-36649 <https://jira.lsstcorp.org/browse/DM-36649>`_)
- Added a dynamic-default callback argument to ``RegistryField``. (`DM-31924 <https://rubinobs.atlassian.net/browse/DM-31924>`_)
- Introduced ``ConfigurableActions``. These are ``pex_config`` fields and config types which function as a functor, state is set at config time, but the ``ConfigurableActions`` are callable at runtime to produce an action. (`DM-36649 <https://rubinobs.atlassian.net/browse/DM-36649>`_)


API Changes
-----------

- The ``loadFromStream`` and ``loadFromString`` methods now take a dictionary as an optional argument which allows specifying additional variables to use in local scope when reading configs. (`DM-40198 <https://jira.lsstcorp.org/browse/DM-40198>`_)
- The ``loadFromStream`` and ``loadFromString`` methods now take a dictionary as an optional argument which allows specifying additional variables to use in local scope when reading configs. (`DM-40198 <https://rubinobs.atlassian.net/browse/DM-40198>`_)


Other Changes and Additions
---------------------------

- There is now a requirement for configuration parameters to have a non-empty docstring. (`DM-4037 <https://jira.lsstcorp.org/browse/DM-4037>`_)
- There is now a requirement for configuration parameters to have a non-empty docstring. (`DM-4037 <https://rubinobs.atlassian.net/browse/DM-4037>`_)


lsst-pex-config v25.0.0 (2023-02-28)
Expand All @@ -26,7 +32,7 @@ lsst-pex-config v25.0.0 (2023-02-28)
Other Changes and Additions
---------------------------

- Some sorting now happens when saving config files (via DM-33027). (`DM-35060 <https://jira.lsstcorp.org/browse/DM-35060>`_)
- Some sorting now happens when saving config files (via DM-33027). (`DM-35060 <https://rubinobs.atlassian.net/browse/DM-35060>`_)


lsst-pex-config v24.0.0 (2022-08-30)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lsst-pex-config"
requires-python = ">=3.10.0"
description = "A flexible configuration system using Python files."
license = {text = "BSD 3-Clause License, GPLv3+"}
readme = "README.rst"
Expand All @@ -18,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Astronomy",
]
keywords = ["lsst"]
Expand Down Expand Up @@ -63,7 +65,7 @@ line_length = 110
filename = "doc/lsst.pex.config/CHANGES.rst"
directory = "doc/changes"
title_format = "lsst-pex-config {version} ({project_date})"
issue_format = "`{issue} <https://jira.lsstcorp.org/browse/{issue}>`_"
issue_format = "`{issue} <https://rubinobs.atlassian.net/browse/{issue}>`_"

[[tool.towncrier.type]]
directory = "feature"
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 @@ -716,14 +716,12 @@ def toDict(self, instance):
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> Field[FieldTypeVar]:
...
) -> Field[FieldTypeVar]: ...

@overload
def __get__(
self, instance: Config, owner: Any = None, at: Any = None, label: str = "default"
) -> FieldTypeVar:
...
) -> FieldTypeVar: ...

def __get__(self, instance, owner=None, at=None, label="default"):
"""Define how attribute access should occur on the Config instance
Expand Down
6 changes: 2 additions & 4 deletions python/lsst/pex/config/configChoiceField.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,12 @@ def _getOrMake(self, instance, label="default"):
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigChoiceField:
...
) -> ConfigChoiceField: ...

@overload
def __get__(
self, instance: Config, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigInstanceDict:
...
) -> ConfigInstanceDict: ...

def __get__(self, instance, owner=None, at=None, label="default"):
if instance is None or not isinstance(instance, Config):
Expand Down
6 changes: 2 additions & 4 deletions python/lsst/pex/config/configField.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ def __init__(self, doc, dtype=None, default=None, check=None, deprecated=None):
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> "ConfigField[FieldTypeVar]":
...
) -> "ConfigField[FieldTypeVar]": ...

@overload
def __get__(
self, instance: Config, owner: Any = None, at: Any = None, label: str = "default"
) -> FieldTypeVar:
...
) -> FieldTypeVar: ...

def __get__(self, instance, owner=None, at=None, label="default"):
if instance is None or not isinstance(instance, Config):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ def __set__(
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigurableActionField[ActionTypeVar]:
...
) -> ConfigurableActionField[ActionTypeVar]: ...

@overload
def __get__(self, instance: Config, owner: Any = None, at: Any = None, label: str = "default") -> Any:
...
def __get__(self, instance: Config, owner: Any = None, at: Any = None, label: str = "default") -> Any: ...

def __get__(self, instance, owner=None, at=None, label="default"):
result = super().__get__(instance, owner)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,12 @@ def __set__(
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigurableActionStruct[ActionTypeVar]:
...
) -> ConfigurableActionStruct[ActionTypeVar]: ...

@overload
def __get__(
self, instance: Config, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigurableActionStruct[ActionTypeVar]:
...
) -> ConfigurableActionStruct[ActionTypeVar]: ...

def __get__(self, instance, owner=None, at=None, label="default"):
if instance is None or not isinstance(instance, Config):
Expand Down
6 changes: 2 additions & 4 deletions python/lsst/pex/config/configurableField.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,12 @@ def __getOrMake(self, instance, at=None, label="default"):
@overload
def __get__(
self, instance: None, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigurableField:
...
) -> ConfigurableField: ...

@overload
def __get__(
self, instance: Config, owner: Any = None, at: Any = None, label: str = "default"
) -> ConfigurableInstance[FieldTypeVar]:
...
) -> ConfigurableInstance[FieldTypeVar]: ...

def __get__(self, instance, owner=None, at=None, label="default"):
if instance is None or not isinstance(instance, Config):
Expand Down
12 changes: 4 additions & 8 deletions python/lsst/pex/config/listField.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def __len__(self):
@overload
def __setitem__(
self, i: int, x: FieldTypeVar, at: Any = None, label: str = "setitem", setHistory: bool = True
) -> None:
...
) -> None: ...

@overload
def __setitem__(
Expand All @@ -155,8 +154,7 @@ def __setitem__(
at: Any = None,
label: str = "setitem",
setHistory: bool = True,
) -> None:
...
) -> None: ...

def __setitem__(self, i, x, at=None, label="setitem", setHistory=True):
if self._config._frozen:
Expand All @@ -179,12 +177,10 @@ def __setitem__(self, i, x, at=None, label="setitem", setHistory=True):
self.history.append((list(self._list), at, label))

@overload
def __getitem__(self, i: int) -> FieldTypeVar:
...
def __getitem__(self, i: int) -> FieldTypeVar: ...

@overload
def __getitem__(self, i: slice) -> MutableSequence[FieldTypeVar]:
...
def __getitem__(self, i: slice) -> MutableSequence[FieldTypeVar]: ...

def __getitem__(self, i):
return self._list[i]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[flake8]
max-line-length = 110
max-doc-length = 79
ignore = W503, E203, E228, N802, N803, N806, N812, N815, N816
ignore = W503, E203, E704, N802, N803, N806, N812, N815, N816
exclude =
bin,
doc,
Expand Down
Loading