From ac2905bc3030b1935bb723ed09294f6bb8e204c8 Mon Sep 17 00:00:00 2001
From: dh00601 <dh00601@surrey.ac.uk>
Date: Fri, 5 Nov 2021 11:52:38 +0000
Subject: [PATCH] updated development requirements and script to upload to pypi

---
 development_requirements.txt |  1 +
 upload_to_pypi.sh            | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100755 upload_to_pypi.sh

diff --git a/development_requirements.txt b/development_requirements.txt
index 231c873dc..4f93d477a 100644
--- a/development_requirements.txt
+++ b/development_requirements.txt
@@ -3,3 +3,4 @@ gitpython
 sphinx
 sphinx_autodoc_typehints
 nbsphinx
+twine
diff --git a/upload_to_pypi.sh b/upload_to_pypi.sh
new file mode 100755
index 000000000..f11f3fa0e
--- /dev/null
+++ b/upload_to_pypi.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Get current version
+VERSION_NUMBER=$(cat "VERSION")
+
+# Create dist
+echo "Creating source distribution for binarycpython-$VERSION_NUMBER"
+python setup.py sdist
+
+# Checking validity
+echo ""
+echo "Checking validity of for binarycpython-$VERSION_NUMBER source distribution:"
+twine check dist/binarycpython-$VERSION_NUMBER.tar.gz
+
+echo "Uploading binarcpython version $VERSION_NUMBER to pypi."
+read -p "Continue? y/n " -n 1 -r
+echo    # (optional) move to a new line
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+    twine upload check dist/binarycpython-$VERSION_NUMBER.tar.gz
+fi
-- 
GitLab