Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
DOC Better crosslinking of dev references
  • Loading branch information
NelleV committed Oct 29, 2016
commit 5a9f988429cee62c916d54757ceb1751859c1234
38 changes: 29 additions & 9 deletions doc/devel/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ environment is set up properly::

python tests.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is run at this stage it will spew image comparison failures, won't it? Maybe better to delay all mention of running the test until the place below where you tell how to set things up for testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my computer, it works fine at this stage. I am lucky?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not strictly problematic, but if you don't tell it to use the fixed version of freetype, you might run into a lot of image failures if all the text has shifted a bit (like say, the next versions of Debian and Fedora, which include a newer FreeType.)


You can read more about testing :ref:`testing`

You may want to consider setting up a `virtual environment
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or a `conda
environment <http://conda.pydata.org/docs/using/envs.html>`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete either this chunk about conda and virtual environments, or the one just a little bit below it. (Or consolidate them into one location.)



.. note::

Expand All @@ -58,22 +62,33 @@ You can read more about testing :ref:`testing`
every time the source code of a compiled extension is changed (for
instance when switching branches or pulling changes from upstream).

.. _nose: http://nose.readthedocs.org/en/latest/
.. _pep8: http://pep8.readthedocs.org/en/latest/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http -> https and .org -> .io for both links.


.. note::

To make sure the tests run locally:
**Additional dependencies for testing**: nose_ (version 1.0 or later),
`mock <http://www.voidspace.org.uk/python/mock/>`_ (if python < 3.3),
`Ghostscript <http://pages.cs.wisc.edu/~ghost/>`_, `Inkscape
<http://inkscape.org>`_

.. note:: To make sure the tests run locally:

* Copy setup.cfg.template to setup.cfg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the env approach here is better, it will survive git clean -xfd. export MPLLOCALFREETYPE=1 is in my bashrc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what you are referring too.
I actually never had to do this to have the tests run on my computer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that env is set to anything 'true-ish' during python setup.py build it has the same effect as setting this value in setup.cfg and we will pull down the correct freetype, build it, and then link against our version instead of what ever is available on the system.

* Edit setup.cfg to set `test` to True, and `local_freetype` to True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be double-backticks, right?

* If you have build matplotlib previously, remove the build folder.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build -> built, for the first one.

* Execute the build command.

<<<<<<< 8301de2110774994b720461335e5923998d80c99
When working on bleeding edge packages, setting up a
`virtual environment
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or a `conda
environment <http://conda.pydata.org/docs/using/envs.html>`_ is recommended.

.. seealso::

* :ref:`testing`
* :ref:`using-git`

For more information on using git and Github, see :ref:`using-git`.

Contributing code
=================
Expand Down Expand Up @@ -118,9 +133,10 @@ and click 'Pull request' to send your changes to the maintainers for review.
You may want to consider sending an email to the mailing list for more
visibility.

If any of the above seems like magic to you, then look up the
`Git documentation <https://git-scm.com/documentation>`_ and our
:ref:`development-workflow`.
.. seealso::

* `Git documentation <https://git-scm.com/documentation>`_
* :ref:`development-workflow`.

Contributing pull requests
--------------------------
Expand All @@ -136,7 +152,7 @@ rules before submitting a pull request:
usage presented as doctests when appropriate. Use the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we actually using doctests anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh… maybe not. I was actually wondering yesterady if the docstrings were tested, or even just simply run to verify the code actually runs.

`numpy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_

* Formatting should follow `PEP8
* Formatting should follow `PEP8 recommandation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp a-> e : recommendation

<http://www.python.org/dev/peps/pep-0008/>`_. You should consider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http -> https

installing/enabling automatic PEP8 checking in your editor. Part of the
test suite is checking PEP8 compliance, things go smoother if the code is
Expand Down Expand Up @@ -199,7 +215,11 @@ tools:
direction.


More on :ref:`coding_guidelines`
.. seealso::

* :ref:`coding_guidelines`
* :ref:`testing`
* :ref:`documenting-matplotlib`

.. _other_ways_to_contribute:

Expand Down