From ff9f312dcc1865e4e0f8b3114847eaa3d7f3407e Mon Sep 17 00:00:00 2001 From: Thomas Rabaix Date: Wed, 25 Jun 2025 22:36:13 +0000 Subject: [PATCH] chores(cleanup): remove legacy files --- .github/README.md | 115 ---------------------------------------------- .travis.yml | 12 ----- AUTHORS | 5 -- MANIFEST.in | 11 ----- Makefile | 5 +- pyproject.toml | 10 ---- 6 files changed, 3 insertions(+), 155 deletions(-) delete mode 100644 .github/README.md delete mode 100644 .travis.yml delete mode 100644 AUTHORS delete mode 100644 MANIFEST.in diff --git a/.github/README.md b/.github/README.md deleted file mode 100644 index 13bab5a..0000000 --- a/.github/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# GitHub Actions CI/CD Setup - -This directory contains the complete CI/CD setup for the python-simple-ioc project. - -## Workflows Overview - -### ๐Ÿš€ Main CI Workflow (`ci.yml`) -- **Purpose**: Primary continuous integration for every push and PR -- **Features**: - - Tests against Python 3.9, 3.10, 3.11, 3.12, and 3.13 - - Runs flake8 linting (required to pass) - - Executes core tests using smart dependency detection - - Optional mypy type checking (non-blocking) - -### ๐Ÿงช Comprehensive Testing (`tests.yml`) -- **Purpose**: Detailed testing with multiple configurations and optional dependencies -- **Jobs**: - - **Lint**: Flake8 and optional mypy across all Python versions - - **Core Tests**: Tests without optional dependencies - - **Specific Extras**: Tests individual optional dependencies (flask, jinja2, redis) - - **All Extras**: Tests with all optional dependencies installed - - **Documentation**: Builds Sphinx docs and uploads artifacts - - **Package**: Validates package building - -### ๐ŸŒ Cross-Platform Testing (`test-matrix.yml`) -- **Purpose**: Ensure compatibility across operating systems -- **Coverage**: Linux, macOS, and Windows -- **Focus**: Core functionality verification - - - -### ๐Ÿท๏ธ Release Automation (`release.yml`) -- **Purpose**: Automated package building and PyPI publishing -- **Triggers**: Git tags (version tags) -- **Features**: - - Runs full test suite before releasing - - Builds and validates package - - Publishes to Test PyPI first (if token available) - - Publishes to PyPI for tagged releases - -## Smart Dependency Handling - -### Problem Solved -The project has optional dependencies (flask, jinja2, redis) that may not be installed in all environments. Traditional test runs would fail with import errors. - -### Solution -- **Workflow-Level Detection**: CI jobs check for dependency availability before running tests -- **Graceful Degradation**: Tests skip gracefully when dependencies are missing -- **Clear Reporting**: Distinguish between real failures and expected missing dependencies -- **Smart Test Scripts**: Embedded test runners in workflows that detect available dependencies - -### Usage Examples - -```bash -# Run core tests only (no optional dependencies) -python -m unittest discover -s tests -p "test_*.py" | grep -v "extra\." - -# Run all tests with make targets -make test - -# Run linting only -make lint -``` - -## Repository Setup Requirements - -### Required Secrets (for release automation) -Add these to your GitHub repository settings: -- `PYPI_API_TOKEN`: Your PyPI API token for publishing releases -- `TEST_PYPI_API_TOKEN`: Your Test PyPI API token for testing - - -### Branch Protection -Consider setting up branch protection rules for `main`/`master`: -- Require status checks: CI workflow must pass -- Require up-to-date branches before merging -- Include administrators in restrictions - -## Status Badges - -Add these to your README.md: - -```markdown -[![CI](https://github.com/rande/python-simple-ioc/actions/workflows/ci.yml/badge.svg)](https://github.com/rande/python-simple-ioc/actions/workflows/ci.yml) -[![Tests](https://github.com/rande/python-simple-ioc/actions/workflows/tests.yml/badge.svg)](https://github.com/rande/python-simple-ioc/actions/workflows/tests.yml) -[![Docs](https://github.com/rande/python-simple-ioc/actions/workflows/docs.yml/badge.svg)](https://github.com/rande/python-simple-ioc/actions/workflows/docs.yml) -[![Test Matrix](https://github.com/rande/python-simple-ioc/actions/workflows/test-matrix.yml/badge.svg)](https://github.com/rande/python-simple-ioc/actions/workflows/test-matrix.yml) -``` - -## Maintenance - -### Dependabot -Automated dependency updates are configured in `dependabot.yml`: -- Weekly Python package updates -- Weekly GitHub Actions updates -- Automatic PR creation with proper labels - -### Local Development -For local development and testing: -```bash -# Install with dev dependencies -pip install -e ".[dev]" - -# Run linting -make lint - -# Run tests (basic) -make test - -# Run tests with type checking -make test-strict - -# Run core tests only -python -m unittest discover -s tests -p "test_*.py" | grep -v "extra\." -``` \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3683f44..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: python -python: - - "2.7" - - "3.2" - - "3.4" - -# command to install dependencies -install: - - pip install -r requirements_python`python version.py`.txt --use-mirrors - -# command to run tests -script: make test \ No newline at end of file diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 5b350f6..0000000 --- a/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -The IoC package has been created by - - * Thomas Rabaix - -The code is inspired by the Symfony2 Dependency Component by Fabien Potencier \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c0b86b9..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,11 +0,0 @@ -include README.txt -include AUTHORS -include LICENSE -include MANIFEST.in -include tests.py -include setup.py -recursive-include ioc * -recursive-include docs * -recursive-include tests * -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] \ No newline at end of file diff --git a/Makefile b/Makefile index 38c33b5..fe99a50 100755 --- a/Makefile +++ b/Makefile @@ -2,16 +2,17 @@ all: build upload build: pip install build twine + rm -rf dist/ python -m build twine check dist/* upload-prod: build export TWINE_USERNAME=__token__ - python -m twine upload dist/* + bash -c 'read -s -p "Enter your Production PyPI token: " TWINE_PASSWORD; echo; export TWINE_PASSWORD; python -m twine upload dist/*' upload-test: build export TWINE_USERNAME=__token__ - python -m twine --repository testpypi upload dist/* + bash -c 'read -s -p "Enter your Test PyPI token: " TWINE_PASSWORD; echo; export TWINE_PASSWORD; python -m twine upload --repository testpypi dist/*' clean: rm -rf build/ dist/ *.egg-info/ __pycache__/ .pytest_cache/ .mypy_cache/ diff --git a/pyproject.toml b/pyproject.toml index 6399833..7dd39f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,10 +48,6 @@ dev = [ test = [ "pytest>=6.0", ] -tornado = [ - "tornado", - "werkzeug", -] flask = [ "flask", "werkzeug", @@ -62,9 +58,6 @@ jinja2 = [ redis = [ "redis", ] -twisted = [ - "twisted", -] [tool.setuptools] include-package-data = true @@ -75,7 +68,6 @@ include = ["ioc*"] [tool.setuptools.package-data] "*" = ["*.yml", "*.yaml", "*.html"] - [tool.mypy] python_version = "3.9" warn_return_any = false @@ -95,9 +87,7 @@ ignore_errors = false [[tool.mypy.overrides]] module = [ "yaml.*", - "werkzeug.*", "element.*", - "tornado.*", "redis.*", "jinja2.*", "flask.*",