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
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
---
name: Publish to PyPI
name: Publish
on:
push:
tags:
- "v*" # Triggers on tags like v0.1.0
- "v*" # Triggers on tags like v0.1.0

jobs:
publish:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Validate version matches tag
run: |
PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PYPROJECT_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != tag ($TAG_VERSION)"
exit 1
fi
PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PYPROJECT_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != tag ($TAG_VERSION)"
exit 1
fi

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies from uv.lock
run: uv sync --no-dev

- name: Build package
- name: Build and publish to PyPI
run: |
uv pip install --upgrade build
uv run python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uv build
uv publish --trusted-publishing always

- name: Update package managers
run: |
Expand Down
73 changes: 42 additions & 31 deletions .github/workflows/ci.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
name: CI
name: Tests
on:
workflow_dispatch:
push:
branches: [ main ]
branches: [main]
paths-ignore:
- '**.md'
- "**.md"
pull_request:
branches: [ main ]
branches: [main]
paths-ignore:
- '**.md'
- "**.md"

jobs:
test:
Expand All @@ -20,60 +20,71 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-slim, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11"]
python-version:
[
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
"pypy3.9",
"pypy3.10",
"pypy3.11",
]

env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
run: uv sync
- name: Install dependencies
run: uv sync --no-default-groups --group test

- name: Run tests
run: uv run pytest -v
- name: Run tests
run: uv run --no-sync pytest -v

- name: Run linter
run: uv run ruff check .
- name: Run linter
run: uv run --no-sync ruff check .

- name: Check formatting
run: uv run ruff format --check .
- name: Check formatting
run: uv run --no-sync ruff format --check .

- name: Test CLI
run: |
uv run python main.py --help
uv run python main.py . -n 5 -m 1000
- name: Test CLI
run: |
uv run --no-sync python main.py --help
uv run --no-sync python main.py . -n 5 -m 1000

mypy:
name: Type Check
runs-on: ubuntu-slim

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
run: uv sync
run: uv sync --no-default-groups --group lint

- name: Type check with mypy
run: uv run mypy .
run: uv run --no-sync mypy .

post-dog:
if: github.event_name == 'pull_request'
name: Celebrate with a Dog!
needs: [test, mypy] # Only run if `test` and `mypy` succeed
needs: [test, mypy] # Only run if `test` and `mypy` succeed
runs-on: ubuntu-slim

steps:
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Fixed

- PyPy on Windows now works gracefully when `shutil.disk_usage` is unavailable (displays message instead of crashing)
- Fixed flaky user config tests by reloading `zpace.config` module inside pyfakefs context

### Changed

- Dropped Python 3.8 support (already EOL since October 2024)
- Removed `argparse` from dependencies (already in standard library)

### CI/CD

- Renamed workflows: `ci.yml` → `tests.yml`, `publish.yml` → `publish-pypi.yml`
- Simplified PyPI publish using `uv build`/`uv publish` instead of pypa action
- Switched to `ubuntu-slim` runners where Docker isn't needed
- Replaced explicit Python install with `UV_PYTHON` env var
- Updated `actions/checkout` to v6
- Split dev dependencies into `test`, `lint`, and `dev` groups
- Excluded test files from mypy type checking
- Updated README badge URL

## [0.4.5] - 2026-01-27

### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Zpace

[![PyPI version](https://img.shields.io/pypi/v/zpace?color=blue)](https://pypi.org/project/zpace/)
[![Tests](https://github.com/AzisK/Zpace/actions/workflows/ci.yml/badge.svg)](https://github.com/AzisK/Zpace/actions/workflows/ci.yml)
[![Tests](https://github.com/AzisK/Zpace/actions/workflows/tests.yml/badge.svg)](https://github.com/AzisK/Zpace/actions/workflows/tests.yml)

A CLI tool to discover what's hogging your disk space!

Expand Down
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ classifiers = [
]

dependencies = [
"argparse>=1.4.0",
"tqdm>=4.67.1",
"tomli>=2.0.0; python_version < '3.11'",
]
Expand All @@ -37,14 +36,20 @@ dependencies = [
zpace = "zpace.main:main"

[dependency-groups]
dev = [
"mypy>=1.18.2",
"pre-commit>=4.3.0",
test = [
"pyfakefs>=5.10.2",
"pytest>=8.4.2",
"ruff>=0.14.1",
]
lint = [
"mypy>=1.18.2",
"types-tqdm>=4.67.0.20250809",
]
dev = [
{include-group = "test"},
{include-group = "lint"},
"pre-commit>=4.3.0",
]

[tool.ruff]
line-length = 100
Expand All @@ -58,5 +63,8 @@ indent-style = "space"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.mypy]
exclude = ["test_.*\\.py$"]

[tool.hatch.build.targets.wheel]
include = ["zpace"]
Loading