aboutsummaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst112
1 files changed, 112 insertions, 0 deletions
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..85f4e6a
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,112 @@
1======================
2Python Releasing Tools
3======================
4
5This code is licensed under the MIT license.
6
7This is a suite of tools that are useful for releasing Python code for public
8or private use. There are setuptools extensions to validate various conventions
9and to perform release activities.
10
11Installation and Usage
12======================
13This package is generally not installed directly but instead listed in the
14``setup_requires`` option of the setuptools ``setup`` function. For example::
15
16 from setuptools import setup
17
18 setup(
19 name="my_clever_package",
20 version="1.0.0",
21 setup_requires=[
22 "py_release_tools",
23 ]
24 )
25
26Commands are exported as distuils commands and should be automatically
27available provided the package is installed. The tool provides the commands
28documented below and are generally run by defining a ``release`` `alias
29<http://pythonhosted.org/setuptools/setuptools.html#alias-define-shortcuts-for-commonly-used-commands>`_
30in the project's ``setup.cfg`` file. The author's typical project ``setup.cfg``
31contains these aliases::
32
33 [aliases]
34 validate = cover_tests pep8
35 release = validate increment_semver git_push sdist upload
36 release_major = validate increment_semver -M git_push sdist upload
37 release_minor = validate increment_semver -m git_push sdist upload
38
39Commands
40========
41increment_semver
42----------------
43This command will update the ``setup.py`` file version number following the
44rules of `Semantic Versioning (semver) <http://semver.org>`_. This command will
45re-write and commit the project's ``setup.py`` file. It assumes that the
46version line is formatted as such, with some amount of leading whitespace::
47
48 version="1.20.1"
49
50It will rewrite all lines that look like this in the file.
51
52The version format is::
53
54 MAJOR.MINOR.PATCH
55
56For more information check out the semver docs.
57
58Version generation increments a version component by one. By default a patch
59version is generated. Passing the ``-m`` or ``--minor`` flags to the command
60will increment the minor version and set the patch version to zero. Passing
61``-M`` or ``--major`` will increment the major version and set both the minor
62and patch versions to zero.
63
64This command will also create a tag in the git repository of format
65``release-{semver}``.
66
67git_push
68--------
69This command runs a ``git push`` command to push the ``master`` branch to the
70remote ``origin``. The command will also push tags. If your git repository
71doesn't use these naming conventions the command will fail.
72
73cover_tests
74-----------
75This command will setup python
76`coverage <https://pypi.python.org/pypi/coverage>`_ monitoring and invoke the
77setuptools ``test`` target. Coverage data will be written to ``.coverage`` in
78the same directory as the ``setup.py`` file.
79
80This command will also generate a Cobertura coverage report as ``coverage.xml``
81and an HTML report in the ``htmlcov`` folder.
82
83Failure of the tests will cause a failure of the build so it is suitable to use
84this command as a replacement for the builtin ``test`` command. This command
85also suppresses the system exit that the builtin ``test`` command generates so
86other commands can be chained after this one.
87
88pep8
89----
90This command will run a `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_
91code style validation on all Python files in the project, including the
92setup.py file.
93
94Contributing
95============
96If you would like to contribute to Pydora please visit the project's
97`GitHub page <https://github.com/mcrute/py_release_tools>`_ and open a pull
98request with your changes. To have the best experience contributing, please:
99
100* Don't break backwards compatibility of public interfaces
101* Write tests for your new feature/bug fix
102* Ensure that existing tests pass
103* Update the readme/docstrings, if necessary
104* Follow the coding style of the current code-base
105* Ensure that your code is PEP8 compliant
106* Validate that your changes work with Python 2.7+ and 3.x
107
108All code is reviewed before acceptance and changes may be requested to better
109follow the conventions of the existing API.
110
111he build system runs ``python setup.py validate`` on all supported Python
112versions. You can, and should, run this on your pull request before submitting.