From b92882c06814530b7e2334a5397aa35bfbe6976e Mon Sep 17 00:00:00 2001 From: Andrey Golovanov Date: Fri, 2 Oct 2026 03:18:12 +0100 Subject: [PATCH] Fix install docs and trim packaging, hooks and CI config The README pointed at pip install topogen, which installs an unrelated PyPI project; install from GitHub instead. Drop eight requirements that nothing imports, the PyPI publish workflow, the isolated pre-commit Pyright hook, benchmark plugin flags and stale ignore rules. Add project URLs and run CI once per PR. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/publish.yml | 51 ------------------------------- .github/workflows/python-test.yml | 5 ++- .gitignore | 18 ----------- .pre-commit-config.yaml | 25 --------------- CHANGELOG.md | 7 ++++- Makefile | 41 ++++++------------------- README.md | 9 +++--- pyproject.toml | 26 +++++----------- 8 files changed, 32 insertions(+), 150 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index cb97eb4..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [published] - workflow_dispatch: - inputs: - test_pypi: - description: 'Publish to Test PyPI instead of PyPI' - required: false - default: false - type: boolean - -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write # Required for trusted publishing - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - python -m pip install build twine - - - name: Build package - run: python -m build - - - name: Check package - run: python -m twine check dist/* - - - name: Publish to Test PyPI - if: ${{ github.event.inputs.test_pypi == 'true' }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - print-hash: true - - - name: Publish to PyPI - if: ${{ github.event_name == 'release' && github.event.action == 'published' }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - print-hash: true diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 143d97c..7f60c1b 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -1,7 +1,10 @@ # Run tests, linting, and type checking name: CI -on: [push, pull_request] +on: + push: + branches: [main] + pull_request: jobs: test: diff --git a/.gitignore b/.gitignore index 994d6dd..e38f0c9 100644 --- a/.gitignore +++ b/.gitignore @@ -86,14 +86,6 @@ __pypackages__/ # Cursor .cursorrules -# Jupyter Notebooks -.ipynb_checkpoints -.virtual_documents/ - -# Documentation -# MkDocs -/site - # OS Specific # macOS .DS_Store @@ -105,7 +97,6 @@ Desktop.ini # Private content private/ -notebooks/private/ *_private/ *.private.* @@ -128,14 +119,6 @@ temp/ temporary/ analysis_temp/ tmp/ -analysis*.ipynb -*_analysis.ipynb -analysis*.html -*_analysis.html - -# Performance analysis results -dev/perf_results/ -dev/perf_plots/ # Repo root file ignores # Ignore certain file types only at the repository root @@ -145,7 +128,6 @@ dev/perf_plots/ /*.json # Allow required config files -!/mkdocs.yml !/.pre-commit-config.yaml # Project directories to ignore at the repository root diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 078e995..8d85249 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,31 +6,6 @@ repos: args: [--fix] - id: ruff-format - - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.401 - hooks: - - id: pyright - args: [--project, pyproject.toml] - additional_dependencies: - [ - "pyyaml", - "pandas", - "matplotlib", - "nbformat", - "nbconvert", - "ipykernel", - "itables", - "rasterio", - "pyproj", - "geopandas", - "shapely", - "scikit-learn", - "networkx", - "contextily", - "pandas-stubs", - "ngraph>=0.23.1", - ] - - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/CHANGELOG.md b/CHANGELOG.md index d119c28..cd0ff40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Workflows**: Use `design_analysis_brief` as the default in both Python and YAML configurations. - **Workflows**: Bind built-in demand references to `traffic.matrix_name`. - **Failures**: Make the `empty` policy a valid no-failure mode. +- **Docs**: Install from GitHub; the `topogen` name on PyPI belongs to an unrelated project. ### Changed @@ -30,12 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Workflows**: Validate `lib/workflows.yml` with NetGraph before emission; steps use `type` and `demand_set`. - **Workflows**: Use `parallelism: auto` in built-in and sample workflows. - **Validation**: Construct the full NetGraph scenario to check workflow arguments and failure policies before topology audits. -- **Internal**: Remove redundant validation and scenario code; shorten comments and documentation. +- **Internal**: Remove redundant validation and scenario code, the PyPI publish workflow, the pre-commit Pyright hook and benchmark flags. ### Added - **Superset**: Add setup, teardown and run commands to install dev dependencies, copy local `.env` files and run checks. +### Removed + +- **Dependencies**: Unused `seaborn`, `rich`, `nbformat`, `nbconvert`, `ipykernel`, `itables`, `rasterio` and `scikit-learn` requirements. + ## [0.4.0] - 2026-03-15 ### Changed diff --git a/Makefile b/Makefile index e35fa53..6d25680 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # TopoGen development commands -.PHONY: help venv clean-venv dev install check check-ci lint format test qt build clean check-dist publish-test publish validate info hooks check-python +.PHONY: help venv clean-venv dev install check check-ci lint format test qt build clean check-dist validate info hooks check-python .DEFAULT_GOAL := help @@ -33,18 +33,14 @@ help: @echo " make lint - Run only linting (non-mutating: ruff + pyright)" @echo " make format - Auto-format code with ruff" @echo " make validate - Validate YAML configs against schemas" - @echo " make test - Run tests with coverage (includes slow and benchmark)" - @echo " make qt - Run quick tests only (excludes slow and benchmark)" + @echo " make test - Run tests with coverage (includes slow)" + @echo " make qt - Run quick tests only (excludes slow)" @echo "" @echo "Build & Package:" @echo " make build - Build distribution packages" + @echo " make check-dist - Check distribution metadata with twine" @echo " make clean - Clean build artifacts and cache files" @echo "" - @echo "Publishing:" - @echo " make check-dist - Check distribution packages with twine" - @echo " make publish-test - Publish to Test PyPI" - @echo " make publish - Publish to PyPI" - @echo "" @echo "Utilities:" @echo " make hooks - Run pre-commit on all files" @echo " make check-python - Check if venv Python matches best available" @@ -121,12 +117,12 @@ format: @$(RUFF) format . test: - @echo "๐Ÿงช Running tests with coverage (includes slow and benchmark)..." + @echo "๐Ÿงช Running tests with coverage (includes slow)..." @$(PYTEST) qt: - @echo "โšก Running quick tests only (excludes slow and benchmark)..." - @$(PYTEST) --no-cov -m "not slow and not benchmark" + @echo "โšก Running quick tests only (excludes slow)..." + @$(PYTEST) --no-cov -m "not slow" validate: @echo "๐Ÿ“‹ Validating TopoGen config YAMLs..." @@ -149,7 +145,7 @@ build: clean: @echo "๐Ÿงน Cleaning build artifacts and cache files..." @rm -rf build/ dist/ *.egg-info/ || true - @rm -rf .pytest_cache .ruff_cache .mypy_cache htmlcov htmlcov-python .coverage coverage.xml coverage-*.xml .benchmarks .pytest-benchmark || true + @rm -rf .pytest_cache .ruff_cache htmlcov .coverage coverage.xml || true @find . -path "./venv" -prune -o -type f -name "*.pyc" -delete 2>/dev/null || true @find . -path "./venv" -prune -o -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true @find . -path "./venv" -prune -o -type f -name "*.pyo" -delete 2>/dev/null || true @@ -157,9 +153,8 @@ clean: @find . -path "./venv" -prune -o -type f -name "*.orig" -delete 2>/dev/null || true @echo "โœ… Cleanup complete!" -# Publishing check-dist: - @echo "๐Ÿ” Checking distribution packages..." + @echo "๐Ÿ” Checking distribution metadata..." @if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \ $(PYTHON) -m twine check dist/*; \ else \ @@ -167,24 +162,6 @@ check-dist: exit 1; \ fi -publish-test: - @echo "๐Ÿ“ฆ Publishing to Test PyPI..." - @if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \ - $(PYTHON) -m twine upload --repository testpypi dist/*; \ - else \ - echo "โŒ twine not installed. Install dev dependencies with: make dev"; \ - exit 1; \ - fi - -publish: - @echo "๐Ÿš€ Publishing to PyPI..." - @if $(PYTHON) -c "import twine" >/dev/null 2>&1; then \ - $(PYTHON) -m twine upload dist/*; \ - else \ - echo "โŒ twine not installed. Install dev dependencies with: make dev"; \ - exit 1; \ - fi - # Project Information info: @echo "๐Ÿ“‹ TopoGen Project Information" diff --git a/README.md b/README.md index 8ccee04..a34d8c9 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,11 @@ scenarios with site blueprints, hardware, risk groups, traffic, and workflows. ## Install Requires Python 3.11+. Dependencies include `ngraph>=0.23.1` and -`netgraph-core>=0.10.0`. +`netgraph-core>=0.10.0`. TopoGen is not on PyPI; the `topogen` package there is +an unrelated project. ```bash -pip install topogen +pip install git+https://github.com/networmix/TopoGen ``` For a source checkout: @@ -44,8 +45,8 @@ ngraph run output/config_scenario.yml ``` `generate` writes `output/config_integrated_graph.json`, a metro-to-metro corridor -graph. `build` reads it and writes `output/config_scenario.yml`. File prefixes -come from the config filename. +graph, and a preview JPEG. `build` reads the graph and writes +`output/config_scenario.yml`. File prefixes come from the config filename. `build` checks the schema, NetGraph Scenario construction, topology, and hardware. `ngraph run` executes the workflows. Add `--print` to `topogen build` to also print diff --git a/pyproject.toml b/pyproject.toml index ec928cd..3321a51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "topogen" version = "0.4.0" -description = "A network topology generator." +description = "Generate NetGraph backbone scenarios from US Census urban areas and TIGER/Line roads." readme = "README.md" authors = [{ name = "Andrey Golovanov" }] license = "MIT" @@ -27,19 +27,11 @@ dependencies = [ "numpy", "pandas", "matplotlib", - "seaborn", - "rich", - "nbformat", - "nbconvert", - "ipykernel", - "itables", # Geographic processing - "rasterio", "pyproj", "geopandas", "shapely", "scipy", - "scikit-learn", "networkx", "contextily", # Strict schema validation at runtime @@ -55,11 +47,7 @@ dev = [ # testing "pytest>=8", "pytest-cov", - "pytest-benchmark", - "pytest-mock", "pytest-timeout", - # json schema validation for scenarios - "jsonschema", # style + type checking "ruff==0.11.13", "pyright==1.1.401", @@ -67,22 +55,25 @@ dev = [ "pandas-stubs", # pre-commit hooks "pre-commit", - # build + # build and metadata checks "build", - # publishing "twine", ] +[project.urls] +Repository = "https://github.com/networmix/TopoGen" +Changelog = "https://github.com/networmix/TopoGen/blob/main/CHANGELOG.md" +Issues = "https://github.com/networmix/TopoGen/issues" + [project.scripts] topogen = "topogen.cli:main" # Pytest flags [tool.pytest.ini_options] -addopts = "--cov=./topogen --cov-fail-under=50 --cov-report term-missing --benchmark-disable-gc --benchmark-min-rounds=5 --benchmark-warmup=on" +addopts = "--cov=./topogen --cov-fail-under=50 --cov-report term-missing" timeout = 30 markers = [ "slow: marks integration tests as slow (deselect with '-m \"not slow\"')", - "benchmark: marks tests as performance benchmarks (run with '-m benchmark')", ] # Coverage configuration @@ -101,7 +92,6 @@ exclude_lines = [ # Package discovery [tool.setuptools.packages.find] include = ["topogen*"] -exclude = ["tests*", "notebooks*", "examples*", "dev*"] [tool.setuptools.package-data] "topogen.schemas" = ["topogen_config.json"]