From 6e322103fe76d56afa265f53f1397960ad2f9547 Mon Sep 17 00:00:00 2001 From: Kartik Mistry Date: Tue, 13 May 2014 14:15:11 +0530 Subject: [PATCH 01/13] Add mkdist.sh 1. Add mkdist.sh from https://github.com/yokadi/yokadi.github.com/blob/master/mkdist.sh 2. Fix mkdist.sh for double quotes and other misc fixes 3. Renamed script folder to scripts --- {script => scripts}/doc.sh | 0 scripts/mkdist.sh | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) rename {script => scripts}/doc.sh (100%) create mode 100755 scripts/mkdist.sh diff --git a/script/doc.sh b/scripts/doc.sh similarity index 100% rename from script/doc.sh rename to scripts/doc.sh diff --git a/scripts/mkdist.sh b/scripts/mkdist.sh new file mode 100755 index 00000000..6b6441c2 --- /dev/null +++ b/scripts/mkdist.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +PROGNAME="$(basename "$0")" + +die() { + echo "$PROGNAME: ERROR: $*" | fold -s -w "${COLUMNS:-80}" >&2 + exit 1 +} + +log() { + echo "### $*" >&2 +} + +[ $# = 2 ] || die "USAGE: $PROGNAME " + +SRC_DIR=$(cd "$1" ; pwd) +DST_DIR=$(cd "$2" ; pwd) + +[ -d "$SRC_DIR" ] || die "Source dir '$SRC_DIR' does not exist" +[ -d "$DST_DIR" ] || die "Destination dir '$SRC_DIR' does not exist" + +WORK_DIR=$(mktemp -d "$DST_DIR/yokadi-dist.XXXXXX") + +log "Copying source" +cp -a --no-target-directory "$SRC_DIR" "$WORK_DIR" + +log "Check we are not master" +cd "$WORK_DIR" +BRANCH=$(git branch | awk '$1 == "*" { print $2 }') +[ "$BRANCH" != "master" ] || die "Source dir should point to a release branch checkout, not master!" + +log "Cleaning" +git reset --hard HEAD +git clean -q -dxf + +log "Building archives" +python setup.py -q sdist --formats=bztar,zip + +log "Unpacking .tar.bz2" +cd dist/ +YOKADI_TARBZ2=$(ls ./*.tar.bz2) +tar xf "$YOKADI_TARBZ2" + +log "Running tests" +cd "${YOKADI_TARBZ2%.tar.bz2}" +python yokadi/tests/tests.py + +log "Moving archives out of work dir" +cd "$WORK_DIR"/dist +mv ./*.tar.bz2 ./*.zip "$DST_DIR" +rm -rf "$WORK_DIR" +log "Done" From c783235cb4f6b98af088a46e86bd4e405a5051fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 30 Nov 2015 18:50:18 +0100 Subject: [PATCH 02/13] Details PyPI update a bit --- doc/release.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/release.md b/doc/release.md index b7278935..b590e0b3 100644 --- a/doc/release.md +++ b/doc/release.md @@ -49,6 +49,7 @@ Write a blog entry in `_posts/` Update version in download page (download.markdown) -## Tell the world +## Upload on PyPI -- pypi.python.org + cd download/ + twine upload yokadi-.* From 66472f9e7bd91853bc9d0bea46221a8d0a870d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 30 Nov 2015 18:52:11 +0100 Subject: [PATCH 03/13] Make sure pip install dependencies Without install_requires, pip won't install anything --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 0fb0e1f0..18cb149f 100755 --- a/setup.py +++ b/setup.py @@ -78,6 +78,12 @@ def createFileList(sourceDir, *patterns): "yokadi.ycli", "yokadi.yical", ], + # distutils does not support install_requires, but pip needs it to be + # able to automatically install dependencies + install_requires=[ + "sqlalchemy", + "python-dateutil", + ], scripts=scripts, data_files=data_files ) From 2612f6a55db42f156600b3549766a9de97a653ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 30 Nov 2015 19:16:24 +0100 Subject: [PATCH 04/13] Add missing files in MANIFEST.in --- MANIFEST.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0dab3f6d..66c4a38f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,11 +1,15 @@ +include bin/fromsrc.py include update/update*to* include update/*py include doc/*.md include man/*.1 +include icon/* +include script/* include *py include README.md include LICENSE include MANIFEST.in include version include NEWS -include yokadi +include *requirements.txt +include .travis.yml From 171dcc2e15dcef9f4bd8c4f9f9e381ca04e97457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:02:39 +0100 Subject: [PATCH 05/13] Do not specify the Python binary Makes sure we run the binary listed in the shebang --- scripts/mkdist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkdist.sh b/scripts/mkdist.sh index 6b6441c2..d026f2c0 100755 --- a/scripts/mkdist.sh +++ b/scripts/mkdist.sh @@ -35,7 +35,7 @@ git reset --hard HEAD git clean -q -dxf log "Building archives" -python setup.py -q sdist --formats=bztar,zip +./setup.py -q sdist --formats=bztar,zip log "Unpacking .tar.bz2" cd dist/ From 906f43293aa129908977028c5242e5f50f74a2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:03:10 +0100 Subject: [PATCH 06/13] Nicer quoting --- scripts/mkdist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkdist.sh b/scripts/mkdist.sh index d026f2c0..f52d08ea 100755 --- a/scripts/mkdist.sh +++ b/scripts/mkdist.sh @@ -47,7 +47,7 @@ cd "${YOKADI_TARBZ2%.tar.bz2}" python yokadi/tests/tests.py log "Moving archives out of work dir" -cd "$WORK_DIR"/dist +cd "$WORK_DIR/dist" mv ./*.tar.bz2 ./*.zip "$DST_DIR" rm -rf "$WORK_DIR" log "Done" From 1ae853508258d704f1b00975f95f63389bf9777f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:03:53 +0100 Subject: [PATCH 07/13] Remove SRC_DIR argument Now that mkdist.sh is in the Yokadi repository, it can find SRC_DIR by itself. --- scripts/mkdist.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/mkdist.sh b/scripts/mkdist.sh index f52d08ea..80a3ef76 100755 --- a/scripts/mkdist.sh +++ b/scripts/mkdist.sh @@ -12,12 +12,11 @@ log() { echo "### $*" >&2 } -[ $# = 2 ] || die "USAGE: $PROGNAME " +[ $# = 1 ] || die "USAGE: $PROGNAME " -SRC_DIR=$(cd "$1" ; pwd) -DST_DIR=$(cd "$2" ; pwd) +SRC_DIR=$(cd "$(dirname $0)/.." ; pwd) +DST_DIR=$(cd "$1" ; pwd) -[ -d "$SRC_DIR" ] || die "Source dir '$SRC_DIR' does not exist" [ -d "$DST_DIR" ] || die "Destination dir '$SRC_DIR' does not exist" WORK_DIR=$(mktemp -d "$DST_DIR/yokadi-dist.XXXXXX") From b883ac2e65b54576d39609a51f7c97e0dee142dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:09:08 +0100 Subject: [PATCH 08/13] Test the created archive - Install it with pip in a virtualenv - Run tests from the virtualenv --- scripts/mkdist.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/mkdist.sh b/scripts/mkdist.sh index 80a3ef76..53895a05 100755 --- a/scripts/mkdist.sh +++ b/scripts/mkdist.sh @@ -36,14 +36,29 @@ git clean -q -dxf log "Building archives" ./setup.py -q sdist --formats=bztar,zip -log "Unpacking .tar.bz2" +log "Installing archive" cd dist/ YOKADI_TARBZ2=$(ls ./*.tar.bz2) tar xf "$YOKADI_TARBZ2" -log "Running tests" -cd "${YOKADI_TARBZ2%.tar.bz2}" -python yokadi/tests/tests.py +ARCHIVE_DIR="$PWD/${YOKADI_TARBZ2%.tar.bz2}" + +virtualenv --python python3 "$WORK_DIR/venv" +( + . "$WORK_DIR/venv/bin/activate" + + # Install Yokadi in the virtualenv and make sure it can be started + # That ensures dependencies got installed by pip + log "Smoke test" + pip3 install "$ARCHIVE_DIR" + yokadi exit + + log "Installing extra requirements" + pip3 install -r "$ARCHIVE_DIR/extra-requirements.txt" + + log "Running tests" + "$ARCHIVE_DIR/yokadi/tests/tests.py" +) log "Moving archives out of work dir" cd "$WORK_DIR/dist" From ab1d99755a50f7a01468175c364c5ad9cf81d35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:09:33 +0100 Subject: [PATCH 09/13] Update doc now that mkdist.sh is in yokadi repository --- doc/release.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/release.md b/doc/release.md index b7278935..2d5dca2e 100644 --- a/doc/release.md +++ b/doc/release.md @@ -8,8 +8,6 @@ Ensure version is OK in "version" file Ensure NEWS file is up to date with new stuff and correct release date -Run tests - Series is major.minor (ex: 0.12) Version is major.minor.patch (ex 0.12.1) @@ -22,9 +20,14 @@ For a new release in an existing series: git checkout -In all cases: +Build archives + + ./scripts/mkdist.sh ../yokadi.github.com/download + +Tag git tag -a + git push git push --tags Bump version on master @@ -34,16 +37,11 @@ Bump version on master git commit version git push -Go back to branch in order to prepare tarballs - - git checkout - ## In yokadi.github.com checkout Ensure checkout is up to date ./updatedoc.py . - ./mkdist.sh download/ Write a blog entry in `_posts/` From b4f28cc089fe5b0c24682d39bf82fd3b79d2cebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Dec 2015 08:33:20 +0100 Subject: [PATCH 10/13] Improve release doc --- doc/release.md | 73 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/doc/release.md b/doc/release.md index 2d5dca2e..e2a6bba3 100644 --- a/doc/release.md +++ b/doc/release.md @@ -1,52 +1,91 @@ # Release check list +## Introduction + +A series is major.minor (ex: 0.12). There is a branch for each series. + +A version is major.minor.patch (ex 0.12.1). There is a tag for each version. + +This doc assumes there is a checkout of yokadi.github.com next to the checkout +of yokadi. + ## In yokadi checkout -Ensure checkout is up to date + export version= + export series= -Ensure version is OK in "version" file +### For a new series -Ensure NEWS file is up to date with new stuff and correct release date +Update `NEWS` file (add changes, check release date) -Series is major.minor (ex: 0.12) -Version is major.minor.patch (ex 0.12.1) +Ensure `version` file contains $version -For a new series: +Create branch: - git checkout -b - git push origin : + git checkout -b $series + git push -u origin $series -For a new release in an existing series: +The version in master should always be bigger than the version in release +branches, so update version in master: + + git checkout master + vi version + git commit version -m "Bump version number" + git push + git checkout - + +### For a new release in an existing series git checkout +Update `NEWS` file (add changes, check release date) + +Bump version number + + echo $version > version + git commit version -m "Getting ready for $version" + +### Common + Build archives ./scripts/mkdist.sh ../yokadi.github.com/download Tag - git tag -a + git tag -a $version -m "Releasing $version" + +Push changes + git push git push --tags -Bump version on master +Merge changes in master (so that future forward merges are simpler). Be careful +to keep version to its master value. git checkout master - vi version - git commit version + git merge --no-ff $series git push + git checkout - + +## Post on PyPI + + twine upload ../yokadi.github.com/download/yokadi-$version.* ## In yokadi.github.com checkout Ensure checkout is up to date - ./updatedoc.py . +Update documentation + + ./updatedoc.py ../yokadi . Write a blog entry in `_posts/` -Update version in download page (download.markdown) +Update version in download page (`download.md`) -## Tell the world +Publish -- pypi.python.org + git add . + git commit + git push From a3c00a22a3d8b65a25c0f709ea2de962c5aeb440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Thu, 3 Dec 2015 22:49:58 +0100 Subject: [PATCH 11/13] Getting ready for 1.0.1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 3eefcb9d..7dea76ed 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.0 +1.0.1 From 9584382341d2f43a3befc12e62effef68de696bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Thu, 3 Dec 2015 22:50:59 +0100 Subject: [PATCH 12/13] Fix path to scripts --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 66c4a38f..c9dbdfb5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,7 +4,7 @@ include update/*py include doc/*.md include man/*.1 include icon/* -include script/* +include scripts/* include *py include README.md include LICENSE From 3c3dc6636a230d613e855ae672d6f2a53495ec17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Thu, 3 Dec 2015 22:51:07 +0100 Subject: [PATCH 13/13] Update NEWS for 1.0.1 --- NEWS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 60572580..618efc36 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +v1.0.1 2015/12/03 + +- User changes: + - Make sure installing via pip installs the required dependencies + +- Developer changes: + - Improved release process + v1.0.0 2015/11/29 - User changes: