Skip to content

Commit 86e31f7

Browse files
committed
Define explicitely python in update_pypi.sh
1 parent 6b396ec commit 86e31f7

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ __*/
3535

3636
# Other files (generated by mkdocs-macros or others)
3737
cache*
38+
.DS_Store
3839

3940
# JetBrains PyCharm and other IntelliJ based IDEs
4041
.idea/

update_pypi.sh

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#
88
# -------------------------------------------------------------
99
function warn {
10-
GREEN='\033[0;32m'
11-
NORMAL='\033[0m'
12-
echo -e "${GREEN}$1${NORMAL}"
10+
GREEN='\033[0;32m'
11+
NORMAL='\033[0m'
12+
echo -e "${GREEN}$1${NORMAL}"
1313
}
1414

1515
function get_value {
16-
# get the value from the config file (requires the Python toml package)
17-
toml get --toml-path pyproject.toml $1
16+
# get the value from the config file (requires the Python toml package)
17+
toml get --toml-path pyproject.toml $1
1818
}
1919

2020
# Clean the subdirs, for safety and to guarantee integrity
@@ -28,19 +28,21 @@ fi
2828

2929
# get the project inform
3030
package_name=$(get_value project.name)
31-
package_version=v$(get_value project.version) # add a 'v' in front (git convention)
31+
package_version=v$(get_value project.version) # add a 'v' in front (git convention)
3232

3333
# update Pypi
3434
warn "Rebuilding $package_name..."
3535
rm -rf build dist *.egg-info # necessary to guarantee integrity
36-
python3 -m build
37-
if twine upload dist/* ; then
38-
git push # just in case
39-
warn "... create tag $package_version, and push to remote git repo..."
40-
git tag $package_version
41-
git push --tags
42-
warn "Done ($package_version)!"
36+
PYTHON=$(which python3.11)
37+
$PYTHON -m build
38+
if twine upload dist/*; then
39+
git push # just in case
40+
warn "... create tag $package_version, and push to remote git repo..."
41+
git tag $package_version
42+
git push --tags
43+
warn "Done ($package_version)!"
4344
else
44-
warn "Failed ($package_version)!"
45-
exit 1
46-
fi
45+
warn "Failed ($package_version)!"
46+
exit 1
47+
fi
48+

0 commit comments

Comments
 (0)