-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
59 lines (44 loc) · 1.08 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
set -e
repository="$1"
version="$2"
cwd=$(pwd)
cd `dirname $0`
if [ -z "$repository" ]; then
echo "Usage: $0 <repository> <version>"
exit 1
elif [ $repository = "pypi" ]; then
repositoryOption=""
else
repositoryOption="--repository $repository"
fi
if [ -z "$version" ]; then
echo "Usage: $0 <repository> <version>"
exit 1
fi
echo "Running poetry lock and install ..."
poetry lock --no-update
poetry install
echo "Setting package version ..."
poetry version $2
echo "__version__ = \"$2\"" > graph_diffusers/_version.py
echo "Running tests ..."
poetry run pytest tests/
echo "Running tests without torch_sparse ..."
poetry run pip uninstall -y torch_sparse
poetry run pytest tests/
echo "Running tests without torch ..."
poetry run pip uninstall -y torch
poetry run pytest tests/
echo "Restoring environment ..."
poetry install
echo "Cleaning up dist/ ..."
rm -rf dist/
echo "Publishing to $repository ..."
poetry publish $repositoryOption \
--build \
--no-interaction
git tag -m "Release $version" $version
git push origin $version
echo "Done!"
cd $cwd