From a2c8c9b1f8515fec58a4d01fcc8d302eda2d6c19 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Thu, 19 Dec 2024 09:13:15 +0200 Subject: [PATCH] Fix build for PyPi (#641) * Update pyproject.toml [no ci] * Update check.yml * Update check.yml * Update check.yml --- .github/workflows/check.yml | 22 ++++++++++++++++++++-- pyproject.toml | 5 +---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 14b0305cf..b67657c8b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -220,9 +220,27 @@ jobs: if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }} run: | # get actual version (major.minor) from credsweeper package - V=$(python -c "from packaging.version import Version as V; import credsweeper; v=V(credsweeper.__version__); print(f'{v.major}.{v.minor}')") + V=$(python -c "from packaging.version import Version as V; import credsweeper; v=V(credsweeper.__version__); print(f'{v.major}.{v.minor}');") # check whether current version exists in the file - grep $V SECURITY.md + if ! grep $V SECURITY.md; then + echo $V + cat --number SECURITY.md + exit 1 + fi + + # # # Check version match in __init__.py and project.toml files + + - name: Project version check + if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }} + run: | + # get full version from credsweeper package + V=$(python -c "from packaging.version import Version as V; import credsweeper; v=V(credsweeper.__version__); print(str(v));") + # check whether the exactly matched in project config + if ! grep "version = \"$V\"" pyproject.toml; then + echo $V + cat --number pyproject.toml + exit 1 + fi # # # from https://github.com/step-security-bot/CredSweeper/commit/dbc01f2709c56f69e2d8fd717156385f42b7bbf5 diff --git a/pyproject.toml b/pyproject.toml index 0cbe362c7..511a44f68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "credsweeper" -dynamic = ["version"] +version = "1.10.0" description = "Credential Sweeper" authors = [ ] @@ -52,9 +52,6 @@ Homepage = "https://github.com/Samsung/CredSweeper" requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.version] -path = "credsweeper/__init__.py" - [tool.hatch.build.targets.sdist] ignore-vcs = true only-include = ["/credsweeper"]