Skip to content

Commit

Permalink
Fix build for PyPi (#641)
Browse files Browse the repository at this point in the history
* Update pyproject.toml [no ci]

* Update check.yml

* Update check.yml

* Update check.yml
  • Loading branch information
babenek authored Dec 19, 2024
1 parent 6b67827 commit a2c8c9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "credsweeper"
dynamic = ["version"]
version = "1.10.0"
description = "Credential Sweeper"
authors = [
]
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit a2c8c9b

Please sign in to comment.