Skip to content

Commit

Permalink
v2.1.0: remove git flow
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jul 21, 2016
1 parent 436324f commit 83ee9e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.rst
Expand Up @@ -5,8 +5,8 @@ PyPT Changelog
:Author: Chris Warrick <chris@chriswarrick.com>
:Copyright: © 2013-2016, Chris Warrick.
:License: BSD (see /LICENSE or :doc:`Appendix B <LICENSE>`.)
:Date: 2016-07-13
:Version: 2.0.7
:Date: 2016-07-21
:Version: 2.1.0

.. index:: CHANGELOG

Expand All @@ -19,6 +19,12 @@ More information can be found on GitHub in the `releases section
Version History
===============

2.1.0
* Get rid of ``git flow`` — users should switch their main branch to
``master`` and delete ``develop``. This simplifies development and
branching for most use cases.
* Exit on errors in ``release``

2.0.7
* Make some minor changes to CONTRIBUTING.rst
* Use Python 3.5 in Travis
Expand Down
27 changes: 13 additions & 14 deletions README.rst
Expand Up @@ -4,8 +4,8 @@ Python Project Template. INSERT TAGLINE HERE.™
:Info: This is the README file for the Python Project Template.
:Author: Chris Warrick <chris@chriswarrick.com>
:Copyright: © 2013-2016, Chris Warrick.
:Date: 2016-07-13
:Version: 2.0.7
:Date: 2016-07-21
:Version: 2.1.0

.. index: README
.. image:: https://travis-ci.org/Kwpolska/python-project-template.svg?branch=master
Expand All @@ -18,8 +18,6 @@ Requirements

* ``zsh`` installed (required by ``/release`` and ``/.pypt/localegen`` scripts)
* Python with ``cookiecutter`` (initial generation), ``requests`` (required by ``/.pypt/{commitlog,ghrel}``) and ``twine`` (required by ``/release``) installed
* `git-flow extensions by nvie <https://github.com/nvie/gitflow>`_ (alternatively you can manually alter the ``/release`` script, and that is much harder than
installing the extensions)
* A git repository. The PyPT is ready to go if you use GitHub. If you do not
want GitHub, edit the ``/PKGBUILD{,-2}{,-git}`` files and any other places
where GitHub is mentioned, including this document which you should edit
Expand Down Expand Up @@ -54,15 +52,16 @@ The template contains the following files to get you started:
* PKGBUILDs for the Arch Linux User Repository (AUR)
* A state-of-the-art ``release`` script, the operations of which are:

* querying the current branch for version number
* querying the user for version number
* updating ``/docs/CHANGELOG.rst``
* bumping the version number in all the files, changing dates where necessary
* copying over ``/docs/README.rst``, ``/docs/CHANGELOG.rst`` and ``/docs/CONTRIBUTING.rst`` to ``/``
* locale generation (via the ``.pypt/localegen`` script)
* running ``import $project`` and the testsuite
* running ``import $PROJECTLC`` and the testsuite
* uploading a source distribution and a wheel to PyPI
* committing into git, finishing the ``git flow`` release
* committing into git and tagging
* creating a GitHub Releases entry
* with hooks, updating the AUR package

Getting up to speed in 12 easy steps
====================================
Expand All @@ -76,14 +75,18 @@ Getting up to speed in 12 easy steps
2. ``/docs/CHANGELOG.rst`` to ``/CHANGELOG.rst``

5. Modify ``/.pypt/config``, if needed.
6. Generate a `GitHub Personal Access Token <https://github.com/settings/tokens>`_ and write it to a ``/.pypt/gh-token`` file.
6. Generate a `GitHub Personal Access Token <https://github.com/settings/tokens>`_
in the ``repo`` scope and write it to a ``/.pypt/gh-token`` file. You may
reuse tokens between different repos running PyPT.
7. Customize ``/setup.py`` to your liking. You should pay attention to the
classifiers and the commented-out parts.
8. Customize ``requirements.txt``.
9. If you are using PyQt or PySide, make sure to put your UI code in a ``ui``
submodule. Copy the ``pypt-extras/Qt/resources.py`` file to that
submodule, even if you are not using resources now. Make sure to create a
``.pro`` file with your sources and locales.
``.pro`` file with your sources and locales. If you want to use the AUR
package updater, copy the hook to ``.pypt/hooks`` (change its name) and
modify it to fit your AUR workflow.
10. Remove the ``pypt-extras`` directory if you don’t need anything else from it.
11. If you have a ``PYPT-UPDATE`` script, add your new project to the list
there. If not, you may want to copy it from the repository root and set it up.
Expand All @@ -92,13 +95,9 @@ Getting up to speed in 12 easy steps
source .pypt/config
git init
git remote add origin git@github.com:$GITUSER/$GITREPO
git flow init #(change version tag prefix to `v`)
git add *
git checkout develop
git commit -sm 'initial commit via @Kwpolska’s Python Project Template'
git checkout master
git merge --ff-only develop
git push -u origin master develop
git push -u origin master

COPYRIGHT
---------
Expand Down
22 changes: 4 additions & 18 deletions {{cookiecutter.repo_name}}/release
Expand Up @@ -57,20 +57,8 @@ function cleanup_cmfn {

status '*** Chris Warrick’s Release Scripts (PyPT)'

branch=$(git rev-parse --abbrev-ref HEAD)
if [[ $? != 0 ]]; then
error 'Cannot fetch the current branch.'
exit 2
fi

echo $branch | grep '^release/' > /dev/null
if [[ $? != 0 ]]; then
error 'Not on a git-flow release branch.'
status 'Run: git flow release start [version number here]'
exit 2
fi

version=$(echo $branch | sed 's|^release/||')
echo -n "Version number: "
read version

echo $version | grep '^[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}$' > /dev/null

Expand Down Expand Up @@ -196,10 +184,8 @@ cleanup
git add -A --ignore-errors . || exit $?

git commit -S -asF $cmfn2 || exit $?

git flow release finish -s -m "Version $version" $version || exit $?
git push || exit $?
git push --tags || exit $?
git tag -sm "Version $version" v$version || exit $?
git push --follow-tags origin master || exit $?

.pypt/ghrel $cmfn $PWD $GITUSER/$GITREPO v$version

Expand Down

0 comments on commit 83ee9e5

Please sign in to comment.