Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CI/Python

This project contains GitLab CI templates and components that we can use in GitLab CI pipelines of Python projects.

[TOC]

Components

build-wheel

Component that builds a wheel and tarball for the given project (it runs python3 -m build) using the provided python-version. In addition, the component checks that the wheel does not contain the tests/ directory, and that the files with the files-not-in-dist regex pattern are not present either in the produced wheel or tarball.

Example:

include:
  - component: "gitlab.desy.de/fs-sc/ci/python/build-wheel@main"
    inputs:
      python-version: "3.10"
      files-not-in-dist: "(cspell|etc/|templates/)"

pre-commit

Component that runs pre-commit using the provided python-versions. You can install packages before pre-commit runs by providing install-commands a list of commands to execute. Typical install commands are python3 -m pip install <package> and apt-get install <package>.

Example:

include:
  - component: "gitlab.desy.de/fs-sc/ci/python/pre-commit@main"
    inputs:
      python-versions: ["3.10"]
      install-commands:
        - apt-get install -y --no-install-recommends libatomic1
        - python3 -m pip install mypy

publish-wheel

Component that publishes the wheel and tarball produced by the build-wheel component to PyPI using the provided python-version and pypi-api-token.

Example:

include:
  - component: "gitlab.desy.de/fs-sc/ci/python/publish-wheel@main"
    inputs:
      python-version: "3.10"
      pypi-api-token: "$PYPI_API_TOKEN"  # PYPI_API_TOKEN can be a GitLab CI variable.

pytest, pytest-tarball, pytest-wheel, pytest-with-coverage

The pytest component runs pytest using the provided python-versions and pytest-options. You can install packages before pytest runs by providing install-commands a list of commands to execute. Typical install commands are python3 -m pip install <package> and apt-get install <package>. You can also provide the CI job with services that will run Docker containers accessible from the tests.

Example:

include:
  - component: "gitlab.desy.de/fs-sc/ci/python/pytest@main"
    inputs:
      python-versions: ["3.10", "3.11", "3.12", "3.13", "3.14"]
      install-commands:
        - python3 -m pip install "${CI_PROJECT_DIR}[asapo,tests,zmq]"
      pytest-options: "-vv --log-cli-level=DEBUG"
      services:
        - name: gitlab.desy.de:5555/asapo/asapo/asapo-standalone-dev:latest

Similarly, the components pytest-tarball and pytest-wheel runs pytest respectively on the tarball and wheel produced by the build-wheel component.

The component pytest-with-coverage runs pytest with coverage and produces a JUnit XML test report. This component accepts a single python-version instead of several python-versions for the other components.

To avoid repeating the code between the includes of these components, we can extract a YAML anchor. For example:

.common_test_inputs: &common_test_inputs
  install-commands:
    - python3 -m pip install "${PACKAGE}[asapo,tests,zmq]"
  pytest-options: "-vv --log-cli-level=DEBUG"
  services:
    - name: gitlab.desy.de:5555/asapo/asapo/asapo-standalone-dev:latest

include:
  - component: "gitlab.desy.de/fs-sc/ci/python/build-wheel@main"
  - component: "gitlab.desy.de/fs-sc/ci/python/pytest@main"
    inputs:
      <<: *common_test_inputs
      python-versions: ["3.9"]
  - component: "gitlab.desy.de/fs-sc/ci/python/pytest-with-coverage@main"
    inputs:
      <<: *common_test_inputs
      python-version: "3.9"
  - component: "gitlab.desy.de/fs-sc/ci/python/pytest-wheel@main"
    inputs:
      <<: *common_test_inputs
      python-versions: ["3.9", "3.10", "3.11", "3.12"]
  - component: "gitlab.desy.de/fs-sc/ci/python/pytest-tarball@main"
    inputs:
      <<: *common_test_inputs
      python-versions: ["3.9"]

Metadata

Release files for desy-fssc-ci-python 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for desy-fssc-ci-python 0.1.0a2
File Size Uploaded Provenance Actions
desy_fssc_ci_python-0.1.0a2.tar.gz 6.9 kB Without provenance Details for desy_fssc_ci_python-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for desy-fssc-ci-python 0.1.0a2
File Interpreter ABI Platform Actions
desy_fssc_ci_python-0.1.0a2-py3-none-any.whl Python 3 none any Details for desy_fssc_ci_python-0.1.0a2-py3-none-any.whl

Total release size: 10.7 kB

Release files / desy_fssc_ci_python-0.1.0a2.tar.gz

Download URL desy_fssc_ci_python-0.1.0a2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
586bb400902cffa67a5afd4d683944b8cf55f4173070bb287a9e47f0e06158ed
BLAKE2b-256 checksum
How to use checksums
778d971aca14d90bc5da05818aed6343001db376fc77b9037f5433657a6a215c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.9

Release files / desy_fssc_ci_python-0.1.0a2-py3-none-any.whl

Download URL desy_fssc_ci_python-0.1.0a2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efff757eb2400d7aa57bab565896523413ace4c9386c518405e5b22da541db72
BLAKE2b-256 checksum
How to use checksums
226e4152f53fe894973d527abb8269f1f594be362d8428a93dd6191f17b2eec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.9

Security for desy-fssc-ci-python 0.1.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page