Posts Tagged: ci-cd
-
Converting poetry.lock to requirements.txt for Legacy CI/CD Pipelines
Step-by-step guide to convert Poetry's poetry.lock to pip-compatible requirements.txt for legacy CI/CD pipelines like Jenkins, Travis CI, or GitLab that lack Poetry support. Ensure reproducible Python dependency installs without version drift.
-
How to Fix Flaky pytest Tests Caused by Random Order Execution with pytest-randomly
pytest flaky tests random order fix: pytest-randomly shuffles execution order + seeds random, exposes hidden deps. Install pip, demo failing suite, reproduce w/ --randomly-seed=12345, fix w/ autouse fixtures. CI: --randomly-seed=last. Benchmarks detect 80% hidden flakiness. Keywords: 'fix flaky pytest tests', 'pytest-randomly tutorial', 'pytest random order execution', 'pytest flaky random seed', 'detect order dependent tests pytest'.
-
How to Pin Transitive Dependencies in requirements.txt to Pass Security Audits
Pin direct + transitive (indirect) dependencies in requirements.txt using pip-tools or uv pip-compile. Pass pip-audit, Safety CLI, Snyk scans with exact versions/hashes. Reproducible, secure Python builds without version drift.
-
Reducing pytest Suite Runtime from 45 Minutes to 6 Minutes with pytest-xdist Parallelization
pytest-xdist parallel testing: Speed up pytest suite 45min→6min (7.5x) on multi-core CPUs. pytest -n auto detects cores, -n 8 manual. Markers for serial tests, pytest.ini config. Benchmarks Python 3.12, 1000+ tests. Handles DB fixtures.
-
tox.ini Configuration for Testing Python Packages Across 3.10‑3.13
Example tox.ini for multi‑Python testing (py310‑py313) with pytest, coverage, mypy, and ruff. Includes CI, benchmarks, and pyproject.toml integration.