Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,25 @@ jobs:

steps:
- name: Check out the repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
version: "latest"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinxawesome_theme IPython
pip install -e .
uv sync --extra docs
Comment thread
pillowbeast marked this conversation as resolved.
uv pip install IPython

- name: Build documentation
run: |
# Clean any previous build artifacts
make -C docs/sphinx clean

# Generate API docs
sphinx-apidoc -o docs/sphinx/ src/weac --force --separate
uv run sphinx-apidoc -o docs/sphinx/ src/weac --force --separate

# Build HTML docs (do not fail on warnings)
make -C docs/sphinx html SPHINXOPTS="--keep-going -n"
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@ jobs:
name: Make sure code is ruff-formatted 🐶
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: '3.12'
version: "latest"

- name: Install dependencies
run: |
# Setup pip
python -m pip install --upgrade pip
# Install dependencies including ruff
python -m pip install -e ".[dev]"
run: uv sync --extra dev

- name: Check formatting with ruff
run: |
ruff format . --check
ruff check .
uv run ruff format . --check
uv run ruff check .
15 changes: 6 additions & 9 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@ jobs:
name: Static code analysis 🔎
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
cache: "pip"
version: "latest"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
run: uv sync --extra dev

- name: Run pylint analysis
# Using repository pylint config (pyproject.toml) with comprehensive settings for scientific code
run: |
exit_code=0
python -m pylint --output-format=parseable --output=pylint-report.txt weac/ tests/ || exit_code=$?
uv run pylint --output-format=parseable --output=pylint-report.txt weac/ tests/ || exit_code=$?
echo "Pylint finished with exit code $exit_code."
echo
echo "Pylint exit code meaning:"
Expand Down
35 changes: 17 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
mkdir build
python -m build
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
- uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.x"

- name: Install dependencies
run: uv sync --extra build

- name: Build package
run: uv build

- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: uv run twine upload dist/*
19 changes: 7 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@ jobs:
name: Run unit tests 🤖
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python 3.12
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
cache: 'pip'
cache-dependency-path: |
pyproject.toml
check-latest: true
version: "latest"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
run: uv sync

- name: Run tests
run: python tests/run_tests.py
run: uv run python tests/run_tests.py
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dist/
# Environments
.venv/
venv/
.python-version
.weac-reference/
.venv*

Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
107 changes: 101 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@

1. [About the project](#about-the-project)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Roadmap](#roadmap)
5. [Release history](#release-history)
6. [How to contribute](#how-to-contribute)
7. [License](#license)
8. [Contact](#contact)
3. [Development Setup](#development-setup)
4. [Usage](#usage)
5. [Roadmap](#roadmap)
6. [Release history](#release-history)
7. [How to contribute](#how-to-contribute)
8. [License](#license)
9. [Contact](#contact)

<!-- ABOUT THE PROJECT -->
## About the project
Expand Down Expand Up @@ -129,6 +130,100 @@ Needs (runtime dependencies are declared in [pyproject.toml](https://github.com/
- [Snowpylot](https://github.com/connellymk/snowpylot) ≥ 1.1.3


<!-- DEVELOPMENT SETUP -->
## Development Setup

This project uses [uv](https://github.com/astral-sh/uv) for fast Python package management and project handling.

### Installing uv

Install uv following the [official installation guide](https://github.com/astral-sh/uv#installation):

```bash
# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Using pip (alternative)
pip install uv
```

### Setting up the development environment

Clone the repository and set up the development environment:

```bash
git clone https://github.com/2phi/weac
cd weac

# Install Python 3.12+ if not already available
# uv will automatically use the version specified in .python-version

# For basic setup (if only running the package):
uv sync

# For development (recommended for contributors):
uv sync --extra dev

# Activate the virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```

### Running tests

Run the test suite using uv:

```bash
# Run all tests
uv run python tests/run_tests.py

# Or use pytest directly (if installed)
uv run pytest
```

### Code formatting and linting

This project uses [ruff](https://github.com/astral-sh/ruff) for fast Python linting and formatting:

```bash
# Format code
uv run ruff format .

# Check for linting issues
uv run ruff check .

# Fix auto-fixable linting issues
uv run ruff check . --fix
```

### Building the package

Build the package for distribution:

```bash
# Build wheel and source distribution
uv build

# Install in editable mode for development
uv pip install -e .
```

### Additional uv commands

```bash
# Update dependencies
uv sync --upgrade

# Add a new dependency
uv add package-name

# Add a development dependency
uv add --dev package-name

# Show environment info
uv run python --version
uv run pip list
```

<!-- USAGE EXAMPLES -->
## Usage

Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ interactive = [
"traitlets>=5.14.3",
]
docs = ["sphinx", "sphinxawesome-theme"]
build = ["build", "twine"]
dev = [
# Notebook execution (to run demo.ipynb non-interactively)
"nbclient>=0.10.0",
Expand Down Expand Up @@ -73,9 +74,6 @@ dev = [

# Versioning helper matching [tool.bumpversion]
"bump-my-version", # e.g. bump-my-version bump patch

# Building for Testing
"build",
]

[tool.setuptools]
Expand Down
Loading