Skip to content

Use twine for release process #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/check-dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

ROOT=$(dirname "$0")/..
SCRIPT=$(basename "$0")
Expand Down
24 changes: 15 additions & 9 deletions bin/dist-functions
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

ROOT=$(dirname "$0")/..
DIST="${ROOT}/dist"
Expand Down Expand Up @@ -52,6 +53,18 @@ function set_metadata_and_setup
grep "version\s\+=" neo4j/meta.py
echo "----------------------------------------"

function cleanup() {
# Reset to original package metadata
set_package "${ORIGINAL_PACKAGE}"
set_version "${ORIGINAL_VERSION}"
echo "Source code reconfigured back to original package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
echo "----------------------------------------"
grep "package\s\+=" neo4j/meta.py
grep "version\s\+=" neo4j/meta.py
echo "----------------------------------------"
}
trap cleanup EXIT

# Temporarily override package metadata
set_package "${PACKAGE}"
set_version "${VERSION}"
Expand All @@ -67,15 +80,8 @@ function set_metadata_and_setup
python setup.py $*
check_file "${DIST}/${PACKAGE}-${VERSION}.tar.gz"

# Reset to original package metadata
set_package "${ORIGINAL_PACKAGE}"
set_version "${ORIGINAL_VERSION}"
echo "Source code reconfigured back to original package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
echo "----------------------------------------"
grep "package\s\+=" neo4j/meta.py
grep "version\s\+=" neo4j/meta.py
echo "----------------------------------------"

trap - EXIT
cleanup
}

function setup
Expand Down
1 change: 1 addition & 0 deletions bin/make-dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

ROOT=$(dirname "$0")/..
SCRIPT=$(basename "$0")
Expand Down
1 change: 1 addition & 0 deletions bin/make-docs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

ROOT=$(dirname "$0")/..

Expand Down
35 changes: 0 additions & 35 deletions bin/make-pypirc

This file was deleted.

13 changes: 12 additions & 1 deletion bin/release
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
set -e

ROOT=$(dirname "$0")/..
SCRIPT=$(basename "$0")
TWINE_ARGS="--verbose"

if [ "$1" == "--real" ]
then
shift
else
TWINE_ARGS="${TWINE_ARGS} --repository testpypi"
fi

VERSION="$1"
if [ "${VERSION}" == "" ]
Expand All @@ -10,5 +19,7 @@ then
exit 1
else
source "${ROOT}/bin/dist-functions"
setup "${VERSION}" sdist upload -r pypi --show-response
twine upload ${TWINE_ARGS} \
"${DIST}/neo4j-driver-${VERSION}.tar.gz" \
"${DIST}/neo4j-${VERSION}.tar.gz"
fi