Skip to content

python/sdist

Configure a job to build a source distribution for a Python project.

Description

This component creates a job that uses build to create a source distribution (tarball) for a Python project.

Usage

include:
  - component: git.ligo.org/computing/gitlab/components/python/sdist@<VERSION>

Inputs

Input Default value Description
job_name sdist The name to give the job.
image python Container image in which to build the sdist
python python Name/path of Python interpreter to use
stage build The pipeline stage to add jobs to
project_dir "." Python project root directory
build_options "" Extra options to pass to python-build

Customisation

The behaviour of the build tool should be customised via the pyproject.toml project configuration file.

Examples

Building a source distribution

Build a Python source distribution

include:
  - component: git.ligo.org/computing/gitlab/components/python/sdist@<VERSION>

Building multiple source distributions for a monrepo

For a GitLab project with multiple Python projects included as part of a monorepo, you can include the python/sdist multiple times with different inputs to build each subproject:

Build distributions for multiple subpackages in a monorepo

include:
  - component: git.ligo.org/computing/gitlab/components/python/sdist@<VERSION>
    inputs:
      job_name: sdist_package1
      project_dir: package1/
  - component: git.ligo.org/computing/gitlab/components/python/sdist@<VERSION>
    inputs:
      job_name: sdist_package2
      project_dir: package2/
  - component: git.ligo.org/computing/gitlab/components/python/sdist@<VERSION>
    inputs:
      job_name: sdist_package3
      project_dir: package3/