Skip to content

Commit f7815dc

Browse files
committed
Merge branch 'main' into fix-implicit-text-bytes
2 parents 078f8fa + 0bfd49c commit f7815dc

276 files changed

Lines changed: 2184 additions & 923 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/stalebot.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
if: github.repository == 'astropy/astropy'
1717
steps:
18-
- uses: pllim/action-astropy-stalebot@8a20289632f0d5068e9c129360b27b0a35e4d256 # main
18+
- uses: pllim/action-astropy-stalebot@f88727954277d4a1a2a8929eb399fe423db22a0d # main
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
STALEBOT_MAX_ISSUES: -1
2222
STALEBOT_MAX_PRS: -1
2323
STALEBOT_SLEEP: 10
24+
STALEBOT_KEEP_OPEN_LABEL: ''

‎.mailmap‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ Matthieu Baumann <[email protected]> <matthieu.baumann@astr
278278
Matthieu Bec <[email protected]>
279279
280280
Mavani Bhautik <[email protected]>
281+
Mayank Singh <[email protected]>
281282
Mengjia Shang <[email protected]>
282283
Michael Belfrage <[email protected]>
283284
Michael Brewer <[email protected]>

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ repos:
7575
- tomli
7676

7777
- repo: https://github.com/astral-sh/ruff-pre-commit
78-
rev: v0.15.20
78+
rev: v0.16.6
7979
hooks:
8080
- id: ruff-check
8181
args: ["--fix", "--show-fixes"]

‎.pyinstaller/run_astropy_tests.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"test_download_parallel_fills_cache",
113113
"test_defined_constants_do_not_change",
114114
"test_physical_constants_versions",
115+
"test_utc_conversion_does_not_update_erfa",
115116
]
116117

117118
# Run the tests!

‎.ruff.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ lint.ignore = [
2929
# TODO: configure maximum allowed complexity.
3030
"C901", # McCabeComplexity
3131

32+
# flake8-copyright
33+
"CPY001", # missing-copyright-notice
34+
3235
# pydocstyle (D)
3336
# Missing Docstrings
3437
"D100", # undocumented-public-module
@@ -246,6 +249,7 @@ lint.unfixable = [
246249
"astropy/io/fits/*" = [
247250
"B007", # UnusedLoopControlVariable
248251
"PLC0415", # import-outside-top-level
252+
"PLR0917", # max-positional-args
249253
"PT031", # pytest-warns-with-multiple-statements
250254
"PTH",
251255
]

‎astropy/config/configuration.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from typing import Final
2929
from warnings import warn
3030

31-
import configobj
31+
import configobj # type: ignore[import-untyped]
3232
import numpy as np
3333
from configobj import validate
3434

@@ -305,6 +305,8 @@ class _Conf(config.ConfigNamespace):
305305
Rootname sets the base path for all config files.
306306
"""
307307

308+
name: str # this attribute is set by the parent ConfigNamespace
309+
308310
def __init__(
309311
self, defaultvalue="", description=None, cfgtype=None, module=None, aliases=None
310312
):
@@ -599,13 +601,12 @@ def get_config(
599601
from cannot be determined.
600602
"""
601603
if packageormod is None:
602-
packageormod = find_current_module(2)
603-
if packageormod is None:
604+
if (mod := find_current_module(2)) is None:
604605
msg1 = "Cannot automatically determine get_config module, "
605606
msg2 = "because it is not called from inside a valid module"
606607
raise RuntimeError(msg1 + msg2)
607608
else:
608-
packageormod = packageormod.__name__
609+
packageormod = mod.__name__
609610

610611
_autopkg = True
611612

‎astropy/config/paths.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def name(self) -> str:
169169
case _SpecSource.XDG, _DirType.CONFIG:
170170
return "XDG_CONFIG_HOME"
171171
case _ as unreachable:
172-
assert_never(unreachable)
172+
# mypy doesn't narrow correctly here
173+
# other type checkers (ty, pyrefly) do
174+
assert_never(unreachable) # type: ignore[arg-type]
173175

174176
@property
175177
def value(self) -> str | None:
@@ -230,7 +232,9 @@ def find_directory_elements(self, namespace: str) -> _DirectoryElements:
230232
if self.envvars.astropy.is_defined() and ns.root == "astropy":
231233
match self.envvars.astropy.resolve():
232234
case Path() as base_node:
233-
return replace(de, base_node=base_node, sub_nodes=ns.fragments)
235+
return replace(
236+
de, base_node=base_node, sub_nodes=list(ns.fragments)
237+
)
234238
case str() as err:
235239
warn(err, AstropyUserWarning, stacklevel=2)
236240
case _ as unreachable:

‎astropy/config/py.typed‎

Whitespace-only changes.

‎astropy/config/tests/test_configs.py‎

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from astropy.utils.data import get_pkg_data_filename
3838
from astropy.utils.exceptions import AstropyDeprecationWarning, AstropyUserWarning
3939

40-
OLD_CONFIG = {}
40+
OLD_CONFIG = {} # type: ignore[var-annotated]
4141

4242

4343
def setup_module() -> None:
@@ -496,7 +496,7 @@ def test_set_temp_cache_resets_on_exception(tmp_path: Path) -> None:
496496

497497
@pytest.mark.usefixtures("ignore_config_paths_global_state")
498498
def test_config_file() -> None:
499-
from configobj import ConfigObj, Section
499+
from configobj import ConfigObj, Section # type: ignore[import-untyped]
500500

501501
from astropy.config.configuration import get_config, reload_config
502502

@@ -743,14 +743,10 @@ class Conf(ConfigNamespace):
743743
assert ci() == 34
744744

745745
# Test iterator for one-item namespace
746-
result = list(conf)
747-
assert result == ["tstnm"]
748-
result = list(conf.keys())
749-
assert result == ["tstnm"]
750-
result = list(conf.values())
751-
assert result == [ci]
752-
result = list(conf.items())
753-
assert result == [("tstnm", ci)]
746+
assert list(conf) == ["tstnm"]
747+
assert list(conf.keys()) == ["tstnm"]
748+
assert list(conf.values()) == [ci]
749+
assert list(conf.items()) == [("tstnm", ci)]
754750

755751

756752
def test_configitem_types() -> None:
@@ -785,12 +781,9 @@ class Conf(ConfigNamespace):
785781
# Test iterator for multi-item namespace. Assume ordered by insertion order.
786782
item_names = list(conf)
787783
assert item_names == ["tstnm1", "tstnm2", "tstnm3", "tstnm4"]
788-
result = list(conf.keys())
789-
assert result == item_names
790-
result = list(conf.values())
791-
assert result == [ci1, ci2, ci3, ci4]
792-
result = list(conf.items())
793-
assert result == [
784+
assert list(conf.keys()) == item_names
785+
assert list(conf.values()) == [ci1, ci2, ci3, ci4]
786+
assert list(conf.items()) == [
794787
("tstnm1", ci1),
795788
("tstnm2", ci2),
796789
("tstnm3", ci3),

‎astropy/constants/codata2010.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CODATA2010(Constant):
1616
_registry = {}
1717
_has_incompatible_units = set()
1818

19-
def __new__(
19+
def __new__( # ruff: ignore[PLR0917]
2020
cls,
2121
abbrev,
2222
name,

0 commit comments

Comments
 (0)