Python 3-based commandline converter YAML ↔ JSON ↔ PLIST
This document describes how to build, test, and release yaplon using the modern build system.
# Development setup
make install-dev
# Run tests
make test
# Build package
make build
# Build binaries
make build-binary
# Complete development workflow
make dev
The yaplon project uses a modern build system with the following components:
The project follows Semantic Versioning (SemVer):
Version information is automatically derived from:
v1.2.3
)yaplon/__init__.py
# Check current version
python -c "import yaplon; print(yaplon.__version__)"
# Check version consistency
make version-check
# Manual version management
python yaplon/_version.py
scripts/build.py
)Comprehensive build automation:
# Install dependencies
python scripts/build.py --install-dev
# Format code
python scripts/build.py --format
# Run linting
python scripts/build.py --lint
# Run tests
python scripts/build.py --test
python scripts/build.py --test-fast
python scripts/build.py --test-coverage
# Build package
python scripts/build.py --build
# Build binary
python scripts/build.py --build-binary
# Complete build process
python scripts/build.py --all
# CI workflow
python scripts/build.py --ci
scripts/release.py
)Automated release management:
# Patch release (1.2.3 -> 1.2.4)
python scripts/release.py --bump patch --message "Bug fixes"
# Minor release (1.2.3 -> 1.3.0)
python scripts/release.py --bump minor --message "New features"
# Major release (1.2.3 -> 2.0.0)
python scripts/release.py --bump major --message "Breaking changes"
# Specific version
python scripts/release.py --version 1.5.0 --message "Special release"
# Test PyPI release
python scripts/release.py --bump patch --test-pypi --message "Test release"
# Dry run
python scripts/release.py --bump patch --message "Test" --dry-run
scripts/build_binaries.py
)Cross-platform binary building:
# Build binary for current platform
python scripts/build_binaries.py
# Build with testing
python scripts/build_binaries.py --test
# Build with installer
python scripts/build_binaries.py --installer
# Custom output directory
python scripts/build_binaries.py --output ./binaries
# Use custom spec file
python scripts/build_binaries.py --spec yaplon.spec
tests/
├── __init__.py
├── helpers.py
├── test_version.py # Version management tests
├── test_integration.py # Integration tests
├── test_cli.py # CLI tests
├── test_json_sanitization.py # JSON sanitization tests
└── test_*.py # Format conversion tests
# Run all tests
pytest
# Run fast tests only
pytest -m "not slow"
# Run slow tests only
pytest -m "slow"
# Run with coverage
pytest --cov=yaplon --cov-report=html
# Run specific test file
pytest tests/test_version.py
# Run specific test
pytest tests/test_version.py::TestVersionManagement::test_get_version_from_git_tags
slow
and integration
test markersyaplon.spec
for advanced build configurationBinaries are named using the pattern:
yaplon-{version}-{platform}-{arch}[.exe]
Examples:
yaplon-1.6.0-linux-x64
yaplon-1.6.0-windows-x64.exe
yaplon-1.6.0-macos-x64
Built binaries are automatically tested for:
Important: Due to GitHub App permissions, workflow files are provided as templates in workflows-templates/
. See GITHUB_SETUP.md for detailed setup instructions.
# Copy workflows to activate them
mkdir -p .github/workflows
cp workflows-templates/*.yml .github/workflows/
# Configure secrets in GitHub repository settings
# - PYPI_TOKEN: For PyPI publishing
# - CODECOV_TOKEN: For coverage reporting (optional)
workflows-templates/ci.yml
)
workflows-templates/release.yml
)
v*
)workflows-templates/pr.yml
)
For complete setup instructions, see GITHUB_SETUP.md.
# Initial setup
git clone https://github.com/twardoch/yaplon.git
cd yaplon
make install-dev
# Development cycle
make dev # format + lint + test-fast
# Before committing
make ci # full CI workflow locally
# Update CHANGELOG.md
# Commit changes
git add .
git commit -m "Prepare release"
# Patch release
python scripts/release.py --bump patch --message "Bug fixes and improvements"
# Or minor/major release
python scripts/release.py --bump minor --message "New features"
# Check version consistency
make version-check
# Reset version from git tag
python -c "from yaplon._version import set_version_in_init, get_version; set_version_in_init(get_version())"
# Clean build artifacts
make clean
# Reinstall dependencies
make install-dev
# Check system requirements
python --version # Should be 3.9+
pip --version
# Run tests with verbose output
pytest -v
# Run specific failing test
pytest tests/test_specific.py::test_function -v -s
# Update test dependencies
pip install -U pytest pytest-cov
The Makefile provides convenient shortcuts:
make clean # Clean build artifacts
make install # Install production dependencies
make install-dev # Install development dependencies
make lint # Run linting
make format # Format code
make test # Run all tests
make test-fast # Run fast tests only
make test-slow # Run slow tests only
make test-coverage # Run tests with coverage
make build # Build package
make build-binary # Build binary
make release # Release to PyPI
make version-check # Check version consistency
make dev # Development workflow
make ci # CI workflow
The old dist.sh
script is deprecated. To migrate:
./dist.sh "Release message"
python scripts/release.py --bump patch --message "Release message"
The new system provides:
requirements.txt
requirements-dev.txt
gh
) for GitHub integrationFor issues with the build system: