Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Nov 7, 2022
2 parents afffedd + 6b24c18 commit ffb31d5
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions scripts/update_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Update package on pypi server

# check for flake8 and twine and install if not present
if ! [ -x "$(command -v flake8)" ]; then
echo 'Error: flake8 is not installed.' >&2
echo 'Installing flake8...'
pip install flake8
fi

if ! [ -x "$(command -v twine)" ]; then
echo 'Error: twine is not installed.' >&2
echo 'Installing twine...'
pip install twine
fi

# check for setup.py
if ! [ -f "setup.py" ]; then
echo 'Error: setup.py is not found.' >&2
exit 1
fi


# run sdists and wheels
python3 setup.py sdist bdist_wheel

# check for dist folder
if ! [ -d "dist" ]; then
echo 'Error: dist folder is not found.' >&2
exit 1
fi


read -p "Do you want to upload to pypi? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
python3 -m twine upload dist/*
fi


# remove dist folder
rm -rf dist

# remove build folder
rm -rf build

# remove .egg-info folder
rm -rf *.egg-info

# remove .pyc files
find . -name "*.pyc" -exec rm -rf {} \;

0 comments on commit ffb31d5

Please sign in to comment.