Skip to content

Commit

Permalink
Print and upload metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 24, 2022
1 parent 82a53d1 commit b3a948b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/hynek/build-and-inspect-python-package/compare/v1.2...main)

### Added

- `PKG-INFO` / `METADATA` are now printed and uploaded as artifacts.


## [1.2](https://github.com/hynek/build-and-inspect-python-package/compare/v1.1...v1.2)

### Added
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
This action provides the following functionality for GitHub Actions users that are maintaining Python packages and want to ensure in CI that the packages they will build are in good shape and remain so:

1. Builds your package using PyPA's [*build*](https://pypi.org/project/build/) (this works with any [PEP 517](https://peps.python.org/pep-0517/)-compatible build backend, including *Hatch*, *Flit*, *Setuptools*, *PDM*, or *Poetry*),
1. uploads the *wheel* and the source distribution (*SDist*) as GitHub Actins artifacts (**not** PyPI) so you can download and inspect them from the Summary view of a Actions run,
1. uploads the *wheel* and the source distribution (*SDist*) as GitHub Actions artifacts (**not** PyPI) so you can download and inspect them from the Summary view of a Actions run,
1. lints the wheel using [*check-wheel-contents*](https://pypi.org/project/check-wheel-contents/),
1. lints the PyPI README of both *wheel* and *SDist* using [*twine*](https://pypi.org/project/twine/),
1. prints the tree of both *SDist* and *wheel* in the CI output, so you don't have to download the packages to just check the contents.
1. prints the tree of both *SDist* and *wheel* in the CI output, so you don't have to download the packages to just check the contents,
1. prints and uploads the *SDist*'s `PKG-INFO` file (that is also the `METADATA` file in each wheel) as GitHub Actions artifacts.

If you package an **application** as a Python package, this action is useful to double-check you're shipping everything you need, including all templates, translation files, et cetera.

Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ runs:
mkdir -p out/sdist
tar xf *.tar.gz -C out/sdist
tree -a out
- name: Show metadata
shell: bash
run: cat /tmp/baipp-out/sdist/*/PKG-INFO

- name: Upload PKG-INFO
uses: actions/upload-artifact@v3
with:
name: PKG-INFO
path: /tmp/baipp-out/sdist/*/PKG-INFO

0 comments on commit b3a948b

Please sign in to comment.