Skip to content

Commit

Permalink
docs: Update readme and getting started docs
Browse files Browse the repository at this point in the history
  • Loading branch information
relekang committed Feb 9, 2020
1 parent 13bb275 commit 07b3208
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 41 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -28,3 +28,23 @@ Releases

This package is released by python-semantic-release on each master build, thus if there are changes
that should result in a new release it will happen if the build is green.


Development
~~~~~~~~~~~

Install this module and the development dependencies:

::

python setup.py develop
pip install -r requirements/dev.txt

Testing
~~~~~~~

To test your modifications locally:

::

tox
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -19,7 +19,7 @@
source_suffix = '.rst'
master_doc = 'index'
project = u'python-semantic-release'
copyright = u'2015, Rolf Erik Lekang'
copyright = u'2020, Rolf Erik Lekang'

version = semantic_release.__version__
release = semantic_release.__version__
Expand Down Expand Up @@ -63,5 +63,5 @@
epub_title = u'python-semantic-release'
epub_author = u'Rolf Erik Lekang'
epub_publisher = u'Rolf Erik Lekang'
epub_copyright = u'2015, Rolf Erik Lekang'
epub_copyright = u'2020, Rolf Erik Lekang'
epub_exclude_files = ['search.html']
5 changes: 4 additions & 1 deletion docs/configuration.rst
Expand Up @@ -3,7 +3,10 @@
Configuration
-------------

All configuration options described here can be overloaded in a ``setup.cfg`` file in a ``semantic_release`` section and/or in a ``pyproject.toml`` file in a ``[tool.semantic_release]`` section. ``pyproject.toml`` is loaded after ``setup.cfg`` and has the priority.
All configuration options described here can be overloaded in a ``setup.cfg``
file in a ``semantic_release`` section and/or in a ``pyproject.toml`` file in
a ``[tool.semantic_release]`` section. ``pyproject.toml`` is loaded after
``setup.cfg`` and has the priority.

Moreover, those configuration values can be overloaded with the ``-D`` option, like so ::

Expand Down
66 changes: 28 additions & 38 deletions readme.rst
Expand Up @@ -10,35 +10,44 @@ Budapest <https://www.youtube.com/watch?v=tc2UgG5L7WM>`__.

|Build status| |PyPI version|

Install
-------
The general idea is to be able to detect what the next version of the project
should be based on the commits. This tool will use that to automate the whole
release, upload to PyPI and upload changelogs to Github. You can run the tool
with a CI service or just run it locally.

Setup in your project
---------------------

Install it
~~~~~~~~~~

::

pip install python-semantic-release

Usage
-----

The general idea is to have some sort of tag in commit messages that
indicates certain types of changes. If a commit message lack a tag it is
ignored. Running release can be run locally or from a CI service.
Configure it
~~~~~~~~~~~~

::
There are a three different ways to configure semantic-release.
- ``[semantic_release]`` section in ``setup.cfg``
- ``[tool.semantic_release]`` section in ``pyproject.toml``
- Passing ``-D`` to the command like ``semantic-release <command> -D <option_name>=<option_value>``

The important thing to configure for all projects is where the version variable is stored. This
is used to get the current version and updating it. The config variable for that is ``version_variable``.
If your project main package is super_package and the version with name ``__version__`` variable is in
``__init__.py`` then you can set it too ``version_variable = super_package/__init__.py:__version__``.

Usage: semantic-release [OPTIONS] COMMAND
For the basic setup this should be all you need to, for further reading on supported config variables
check the `Configuration page <https://python-semantic-release.readthedocs.io/en/latest/configuration.html>`_
in the documentation

Options:
--major Force major version.
--minor Force minor version.
--patch Force patch version.
--noop No-operations mode, finds the new version number without changing it.
--post If used with the changelog command, the changelog will be posted to the release api.
--retry Retry the same release, do not bump.
--help Show this message and exit.
Run it
~~~~~~

Commands
~~~~~~~~
There is three different things you can do with this tool. Run the commands below with
``semantic-release <command>``.

- ``version`` - Create a new release. Will change the version, commit
it and tag it.
Expand Down Expand Up @@ -70,25 +79,6 @@ in `the configuration
documentation <http://python-semantic-release.readthedocs.org/en/latest/configuration.html>`__.


Development
~~~~~~~~~~~

Install this module and the development dependencies:

::

python setup.py develop
pip install -r requirements/dev.txt

Testing
~~~~~~~

To test your modifications locally:

::

tox


.. |Build status| image:: https://circleci.com/gh/relekang/python-semantic-release/tree/master.svg?style=svg
:target: https://circleci.com/gh/relekang/python-semantic-release/tree/master
Expand Down

0 comments on commit 07b3208

Please sign in to comment.