From 7902555afd7ae98dd408b9332219465dbb9d62e8 Mon Sep 17 00:00:00 2001 From: Nicolas IRAGNE Date: Fri, 4 Jul 2025 18:42:52 +0200 Subject: [PATCH 1/3] feat(ci): add GitHub Actions workflows for Docker image build and rename PyPI publish --- .github/workflows/docker_image.yml | 25 +++++++++++++++++++ .../{publish.yml => publish_to_pypi.yml} | 0 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/docker_image.yml rename .github/workflows/{publish.yml => publish_to_pypi.yml} (100%) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml new file mode 100644 index 00000000..258e6c4a --- /dev/null +++ b/.github/workflows/docker_image.yml @@ -0,0 +1,25 @@ +name: Build Docker Image + +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v6 + with: + push: false + context: . + file: Dockerfile + tags: "${{ github.sha }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish_to_pypi.yml similarity index 100% rename from .github/workflows/publish.yml rename to .github/workflows/publish_to_pypi.yml From c2d9c3082ae18fa11a4a3d4337333bc326f9f0dd Mon Sep 17 00:00:00 2001 From: Nicolas IRAGNE Date: Sat, 5 Jul 2025 01:46:41 +0200 Subject: [PATCH 2/3] chore: rename cli module to __main__ so it can be executed without having to build --- pyproject.toml | 2 +- src/gitingest/{cli.py => __main__.py} | 0 tests/test_cli.py | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/gitingest/{cli.py => __main__.py} (100%) diff --git a/pyproject.toml b/pyproject.toml index 641f9c30..a6792cb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ dev = [ ] [project.scripts] -gitingest = "gitingest.cli:main" +gitingest = "gitingest.__main__:main" [project.urls] homepage = "https://gitingest.com" diff --git a/src/gitingest/cli.py b/src/gitingest/__main__.py similarity index 100% rename from src/gitingest/cli.py rename to src/gitingest/__main__.py diff --git a/tests/test_cli.py b/tests/test_cli.py index f9bbde85..bc08eb15 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -8,7 +8,7 @@ import pytest from click.testing import CliRunner, Result -from gitingest.cli import main +from gitingest.__main__ import main from gitingest.config import MAX_FILE_SIZE, OUTPUT_FILE_NAME @@ -72,8 +72,8 @@ def test_cli_with_stdout_output() -> None: # ─── core expectations (stdout) ────────────────────────────────────- assert result.exit_code == 0, f"CLI exited with code {result.exit_code}, stderr: {result.stderr}" assert "---" in result.stdout, "Expected file separator '---' not found in STDOUT" - assert "src/gitingest/cli.py" in result.stdout, ( - "Expected content (e.g., src/gitingest/cli.py) not found in STDOUT" + assert "src/gitingest/__main__.py" in result.stdout, ( + "Expected content (e.g., src/gitingest/__main__.py) not found in STDOUT" ) assert not output_file.exists(), f"Output file {output_file} was unexpectedly created." From 31e8b37df0553115a5ecb88f041a6cc85a5b1454 Mon Sep 17 00:00:00 2001 From: Nicolas Iragne Date: Sat, 5 Jul 2025 14:47:31 +0200 Subject: [PATCH 3/3] Update .github/workflows/docker_image.yml Co-authored-by: Filip Christiansen <22807962+filipchristiansen@users.noreply.github.com> --- .github/workflows/docker_image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 258e6c4a..fe5b6464 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -2,8 +2,7 @@ name: Build Docker Image on: pull_request: - branches: - - main + branches: [ main ] workflow_dispatch: jobs: