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

Use mdformat for MD files #113

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
rev: ffb6a759a979008c0e6dff86e39f4745a2d9eac4 # frozen: v3.1.0
hooks:
- id: prettier
files: \.(html|md|yml|yaml|toml)
files: \.(html|yml|yaml|toml)
args: [--prose-wrap=preserve]

- repo: https://github.com/psf/black
Expand All @@ -33,3 +33,11 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/executablebooks/mdformat
rev: 6c1288142f351100fb24babd44aedd20e1599e99 # frozen: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter
98 changes: 49 additions & 49 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We're happy to announce the release of lazy_loader 0.4!

## Bug Fixes

- Avoid exception when \_\_frame_data["code_context"] is None ([#83](https://github.com/scientific-python/lazy_loader/pull/83)).
- Avoid exception when `__frame_data["code_context"]` is None ([#83](https://github.com/scientific-python/lazy_loader/pull/83)).
- Make `lazy_load.load` partially thread-safe ([#90](https://github.com/scientific-python/lazy_loader/pull/90)).

## Documentation
Expand Down Expand Up @@ -73,14 +73,14 @@ duplicates._

**Merged pull requests:**

- Announce Python 3.12 support [\#63](https://github.com/scientific-python/lazy_loader/pull/63) ([jarrodmillman](https://github.com/jarrodmillman))
- Ignore B028 [\#62](https://github.com/scientific-python/lazy_loader/pull/62) ([jarrodmillman](https://github.com/jarrodmillman))
- Use dependabot to update requirements [\#61](https://github.com/scientific-python/lazy_loader/pull/61) ([jarrodmillman](https://github.com/jarrodmillman))
- Use dependabot to update GH actions [\#60](https://github.com/scientific-python/lazy_loader/pull/60) ([jarrodmillman](https://github.com/jarrodmillman))
- Use ruff [\#59](https://github.com/scientific-python/lazy_loader/pull/59) ([jarrodmillman](https://github.com/jarrodmillman))
- Update requirements [\#58](https://github.com/scientific-python/lazy_loader/pull/58) ([jarrodmillman](https://github.com/jarrodmillman))
- Warn and discourage lazy.load of subpackages [\#57](https://github.com/scientific-python/lazy_loader/pull/57) ([dschult](https://github.com/dschult))
- Test on Python 3.12.0-beta.2 [\#53](https://github.com/scientific-python/lazy_loader/pull/53) ([jarrodmillman](https://github.com/jarrodmillman))
- Announce Python 3.12 support [#63](https://github.com/scientific-python/lazy_loader/pull/63) ([jarrodmillman](https://github.com/jarrodmillman))
- Ignore B028 [#62](https://github.com/scientific-python/lazy_loader/pull/62) ([jarrodmillman](https://github.com/jarrodmillman))
- Use dependabot to update requirements [#61](https://github.com/scientific-python/lazy_loader/pull/61) ([jarrodmillman](https://github.com/jarrodmillman))
- Use dependabot to update GH actions [#60](https://github.com/scientific-python/lazy_loader/pull/60) ([jarrodmillman](https://github.com/jarrodmillman))
- Use ruff [#59](https://github.com/scientific-python/lazy_loader/pull/59) ([jarrodmillman](https://github.com/jarrodmillman))
- Update requirements [#58](https://github.com/scientific-python/lazy_loader/pull/58) ([jarrodmillman](https://github.com/jarrodmillman))
- Warn and discourage lazy.load of subpackages [#57](https://github.com/scientific-python/lazy_loader/pull/57) ([dschult](https://github.com/dschult))
- Test on Python 3.12.0-beta.2 [#53](https://github.com/scientific-python/lazy_loader/pull/53) ([jarrodmillman](https://github.com/jarrodmillman))

## [v0.2](https://github.com/scientific-python/lazy_loader/tree/v0.2)

Expand All @@ -95,79 +95,79 @@ see release notes for v0.2rc0 below for details.

**Closed issues:**

- Allow to not fail on stub attach in frozen apps [\#38](https://github.com/scientific-python/lazy_loader/issues/38)
- Stub files with absolute imports [\#36](https://github.com/scientific-python/lazy_loader/issues/36)
- Help to packaging Debian package [\#35](https://github.com/scientific-python/lazy_loader/issues/35)
- conda upload [\#33](https://github.com/scientific-python/lazy_loader/issues/33)
- Possible issues with partial lazy loading [\#32](https://github.com/scientific-python/lazy_loader/issues/32)
- Type hints/Mypy best practices? [\#28](https://github.com/scientific-python/lazy_loader/issues/28)
- Re-export non descendant attribute? [\#27](https://github.com/scientific-python/lazy_loader/issues/27)
- This is awesome [\#6](https://github.com/scientific-python/lazy_loader/issues/6)
- Allow to not fail on stub attach in frozen apps [#38](https://github.com/scientific-python/lazy_loader/issues/38)
- Stub files with absolute imports [#36](https://github.com/scientific-python/lazy_loader/issues/36)
- Help to packaging Debian package [#35](https://github.com/scientific-python/lazy_loader/issues/35)
- conda upload [#33](https://github.com/scientific-python/lazy_loader/issues/33)
- Possible issues with partial lazy loading [#32](https://github.com/scientific-python/lazy_loader/issues/32)
- Type hints/Mypy best practices? [#28](https://github.com/scientific-python/lazy_loader/issues/28)
- Re-export non descendant attribute? [#27](https://github.com/scientific-python/lazy_loader/issues/27)
- This is awesome [#6](https://github.com/scientific-python/lazy_loader/issues/6)

**Merged pull requests:**

- Add information that `pyi` files are used in runtime when use `attach\_stub` [\#47](https://github.com/scientific-python/lazy_loader/pull/47) ([Czaki](https://github.com/Czaki))
- Update tests to improve coverage [\#45](https://github.com/scientific-python/lazy_loader/pull/45) ([jarrodmillman](https://github.com/jarrodmillman))
- Use codecov GH action [\#44](https://github.com/scientific-python/lazy_loader/pull/44) ([jarrodmillman](https://github.com/jarrodmillman))
- Update year [\#43](https://github.com/scientific-python/lazy_loader/pull/43) ([jarrodmillman](https://github.com/jarrodmillman))
- Update GH actions [\#42](https://github.com/scientific-python/lazy_loader/pull/42) ([jarrodmillman](https://github.com/jarrodmillman))
- Update pre-commit [\#41](https://github.com/scientific-python/lazy_loader/pull/41) ([jarrodmillman](https://github.com/jarrodmillman))
- Update optional depedencies [\#40](https://github.com/scientific-python/lazy_loader/pull/40) ([jarrodmillman](https://github.com/jarrodmillman))
- Fix extension substitution to work with `\*.pyc` files [\#39](https://github.com/scientific-python/lazy_loader/pull/39) ([Czaki](https://github.com/Czaki))
- Sort returned \_\_all\_\_ [\#34](https://github.com/scientific-python/lazy_loader/pull/34) ([stefanv](https://github.com/stefanv))
- Add information that `pyi` files are used in runtime when use `attach\_stub` [#47](https://github.com/scientific-python/lazy_loader/pull/47) ([Czaki](https://github.com/Czaki))
- Update tests to improve coverage [#45](https://github.com/scientific-python/lazy_loader/pull/45) ([jarrodmillman](https://github.com/jarrodmillman))
- Use codecov GH action [#44](https://github.com/scientific-python/lazy_loader/pull/44) ([jarrodmillman](https://github.com/jarrodmillman))
- Update year [#43](https://github.com/scientific-python/lazy_loader/pull/43) ([jarrodmillman](https://github.com/jarrodmillman))
- Update GH actions [#42](https://github.com/scientific-python/lazy_loader/pull/42) ([jarrodmillman](https://github.com/jarrodmillman))
- Update pre-commit [#41](https://github.com/scientific-python/lazy_loader/pull/41) ([jarrodmillman](https://github.com/jarrodmillman))
- Update optional depedencies [#40](https://github.com/scientific-python/lazy_loader/pull/40) ([jarrodmillman](https://github.com/jarrodmillman))
- Fix extension substitution to work with `\*.pyc` files [#39](https://github.com/scientific-python/lazy_loader/pull/39) ([Czaki](https://github.com/Czaki))
- Sort returned \_\_all\_\_ [#34](https://github.com/scientific-python/lazy_loader/pull/34) ([stefanv](https://github.com/stefanv))

## [v0.1](https://github.com/scientific-python/lazy_loader/tree/v0.1) (2022-09-21)

[Full Changelog](https://github.com/scientific-python/lazy_loader/compare/v0.1rc3...v0.1)

**Merged pull requests:**

- Update classifiers [\#31](https://github.com/scientific-python/lazy_loader/pull/31) ([jarrodmillman](https://github.com/jarrodmillman))
- Update precommit hooks [\#30](https://github.com/scientific-python/lazy_loader/pull/30) ([jarrodmillman](https://github.com/jarrodmillman))
- Refer to SPEC for stub usage [\#29](https://github.com/scientific-python/lazy_loader/pull/29) ([stefanv](https://github.com/stefanv))
- Update classifiers [#31](https://github.com/scientific-python/lazy_loader/pull/31) ([jarrodmillman](https://github.com/jarrodmillman))
- Update precommit hooks [#30](https://github.com/scientific-python/lazy_loader/pull/30) ([jarrodmillman](https://github.com/jarrodmillman))
- Refer to SPEC for stub usage [#29](https://github.com/scientific-python/lazy_loader/pull/29) ([stefanv](https://github.com/stefanv))

## [v0.1rc3](https://github.com/scientific-python/lazy_loader/tree/v0.1rc3) (2022-08-29)

[Full Changelog](https://github.com/scientific-python/lazy_loader/compare/v0.1rc2...v0.1rc3)

**Merged pull requests:**

- Add test and coverage badges [\#26](https://github.com/scientific-python/lazy_loader/pull/26) ([jarrodmillman](https://github.com/jarrodmillman))
- Fix typos [\#25](https://github.com/scientific-python/lazy_loader/pull/25) ([jarrodmillman](https://github.com/jarrodmillman))
- Measure test coverage [\#23](https://github.com/scientific-python/lazy_loader/pull/23) ([jarrodmillman](https://github.com/jarrodmillman))
- Document release process [\#22](https://github.com/scientific-python/lazy_loader/pull/22) ([jarrodmillman](https://github.com/jarrodmillman))
- Add classifiers [\#21](https://github.com/scientific-python/lazy_loader/pull/21) ([jarrodmillman](https://github.com/jarrodmillman))
- Lint toml files [\#20](https://github.com/scientific-python/lazy_loader/pull/20) ([jarrodmillman](https://github.com/jarrodmillman))
- Test on more versions and platforms [\#19](https://github.com/scientific-python/lazy_loader/pull/19) ([jarrodmillman](https://github.com/jarrodmillman))
- Update GH actions [\#18](https://github.com/scientific-python/lazy_loader/pull/18) ([jarrodmillman](https://github.com/jarrodmillman))
- Split out linting CI from testing [\#17](https://github.com/scientific-python/lazy_loader/pull/17) ([jarrodmillman](https://github.com/jarrodmillman))
- Update precommit hooks [\#16](https://github.com/scientific-python/lazy_loader/pull/16) ([jarrodmillman](https://github.com/jarrodmillman))
- Specify lower bounds on dependencies [\#15](https://github.com/scientific-python/lazy_loader/pull/15) ([jarrodmillman](https://github.com/jarrodmillman))
- Lower min required Python version to 3.7 [\#14](https://github.com/scientific-python/lazy_loader/pull/14) ([donatasm](https://github.com/donatasm))
- feat: add attach_stub function to load imports from type stubs [\#10](https://github.com/scientific-python/lazy_loader/pull/10) ([tlambert03](https://github.com/tlambert03))
- Avoid conflicts when function is implemented in same-named submodule [\#9](https://github.com/scientific-python/lazy_loader/pull/9) ([stefanv](https://github.com/stefanv))
- DOC fix missing comma in usage example in README.md [\#7](https://github.com/scientific-python/lazy_loader/pull/7) ([adrinjalali](https://github.com/adrinjalali))
- Add test and coverage badges [#26](https://github.com/scientific-python/lazy_loader/pull/26) ([jarrodmillman](https://github.com/jarrodmillman))
- Fix typos [#25](https://github.com/scientific-python/lazy_loader/pull/25) ([jarrodmillman](https://github.com/jarrodmillman))
- Measure test coverage [#23](https://github.com/scientific-python/lazy_loader/pull/23) ([jarrodmillman](https://github.com/jarrodmillman))
- Document release process [#22](https://github.com/scientific-python/lazy_loader/pull/22) ([jarrodmillman](https://github.com/jarrodmillman))
- Add classifiers [#21](https://github.com/scientific-python/lazy_loader/pull/21) ([jarrodmillman](https://github.com/jarrodmillman))
- Lint toml files [#20](https://github.com/scientific-python/lazy_loader/pull/20) ([jarrodmillman](https://github.com/jarrodmillman))
- Test on more versions and platforms [#19](https://github.com/scientific-python/lazy_loader/pull/19) ([jarrodmillman](https://github.com/jarrodmillman))
- Update GH actions [#18](https://github.com/scientific-python/lazy_loader/pull/18) ([jarrodmillman](https://github.com/jarrodmillman))
- Split out linting CI from testing [#17](https://github.com/scientific-python/lazy_loader/pull/17) ([jarrodmillman](https://github.com/jarrodmillman))
- Update precommit hooks [#16](https://github.com/scientific-python/lazy_loader/pull/16) ([jarrodmillman](https://github.com/jarrodmillman))
- Specify lower bounds on dependencies [#15](https://github.com/scientific-python/lazy_loader/pull/15) ([jarrodmillman](https://github.com/jarrodmillman))
- Lower min required Python version to 3.7 [#14](https://github.com/scientific-python/lazy_loader/pull/14) ([donatasm](https://github.com/donatasm))
- feat: add attach_stub function to load imports from type stubs [#10](https://github.com/scientific-python/lazy_loader/pull/10) ([tlambert03](https://github.com/tlambert03))
- Avoid conflicts when function is implemented in same-named submodule [#9](https://github.com/scientific-python/lazy_loader/pull/9) ([stefanv](https://github.com/stefanv))
- DOC fix missing comma in usage example in README.md [#7](https://github.com/scientific-python/lazy_loader/pull/7) ([adrinjalali](https://github.com/adrinjalali))

## [v0.1rc2](https://github.com/scientific-python/lazy_loader/tree/v0.1rc2) (2022-03-10)

[Full Changelog](https://github.com/scientific-python/lazy_loader/compare/v0.1rc1...v0.1rc2)

**Merged pull requests:**

- Add contributor README [\#5](https://github.com/scientific-python/lazy_loader/pull/5) ([stefanv](https://github.com/stefanv))
- Simplify delayed exception handling and improve reporting [\#4](https://github.com/scientific-python/lazy_loader/pull/4) ([stefanv](https://github.com/stefanv))
- Add contributor README [#5](https://github.com/scientific-python/lazy_loader/pull/5) ([stefanv](https://github.com/stefanv))
- Simplify delayed exception handling and improve reporting [#4](https://github.com/scientific-python/lazy_loader/pull/4) ([stefanv](https://github.com/stefanv))

## [v0.1rc1](https://github.com/scientific-python/lazy_loader/tree/v0.1rc1) (2022-03-01)

[Full Changelog](https://github.com/scientific-python/lazy_loader/compare/v0.0...v0.1rc1)

**Closed issues:**

- Create package on pypi [\#1](https://github.com/scientific-python/lazy_loader/issues/1)
- Create package on pypi [#1](https://github.com/scientific-python/lazy_loader/issues/1)

**Merged pull requests:**

- Run pre-commit hooks [\#3](https://github.com/scientific-python/lazy_loader/pull/3) ([tupui](https://github.com/tupui))
- Add the packaging infrastructure [\#2](https://github.com/scientific-python/lazy_loader/pull/2) ([tupui](https://github.com/tupui))
- Run pre-commit hooks [#3](https://github.com/scientific-python/lazy_loader/pull/3) ([tupui](https://github.com/tupui))
- Add the packaging infrastructure [#2](https://github.com/scientific-python/lazy_loader/pull/2) ([tupui](https://github.com/tupui))

\* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_
File renamed without changes.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Motivation

1. Allow subpackages to be made visible to users without incurring import costs.
2. Allow external libraries to be imported only when used, improving import times.
1. Allow external libraries to be imported only when used, improving import times.

For a more detailed discussion, see [the SPEC](https://scientific-python.org/specs/spec-0001/).

Expand Down Expand Up @@ -140,9 +140,6 @@ the `np` module returned will raise an error on attribute access. Using
this feature is not all-or-nothing: One module may rely on one version of
numpy, while another module may not set any requirement.

_Note that the requirement must use the package [distribution name][] instead
of the module [import name][]. For example, the `pyyaml` distribution provides
_Note that the requirement must use the package [distribution name](https://packaging.python.org/en/latest/glossary/#term-Distribution-Package) instead
of the module [import name](https://packaging.python.org/en/latest/glossary/#term-Import-Package). For example, the `pyyaml` distribution provides
the `yaml` module for import._

[distribution name]: https://packaging.python.org/en/latest/glossary/#term-Distribution-Package
[import name]: https://packaging.python.org/en/latest/glossary/#term-Import-Package
57 changes: 37 additions & 20 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,74 @@ Example `version number`

- Set release variables:

export VERSION=<version number>
export PREVIOUS=<previous version number>
export ORG="scientific-python"
export REPO="lazy_loader"
export LOG="CHANGELOG.md"
```bash
export VERSION=<version number>
export PREVIOUS=<previous version number>
export ORG="scientific-python"
export REPO="lazy_loader"
export LOG="CHANGELOG.md"
```

- Autogenerate release notes

changelist ${ORG}/${REPO} v${PREVIOUS} main --version ${VERSION} --config pyproject.toml --out ${VERSION}.md
```bash
changelist ${ORG}/${REPO} v${PREVIOUS} main --version ${VERSION} --config pyproject.toml --out ${VERSION}.md
```

- Put the output of the above command at the top of `CHANGELOG.md`

cat ${VERSION}.md | cat - ${LOG} > temp && mv temp ${LOG}
```bash
cat ${VERSION}.md | cat - ${LOG} > temp && mv temp ${LOG}
```

- Update `version` in `lazy_loader/__init__.py`.

- Commit changes:

git add lazy_loader/__init__.py ${LOG}
git commit -m "Designate ${VERSION} release"
```bash
git add lazy_loader/__init__.py ${LOG}
git commit -m "Designate ${VERSION} release"
```

- Tag the release in git:

git tag -s v${VERSION} -m "signed ${VERSION} tag"
```bash
git tag -s v${VERSION} -m "signed ${VERSION} tag"
```

If you do not have a gpg key, use -u instead; it is important for
Debian packaging that the tags are annotated

- Push the new meta-data to github:

git push --tags origin main
```bash
git push --tags origin main
```

where `origin` is the name of the `github.com:scientific-python/lazy_loader`
repository

- Create release from tag

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

- add v${VERSION} for the `Release title`

- paste contents (or upload) of ${VERSION}.md in the `Describe this release section`

- if pre-release check the box labelled `Set as a pre-release`

- Update https://github.com/scientific-python/lazy_loader/milestones:

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

- Update `version` in `lazy_loader/__init__.py`.

- Commit changes:

git add lazy_loader/__init__.py
git commit -m 'Bump version'
git push origin main
```bash
git add lazy_loader/__init__.py
git commit -m 'Bump version'
git push origin main
```