Git Product home page Git Product logo

build-and-inspect-python-package's Introduction

build-and-inspect-python-package

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 build are in good shape and remain so:

Builds your package using PyPA's build (this works with any PEP 517-compatible build backend, including Hatch, Flit, Setuptools, PDM, or Poetry).

Uploads the built 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 run.

Lints the wheel contents using check-wheel-contents.

Lints the PyPI README using twine and uploads it as an GitHub Actions artifact for further inspection. To level up your PyPI README game, check out hatch-fancy-pypi-readme!

Prints the tree of both SDist and wheel in the CI output, so you don't have to download the packages, if you just want to check the content list.

Prints and uploads the packaging metadata as a GitHub Actions artifact.


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.

Usage

jobs:
  check-package:
    name: Build & inspect our package.
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      - uses: hynek/build-and-inspect-python-package@v1

The action will run setup-python with Python 3.10 on its own.

Inputs

  • path: the location of the Python package to build (optional, default: .).

Outputs

  • dist: the location with the built packages.

    See for example how argon2-cffi-bindings uses this feature to check the built wheels don't break a dependency.

Artifacts

After a successful run, you'll find multiple artifacts in the run's Summary view:

  • Packages: the built packages.
  • Package Metadata: the extracted packaging metadata (hint: it's formatted as an email).
  • PyPI README: the extracted PyPI README, exactly how it would be used by PyPI as your project's landing page. PEP 621 calls it readme, in classic setuptools it's long_description.

Our CI uses all inputs and outputs, if you want to see them in action.

License

The scripts and documentation in this project are released under the MIT License.

build-and-inspect-python-package's People

Contributors

hynek avatar github-actions[bot] avatar offbyone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.