Skip to content

Commit

Permalink
build: put local tar file in requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Sep 25, 2024
1 parent 7db6935 commit 1ee95b0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/hooks/include_webapp_in_requirements.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/sh

REQUIREMENTS_FILE="requirements.txt"
DOT="."
VERSION=$(poetry version --short)
TAR_FILE="dist/statement_sensei-$VERSION.tar.gz"

poetry export -f requirements.txt --output requirements.txt --extras ocrmypdf --without dev

if [ -f "$REQUIREMENTS_FILE" ]; then
FIRST_LINE=$(head -n 1 "$REQUIREMENTS_FILE")
if [ "$FIRST_LINE" != "$DOT" ]; then
echo "Adding '.' to the top of $REQUIREMENTS_FILE"
(echo "$DOT" && cat "$REQUIREMENTS_FILE") > "$REQUIREMENTS_FILE.tmp"
if [ "$FIRST_LINE" != "$TAR_FILE" ]; then
echo "Adding $TAR_FILE to the top of $REQUIREMENTS_FILE"
(echo "$TAR_FILE" && cat "$REQUIREMENTS_FILE") > "$REQUIREMENTS_FILE.tmp"
mv "$REQUIREMENTS_FILE.tmp" "$REQUIREMENTS_FILE"
fi
else
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

_ignore*
build
dist
dist/entrypoint
*.whl
Binary file added dist/statement_sensei-0.7.3.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ msg="# managed by release.sh"
# update the pyproject version
poetry version $new_version

# build the latest version
poetry build

# update the tauri.conf.json version
jq --arg new_version "$new_version" '.version = $new_version' tauri/src-tauri/tauri.conf.json > temp.json && mv temp.json tauri/src-tauri/tauri.conf.json

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.
dist/statement_sensei-0.7.3.tar.gz
altair==5.4.1 ; python_version >= "3.10" and python_version < "3.13" \
--hash=sha256:0ce8c2e66546cb327e5f2d7572ec0e7c6feece816203215613962f0ec1d76a82 \
--hash=sha256:0fb130b8297a569d08991fb6fe763582e7569f8a04643bbd9212436e3be04aef
Expand Down

0 comments on commit 1ee95b0

Please sign in to comment.