https://github.com/slaclab/lume-base
Base classes and architecture for LUME Python projects
https://github.com/slaclab/lume-base
Last synced: 19 days ago
JSON representation
Base classes and architecture for LUME Python projects
- Host: GitHub
- URL: https://github.com/slaclab/lume-base
- Owner: slaclab
- License: apache-2.0
- Created: 2021-01-19T18:50:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T15:23:46.000Z (about 2 years ago)
- Last Synced: 2025-04-06T04:59:41.681Z (about 1 year ago)
- Language: Python
- Homepage: https://slaclab.github.io/lume-base/
- Size: 1.55 MB
- Stars: 2
- Watchers: 7
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lume-base
Base classes and architecture for LUME Python projects
## Installation
Install using pip:
```bash
pip install lume-base
```
## Development
We recommend using [uv](https://github.com/astral-sh/uv) for development:
```bash
# Install uv
pip install uv
# Initialize uv project
uv init
# Install package in editable mode with dev dependencies
uv sync --extra dev
# Run tests
uv run pytest
```
or alternatively run pip commands directly in uv:
```bash
# Install package in editable mode with dev dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
```
### Linting and Formatting
This project uses [pre-commit](https://pre-commit.com/) to manage code quality checks, including [ruff](https://github.com/astral-sh/ruff) for linting and formatting. Pre-commit hooks will automatically run on every commit.
```bash
# Install pre-commit (if not already installed from dev dependencies)
uv pip install pre-commit
# Install the git hook scripts
pre-commit install
# (Optional) Run against all files manually
pre-commit run --all-files
```
Once installed, pre-commit will automatically run checks whenever you commit changes. If any checks fail, the commit will be blocked until you fix the issues.
**To manually run checks before committing:**
```bash
# Run all pre-commit hooks
pre-commit run --all-files
# Or run only ruff checks
pre-commit run ruff --all-files
pre-commit run ruff-format --all-files
```
The CI pipeline will automatically run these checks on every push and pull request.
### Building Documentation
```bash
# Install with docs dependencies
uv sync --extra docs
# Build docs
uv run mkdocs build
# Serve docs locally
uv run mkdocs serve
```