Package

This job packages the Python source code as a source package (*.tar.gz) and wheel package (*.whl) and uploads it as an artifact.

Instantiation

Simple Example

jobs:
  Package:
    uses: pyTooling/Actions/.github/workflows/Package.yml@r5
    with:
      artifact: Package

Complex Example

jobs:
  Package:
    uses: pyTooling/Actions/.github/workflows/Package.yml@r5
    needs:
      - Params
    with:
      python_version: ${{ needs.Params.outputs.python_version }}
      requirements: -r build/requirements.txt
      artifact: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}

See also

PublishOnPyPI

Parameter Summary

Goto input parameters

Parameter Name

Required

Type

Default

ubuntu_image_version

no

string

'24.04'

python_version

no

string

'3.13'

requirements

no

string

''

artifact

yes

string

— — — —

Goto secrets

This job template needs no secrets.

Goto output parameters

This job template has no output parameters.

Input Parameters

ubuntu_image_version

Type:

string

Required:

no

Default Value:

'24.04'

Possible Values:

See actions/runner-images - Available Images for available Ubuntu image versions.

Description:

Version of the Ubuntu image used to run this job.

Note

Unfortunately, GitHub Actions has only a limited set of functions, thus, the usual Ubuntu image name like 'ubuntu-24.04' can’t be split into image name and image version.

python_version

Type:

string

Required:

no

Default Value:

'3.13'

Possible Values:

Any valid Python version conforming to the pattern <major>.<minor> or pypy-<major>.<minor>.
See actions/python-versions - available Python versions and actions/setup-python - configurable Python versions.

Description:

Python version used as default for other jobs requiring a single Python version.
In case python_version_list is an empty string, this version is used to populate the version list.

requirements

Type:

string

Required:

no

Default Value:

''

Possible Values:

Any valid list of parameters for pip install.
Either a requirements file can be referenced using '-r path/to/requirements.txt', or a list of packages can be specified using a space separated list like 'build wheel'.

Behavior:

If the value is an empty string, PyPI: build is used for packaging.
if the value is no-isolation, PyPI: build is used in no-isolation mode for packaging.
otherwise, a list of requirements is assumed and PyPI: setuptools is used for packaging.

Description:

Python dependencies to be installed through pip.

artifact

Type:

string

Required:

yes

Possible Values:

Any valid artifact name.

Description:

Name of the artifact containing the packaged Python code.

Secrets

This job template needs no secrets.

Outputs

This job template has no output parameters.

Optimizations

This template offers no optimizations (reduced job runtime).