Skip to content

Commit

Permalink
docs: update readme and contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jerivas committed Sep 10, 2020
1 parent 42a2eff commit 47cd479
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
52 changes: 36 additions & 16 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
Please note the following instructions for opening an issue:
Thank you for your interest in contributing to this project!

* If you're confident you've identified a bug, or have already written a
patch, feel free to open an issue or pull request. Otherwise, please discuss
on the `mezzanine-users <http://groups.google.com/group/mezzanine-users/topics>`_ mailing list first.
* Contributed code must be written in the existing style. For Python
(and to a decent extent, JavaScript as well), this is as simple as
following the `Django coding style <https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/>`_ and (most importantly)
`PEP 8 <http://www.python.org/dev/peps/pep-0008/>`_. Front-end CSS should adhere to the
`Bootstrap CSS guidelines <https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#css>`_.
* For large features or bug fixes it's always a good idea to open an issue before you start developing your solution. This way the right approach and ideas can be discussed upfront instead of after spending time and energy developing it.
* Contributions must be made available on a separately named branch,
based on the latest version of the master branch.
* Run the tests before committing your changes. If your changes
cause the tests to break, they won't be accepted.
* If you are adding new functionality, you must include basic tests
and documentation.
* Please add your name to the end of the AUTHORS file as part of your pull
request.

Tests can be run using::
Testing
-------

./setup.py test
After cloning the repository and working on your contribution, install the extra testing requirements and run ``pytest``.

Or specified tests using::
.. code-block:: bash
./mezzanine/bin/runtests.py mezzanine.core.tests.CoreTests
pip install -e ".[testing]"
pytest
* If you are adding new functionality, you must include basic tests
and documentation.
* Please add your name to the end of the AUTHORS file as part of your pull
request.
Since the test suite is quite big you may want to run only a specific test case:

.. code-block:: bash
# Test the "galleries" app only
pytest tests/test_galleries.py
Code Style
----------

Python code style is enforced with ``flake8`` and ``black``. You can install and run both as follows:

.. code-block:: bash
pip install -e ".[codestyle]"
black . --check # Omit the flag to have black autofix errors
flake8 .
If your editor is configured to integrate with ``black`` and ``flake8`` it should pick up the project's configuration automatically.

Continous Integration
---------------------

When you are ready to contribute your changes `create and submit a pull request <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request>`_ against the ``master`` branch. This will run all tests in all supported Python and Django versions and alert you if any of them fail.
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.. image:: https://secure.travis-ci.org/stephenmcd/mezzanine.png?branch=master
:target: http://travis-ci.org/stephenmcd/mezzanine
.. image:: https://img.shields.io/pypi/v/mezzanine.svg
:target: https://pypi.org/project/mezzanine/
.. image:: https://img.shields.io/pypi/pyversions/mezzanine.svg
.. image:: https://github.com/stephenmcd/mezzanine/workflows/Test%20and%20release/badge.svg
:target: https://github.com/stephenmcd/mezzanine/actions?query=workflow%3A%22Test+and+release%22
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

Created by `Stephen McDonald <http://twitter.com/stephen_mcd>`_

Expand Down

0 comments on commit 47cd479

Please sign in to comment.