Skip to main content

Linux Foundation Release Engineering Tools

Project description

LF Tools UV

Source Code OpenSSF Scorecard License: EPL-1.0 PyPI TestPyPI CodeQL

This project's documentation is available on ReadTheDocs (RTD) and GitHub Pages:

LF Tools UV is a collection of scripts and utilities that are useful to Linux Foundation projects' CI and Releng related activities. We try to create these tools to be as generic as possible such that they are reusable in other CI environments.

CLI Interface

lftools-uv uses Typer as the CLI library. For CI/CD environments that require the previous Click-based output format, use LEGACY_CLI=1.

Installation

Using uv (Recommended)

This project uses uv for fast Python package management.

  1. Install uv:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Install lftools-uv:

    uv pip install lftools-uv
    
  3. Or install with all extras for development:

    uv pip install "lftools-uv[all]"
    

Using pip

pip install lftools-uv

Configuration

lftools uses configuration files in the standard ~/.config/lftools/ directory for Jenkins, OpenStack, and other service credentials.

Quick Setup

Use the setup helper to create example configuration files:

# Clone the repository first (if not already done)
git clone https://github.com/lfit/lftools-uv.git
cd lftools-uv

# Run the configuration setup helper
./scripts/setup-config.sh

This creates:

  • ~/.config/lftools/jenkins_job.ini - Jenkins server configurations
  • ~/.config/lftools/clouds.yaml - OpenStack cloud configurations

Manual Configuration

Create the configuration directory:

mkdir -p ~/.config/lftools

Copy and customize the example files:

# Jenkins configuration
cp etc/lftools/jenkins_job.ini.example ~/.config/lftools/jenkins_job.ini
# Edit with your Jenkins credentials

# OpenStack configuration
cp etc/lftools/clouds.yaml.example ~/.config/lftools/clouds.yaml
# Edit with your OpenStack credentials

Testing Configuration

Run functional tests to verify your setup:

# Test Jenkins connectivity
lftools jenkins -s onap-prod plugins list

# Test OpenStack connectivity
lftools openstack --os-cloud production image list

# Run all functional tests
./scripts/run_functional_tests.sh

Note: The functional tests include ONAP/ECOMPCI project defaults, so most tests will run without extra configuration. Out of 30 tests, typically 28+ pass with the built-in defaults.

For detailed configuration instructions, see: docs/configuration.md

Using uvx (Recommended for CI/CD)

uvx is ideal for CI/CD environments and one-off executions where you want to run lftools-uv without affecting the existing Python environment. It creates an isolated virtual environment for each execution, preventing dependency conflicts with other tools in your pipeline.

Basic Usage

Run lftools-uv commands directly without installation:

# Basic command execution
uvx lftools-uv version

# Run with help
uvx lftools-uv --help

Using Optional Dependencies

When using features that require optional dependencies (like LDAP or OpenStack), you need to specify the extras:

# For LDAP functionality - note the quotes to prevent shell expansion
uvx "lftools-uv[ldap]" ldap --help

# For OpenStack functionality
uvx "lftools-uv[openstack]" openstack --help

# Combined extras
uvx "lftools-uv[ldap,openstack]" --help

# All extras for full functionality
uvx "lftools-uv[all]" --help

Alternative uvx Syntax

You can also use the --from flag for clarity:

# Same as the above
uvx --from "lftools-uv[ldap]" lftools-uv ldap csv mygroup
uvx --from "lftools-uv[openstack]" lftools-uv openstack --help

CI/CD Pipeline Examples

GitHub Actions:

- name: Deploy artifacts with lftools-uv
  run: |
    uvx lftools-uv deploy nexus-zip \
      --nexus-url ${{ secrets.NEXUS_URL }} \
      --nexus-repo releases \
      ./artifacts/*.zip

GitLab CI:

deploy:
  script:
    - uvx "lftools-uv[all]" deploy logs --help
    - uvx lftools-uv sign sigul ./artifacts/

Jenkins Pipeline:

pipeline {
    agent any
    stages {
        stage('Deploy') {
            steps {
                sh 'uvx lftools-uv version'
                sh 'uvx "lftools-uv[ldap]" ldap csv project-committers'
            }
        }
    }
}

Benefits of uvx in CI/CD

  • Isolation: No interference with existing Python packages in the CI environment
  • Speed: Automatic caching of environments between runs
  • Consistency: Same tool version across different pipeline stages
  • No Setup: No need to manage virtual environments or installations
  • Clean: Environments are automatically cleaned up after execution

Development Setup

Prerequisites

  • Python 3.8+
  • uv (recommended) or pip

Quick Start with uv

  1. Clone the repository:

    git clone https://github.com/lfit/lftools-uv.git
    cd lftools-uv
    
  2. Install development dependencies:

    make install-dev
    # or manually:
    uv sync --extra dev --extra test --extra docs --extra ldap --extra openstack
    
  3. Run tests:

    make test
    # or manually:
    uv run pytest
    
  4. Format and lint code:

    make format
    make lint
    

Available Make Targets

  • make help - Show all available targets
  • make install - Install project dependencies
  • make install-dev - Install with all development dependencies
  • make test - Run tests
  • make lint - Run linting
  • make format - Format code
  • make build - Build package
  • make docs - Build documentation
  • make clean - Clean build artifacts
  • make all - Run full development pipeline

Ubuntu Dependencies

For development on Ubuntu, you may need:

  • build-essential
  • python3-dev
  • libldap2-dev
  • libsasl2-dev
  • libssl-dev

Repository Information

Development Repository

For development and testing, we maintain this project at:

  • Development: https://github.com/modeseven-lfit/lftools-uv.git

Production Repository

Once tested and approved, we publish releases from:

  • Production: https://github.com/lfit/lftools-uv.git

Local Git Setup

Configure your local git remote for the development repository:

git remote -v
# origin  https://github.com/modeseven-lfit/lftools-uv.git (fetch)
# origin  https://github.com/modeseven-lfit/lftools-uv.git (push)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lftools_uv-0.1.5.tar.gz (188.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lftools_uv-0.1.5-py3-none-any.whl (196.2 kB view details)

Uploaded Python 3

File details

Details for the file lftools_uv-0.1.5.tar.gz.

File metadata

  • Download URL: lftools_uv-0.1.5.tar.gz
  • Upload date:
  • Size: 188.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for lftools_uv-0.1.5.tar.gz
Algorithm Hash digest
SHA256 660e9ef3d8c002180160dba61614b263db6ecc94594d171bc0683989c39ede54
MD5 7c7a282454d9804c4c69dfd25908264d
BLAKE2b-256 a537e4c53866646615ec8d78c48b32ead84615adec4bf18186f717f6d69aae98

See more details on using hashes here.

Provenance

The following attestation bundles were made for lftools_uv-0.1.5.tar.gz:

Publisher: build-test-release.yaml on modeseven-lfit/lftools-uv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lftools_uv-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: lftools_uv-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 196.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for lftools_uv-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c55c261938d1b8ef12b84ac1bcd99e2ade6ffaaef59d180e7926f9aab1777e73
MD5 e003ca451d9038225bfc20828cc0fd2f
BLAKE2b-256 9ef1d7b2a2e360471f8e84b88183af5f7d627511917a7ffbdf09fa778ec34057

See more details on using hashes here.

Provenance

The following attestation bundles were made for lftools_uv-0.1.5-py3-none-any.whl:

Publisher: build-test-release.yaml on modeseven-lfit/lftools-uv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page