Skip to content

Latest commit

 

History

History
100 lines (67 loc) · 2.27 KB

File metadata and controls

100 lines (67 loc) · 2.27 KB

ASWF Python Utilities

Code style: black pytest coverage

The aswfdocker command line tool is available to help with package and image builds.

Installation

For users and developers

Install uv (Python 3.9+ required):

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

Then clone this repository and install the project and its dependencies:

git clone https://github.com/AcademySoftwareFoundation/aswf-docker
cd aswf-docker

For users, install the dependencies for aswfdocker:

uv sync

For developers, install the aswfdocker dependencies and additional tools:

uv sync --all-extras

Run the aswfdocker command via uv run:

uv run aswfdocker --help

Finally

Check that the command works:

uv run aswfdocker --help

Usage

Activating the venv created by uv

uv creates a venv which you can explicitly activate to avoid having to prefix every invocation of aswfdocker with uv run:

source .venv/bin/activate
aswfdocker --version

List packages and images

List all known packages:

uv run aswfdocker packages

List all known images:

uv run aswfdocker images

Development

Process

First install the pre-commit hooks by running uv run pre-commit install.

The pre-commit hooks will run the following commands, which can be run individually as well:

  • Run Black on the code to ensure formatting is okay: black python
  • Run the tests to ensure everything is okay: pytest python/aswfdocker
  • Run mypy to ensure static types are okay: mypy python/aswfdocker
  • Run PyLint on the code to ensure linting is okay: pylint python/aswfdocker

To run them all manually use pre-commit run --all-files.

Adding new dependencies

  • Add a runtime dependency: uv add <package>
  • Add a dev dependency: uv add --dev <package>
  • Dependencies are declared in pyproject.toml; run uv lock after editing.