From 9d65fcaeac1313b5f81df4af069f8ec45352c4cf Mon Sep 17 00:00:00 2001 From: Vitaliy Demidov Date: Sun, 1 Feb 2026 14:29:26 -0800 Subject: [PATCH] Build a source distribution Python package (`sdist`) --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ README.md | 17 ++++++++--------- pyproject.toml | 5 +++-- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c9cc05..63171f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,6 +72,39 @@ jobs: path: ./wheelhouse/*.whl if-no-files-found: error + build-sdist: + name: Build sdist + needs: [lint] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + version: "0.8.22" + + - name: Install dependencies + run: uv sync --no-install-project + + - name: Build sdist package + run: uv run poetry build -f sdist && ls -al dist + + - name: Upload sdist package + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: ./dist/*.tar.gz + if-no-files-found: error + upload: name: Upload to PyPI if: startsWith(github.ref, 'refs/tags/') diff --git a/README.md b/README.md index 2eac819..c845dab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - ```zig ▞▀▖ ▐ ▞▀▖ ▚▄ ▞▀▖▞▀▖▙▀▖▞▀▖▜▀ ▚▄ ▌ ▌▞▀▖▞▀▖▛▀▖▞▀▖▙▀▖ @@ -37,19 +36,19 @@ To mask secrets from the `bytes` literal: ```shell » python ->>> import secretsweeper ->>> print(secretsweeper.mask(b"Hello, Secret Sweeper!", (b'Secret', b'Sweeper'))) ->>> b'Hello, ****** *******!' +import secretsweeper +print(secretsweeper.mask(b"Hello, Secret Sweeper!", (b'Secret', b'Sweeper'))) +b'Hello, ****** *******!' ``` Secrets may be completely removed by providing a third argument, `limit=0`, which specifies the maximum number of masking characters: ```shell » python ->>> import secretsweeper ->>> print(secretsweeper.mask(b"Moby Dick!", [b" Dick"], limit=0)) ->>> b'Moby!' +import secretsweeper +print(secretsweeper.mask(b"Moby Dick!", [b" Dick"], limit=0)) +b'Moby!' ``` -To effectively mask a large text: +To effectively mask all secrets in a large text: ```python import urllib.request @@ -65,7 +64,7 @@ with urllib.request.urlopen(url) as src, open("sanitized.txt", "wb") as dest: dest.write(line) ``` -More examples in [tests](tests/test_secretsweeper.py). +More examples are in [tests](tests/test_secretsweeper.py). ## Getting involved diff --git a/pyproject.toml b/pyproject.toml index 1c00874..954256c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,9 @@ [project] name = "secretsweeper" -version = "0.0.1a2" +version = "0.0.1a1" requires-python = ">=3.11" -license = "GPL-3.0-only" +license = "MIT" +license-files = ["LICENSE"] [build-system] requires = ["poetry-core==2.2.1", "ziggy-pydust==0.26.0"]