Skip to content

Commit fc67f41

Browse files
authored
Merge branch 'main' into ci/precommit
2 parents 5cedd33 + eb34275 commit fc67f41

File tree

12 files changed

+199
-141
lines changed

12 files changed

+199
-141
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1f423a22d8b27926da7d7b7393c833da0f3714a4

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ updates:
66
interval: "monthly"
77
labels:
88
- "type: Maintenance"
9+
groups:
10+
actions:
11+
patterns:
12+
- "*"
913
- package-ecosystem: "pip"
1014
directory: "/"
1115
schedule:
1216
interval: "monthly"
1317
labels:
1418
- "type: Maintenance"
19+
groups:
20+
actions:
21+
patterns:
22+
- "*"

.github/workflows/label-check.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ on:
44
pull_request:
55
types:
66
- opened
7+
- reopened
78
- labeled
89
- unlabeled
10+
- synchronize
911

1012
env:
1113
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}

.github/workflows/test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: test
22

3-
on: [push, pull_request]
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
48

59
jobs:
610
default:
@@ -9,7 +13,16 @@ jobs:
913
matrix:
1014
os: [ubuntu, macos, windows]
1115
python-version:
12-
["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9"]
16+
[
17+
"3.8",
18+
"3.9",
19+
"3.10",
20+
"3.11",
21+
"3.12",
22+
"3.13-dev",
23+
"pypy-3.8",
24+
"pypy-3.9",
25+
]
1326

1427
steps:
1528
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ci:
1212

1313
repos:
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
15+
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
1616
hooks:
1717
- id: trailing-whitespace
1818
- id: end-of-file-fixer
@@ -32,13 +32,14 @@ repos:
3232
files: \.(html|md|yml|yaml|toml)
3333
args: [--prose-wrap=preserve]
3434

35-
- repo: https://github.com/psf/black
36-
rev: 552baf822992936134cbd31a38f69c8cfe7c0f05 # frozen: 24.3.0
37-
hooks:
38-
- id: black
39-
4035
- repo: https://github.com/astral-sh/ruff-pre-commit
41-
rev: 0ccbb5b7942d83fbcf7cb5e0fd99633efd2351d7 # frozen: v0.3.5
36+
rev: 1dc9eb131c2ea4816c708e4d85820d2cc8542683 # frozen: v0.5.0
4237
hooks:
4338
- id: ruff
44-
args: [--fix, --exit-non-zero-on-fix]
39+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
40+
- id: ruff-format
41+
42+
- repo: https://github.com/codespell-project/codespell
43+
rev: "193cd7d27cd571f79358af09a8fb8997e54f8fff" # frozen: v2.3.0
44+
hooks:
45+
- id: codespell

CHANGELOG.md

Lines changed: 97 additions & 97 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[![PyPI](https://img.shields.io/pypi/v/lazy_loader)](https://pypi.org/project/lazy_loader/)
2-
[![Test status](https://github.com/scientific-python/lazy_loader/workflows/test/badge.svg?branch=main)](https://github.com/scientific-python/lazy_loader/actions?query=workflow%3A%22test%22)
3-
[![Test coverage](https://codecov.io/gh/scientific-python/lazy_loader/branch/main/graph/badge.svg)](https://app.codecov.io/gh/scientific-python/lazy_loader/branch/main)
1+
[![PyPI](https://img.shields.io/pypi/v/lazy-loader)](https://pypi.org/project/lazy-loader/)
2+
[![Test status](https://github.com/scientific-python/lazy-loader/workflows/test/badge.svg?branch=main)](https://github.com/scientific-python/lazy-loader/actions?query=workflow%3A%22test%22)
3+
[![Test coverage](https://codecov.io/gh/scientific-python/lazy-loader/branch/main/graph/badge.svg)](https://app.codecov.io/gh/scientific-python/lazy-loader/branch/main)
44

5-
`lazy_loader` makes it easy to load subpackages and functions on demand.
5+
`lazy-loader` makes it easy to load subpackages and functions on demand.
66

77
## Motivation
88

@@ -14,10 +14,10 @@ For a more detailed discussion, see [the SPEC](https://scientific-python.org/spe
1414
## Installation
1515

1616
```
17-
pip install -U lazy_loader
17+
pip install -U lazy-loader
1818
```
1919

20-
We recommend using `lazy_loader` with Python >= 3.11.
20+
We recommend using `lazy-loader` with Python >= 3.11.
2121
If using Python 3.11, please upgrade to 3.11.9 or later.
2222
If using Python 3.12, please upgrade to 3.12.3 or later.
2323
These versions [avoid](https://github.com/python/cpython/pull/114781) a [known race condition](https://github.com/python/cpython/issues/114763).

RELEASE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release process for `lazy_loader`
1+
# Release process for `lazy-loader`
22

33
## Introduction
44

@@ -17,7 +17,7 @@ Example `version number`
1717
export VERSION=<version number>
1818
export PREVIOUS=<previous version number>
1919
export ORG="scientific-python"
20-
export REPO="lazy_loader"
20+
export REPO="lazy-loader"
2121
export LOG="CHANGELOG.md"
2222

2323
- Autogenerate release notes
@@ -46,17 +46,17 @@ Example `version number`
4646

4747
git push --tags origin main
4848

49-
where `origin` is the name of the `github.com:scientific-python/lazy_loader`
49+
where `origin` is the name of the `github.com:scientific-python/lazy-loader`
5050
repository
5151

5252
- Create release from tag
5353

54-
- go to https://github.com/scientific-python/lazy_loader/releases/new?tag=v${VERSION}
54+
- go to https://github.com/scientific-python/lazy-loader/releases/new?tag=v${VERSION}
5555
- add v${VERSION} for the `Release title`
5656
- paste contents (or upload) of ${VERSION}.md in the `Describe this release section`
5757
- if pre-release check the box labelled `Set as a pre-release`
5858

59-
- Update https://github.com/scientific-python/lazy_loader/milestones:
59+
- Update https://github.com/scientific-python/lazy-loader/milestones:
6060

6161
- close old milestone
6262
- ensure new milestone exists (perhaps setting due date)

lazy_loader/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def attach(package_name, submodules=None, submod_attrs=None):
3838
The typical way to call this function, replacing the above imports, is::
3939
4040
__getattr__, __dir__, __all__ = lazy.attach(
41-
__name__,
42-
['mysubmodule', 'anothersubmodule'],
43-
{'foo': ['someattr']}
41+
__name__, ["mysubmodule", "anothersubmodule"], {"foo": ["someattr"]}
4442
)
4543
4644
Parameters
@@ -114,7 +112,7 @@ def __getattr__(self, x):
114112
fd = self.__frame_data
115113
raise ModuleNotFoundError(
116114
f"{self.__message}\n\n"
117-
"This error is lazily reported, having originally occured in\n"
115+
"This error is lazily reported, having originally occurred in\n"
118116
f' File {fd["filename"]}, line {fd["lineno"]}, in {fd["function"]}\n\n'
119117
f'----> {"".join(fd["code_context"] or "").strip()}'
120118
)
@@ -162,7 +160,7 @@ def myfunc():
162160
fullname : str
163161
The full name of the module or submodule to import. For example::
164162
165-
sp = lazy.load('scipy') # import scipy as sp
163+
sp = lazy.load("scipy") # import scipy as sp
166164
167165
require : str
168166
A dependency requirement as defined in PEP-508. For example::
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
def some_func():
22
"""Function with same name as submodule."""
3-
pass

0 commit comments

Comments
 (0)