-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added GitHub Wiki pages on adding testing/documentation to Sphinx Docs #1137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jsonvillanueva
merged 18 commits into
ManimCommunity:master
from
jsonvillanueva:wiki-to-docs
Mar 31, 2021
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a4986bc
Added precommit for black, updated contributing documentation
jsonvillanueva 84e7810
picked pre-commit version, removed redundant language_version
jsonvillanueva e9fe12b
Fix section headings
jsonvillanueva f21c2ce
Added GitHub testing/doc Wiki pages to docs
jsonvillanueva 2ada8ca
Update docs/source/contributing.rst
jsonvillanueva 722d787
Update docs/source/contributing.rst
jsonvillanueva 584fd0d
Update docs/source/contributing.rst
jsonvillanueva 4daf428
Update docs/source/contributing.rst
jsonvillanueva 7d607f5
Update docs/source/contributing.rst
jsonvillanueva 22611f8
Update docs/source/contributing.rst
jsonvillanueva 2d9aa07
Update docs/source/contributing.rst
jsonvillanueva ebf08ef
Merge branch 'precommit' of github.com:jsonvillanueva/manim into wiki…
jsonvillanueva 821dad4
Merge branch 'master' of github.com:ManimCommunity/manim into wiki-to…
jsonvillanueva 91c19d1
Fixed some relative links
jsonvillanueva 6ce35d1
Merge branch 'master' of github.com:ManimCommunity/manim into wiki-to…
jsonvillanueva a944e09
Fixed flake8 issue
jsonvillanueva 0fd03a4
Apply suggestions from code review
jsonvillanueva eea8387
Merge branch 'master' into wiki-to-docs
jsonvillanueva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
Contributing | ||
############ | ||
|
||
Thank you for contributing to Manim! However you have decided to contribute | ||
Thank you for your interest in contributing to Manim! However you have decided to contribute | ||
or interact with the community, please always be civil and respect other | ||
members of the community. If you haven't read our :doc:`code of conduct<conduct>`, | ||
do so here. Manim is Free and Open Source Software (FOSS) for mathematical | ||
|
@@ -24,264 +24,11 @@ some are detailed below: | |
|
||
|
||
|
||
Manim Development Process | ||
========================= | ||
Contributing can be confusing, so here's a few guides: | ||
|
||
For first-time contributors | ||
--------------------------- | ||
#. Install git: | ||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
For instructions see https://git-scm.com/. | ||
|
||
|
||
#. Fork the project. Go to https://github.com/ManimCommunity/manim and | ||
click the "fork" button to create your own copy of the project. You will | ||
need a GitHub account. This will allow you to make a "pull request" (PR) | ||
to the ManimCommunity repo later on. | ||
|
||
#. Clone your fork to your local computer: | ||
|
||
.. code-block:: shell | ||
|
||
git clone https://github.com/<your-username>/manim.git | ||
|
||
GitHub will provide both a SSH (``[email protected]:<your-username>/manim.git``) and | ||
HTTPS (``https://github.com/<your-username>/manim.git``) URL for cloning. | ||
You can use SSH if you have SSH keys setup. | ||
|
||
.. WARNING:: | ||
|
||
Do not clone the ManimCommunity repository. You must clone your own | ||
fork. | ||
|
||
#. Change the directory to enter the project folder: | ||
|
||
.. code-block:: shell | ||
|
||
cd manim | ||
|
||
#. Add the upstream repository, ManimCommunity: | ||
|
||
.. code-block:: shell | ||
|
||
git remote add upstream https://github.com/ManimCommunity/manim.git | ||
|
||
#. Now, ``git remote -v`` should show two remote repositores named: | ||
|
||
- ``origin``, your forked repository | ||
- ``upstream`` the ManimCommunity repository | ||
|
||
#. Install Manim: | ||
|
||
- See our :doc:`instructions for developers<installation/for_dev>` for | ||
details and continue here afterwards. | ||
|
||
#. Install Pre-Commit (recommended): | ||
|
||
.. code-block:: shell | ||
|
||
poetry run pre-commit install | ||
|
||
This is optional and will ensure during development that each of your | ||
commit is properly formatted against our formatter, ``black``. | ||
|
||
You are now ready to work on manim! | ||
|
||
Develop your contribution | ||
------------------------- | ||
|
||
#. Checkout your local repository's master branch and pull the latest | ||
changes from ManimCommunity, `upstream`, into your local repository: | ||
|
||
.. code-block:: shell | ||
|
||
git checkout master | ||
git pull --rebase upstream master | ||
|
||
#. Create a branch for the changes you want to work on rather than working | ||
off of master: | ||
|
||
.. code-block:: shell | ||
|
||
git checkout -b <new branch name> upstream/master | ||
|
||
This ensures you can easily update your local repository's master with the | ||
first step and switch branches to work on multiple features. | ||
|
||
#. Write some awesome code! | ||
|
||
You're ready to make changes in your local repository's branch. | ||
You can add local files you've changed with in the current directory with | ||
``git add .``, or add specific files with | ||
|
||
.. code-block:: shell | ||
|
||
git add <file/directory> | ||
|
||
and commit these changes to your local history with ``git commit``. If you | ||
have installed pre-commit, your commit will succeed only if none of the | ||
hooks fail. | ||
|
||
.. tip:: | ||
|
||
When crafting commit messages, it is highly recommended that | ||
you adhere to `these guidelines <https://www.conventionalcommits.org/en/v1.0.0/>`_. | ||
|
||
#. Add new or update existing tests. | ||
|
||
Depending on your changes, you may need to update or add new tests. For new | ||
features, it is required that you include tests with your PR. Details of | ||
our testing system are explained in the `corresponding Wiki Entry <https://github.com/ManimCommunity/manim/wiki/Testing>`_. | ||
|
||
|
||
#. Update docstrings and documentation: | ||
|
||
Update the docstrings (the text in triple quotation marks) of any functions | ||
or classes you change and include them with any new functions you add. | ||
There is a `Wiki Entry for Documentation <https://github.com/ManimCommunity/manim/wiki/Documentation-guidelines-(WIP)>`_ | ||
with more information about how we prefer our code to be documented. The content | ||
of the docstrings will be rendered in the :doc:`reference manual <reference>`. | ||
|
||
.. tip:: | ||
|
||
Use the :mod:`manim directive for Sphinx <.manim_directive>` to add examples | ||
to the documentation! | ||
|
||
.. autosummary:: | ||
:toctree: reference | ||
|
||
manim_directive | ||
|
||
As far as development on your local machine goes, these are the main steps you | ||
should follow. | ||
|
||
Polishing Changes and Submitting a Pull Request | ||
----------------------------------------------- | ||
|
||
As soon as you are ready to share your local changes with the community | ||
so that they can be discussed, go through the following steps to open a | ||
pull request. A pull request signifies to the ManimCommunity organization, | ||
"Here's some changes I wrote; I think it's worthwhile for you to maintain | ||
them." | ||
|
||
.. NOTE:: | ||
|
||
You do not need to have everything (code / documentation / tests) complete | ||
to open a pull request (PR). If the PR is still under development, please | ||
mark it as a draft. Community developers will still be able to review the | ||
changes, discuss yet-to-be-implemented changes, and offer advice; however, | ||
the more complete your PR, the quicker it will be merged. | ||
|
||
#. Update your fork on GitHub to reflect your local changes: | ||
|
||
.. code-block:: shell | ||
|
||
git push -u origin <branch name> | ||
|
||
Doing so creates a new branch on your remote fork, `origin`, with the | ||
contents of your local repository on GitHub. In subsequent pushes, this | ||
local branch will track the branch `origin` and ``git push`` is enough. | ||
|
||
|
||
#. Make a pull request (PR) on GitHub. | ||
|
||
In order to make the ManimCommunity development team aware of your changes, | ||
you can make a PR to the ManimCommunity repository from your fork. | ||
|
||
.. WARNING:: | ||
|
||
Make sure to select ``ManimCommunity/manim`` instead of ``3b1b/manim`` | ||
as the base repository! | ||
|
||
Choose the branch from your fork as the head repository - see the | ||
screenshot below. | ||
|
||
.. image:: /_static/pull-requests.PNG | ||
:align: center | ||
|
||
Please make sure you follow the template (this is the default | ||
text you are shown when first opening the 'New Pull Request' page). | ||
|
||
|
||
Your changes are eligible to be merged if: | ||
|
||
#. there are no merge conflicts | ||
#. the tests in our pipeline pass | ||
#. at least one (two for more complex changes) Community Developer approves the changes | ||
|
||
You can check for merge conflicts between the current upstream/master and | ||
your branch by executing ``git pull upstream master`` locally. If this | ||
generates any merge conflicts, you need to resolve them and push an | ||
updated version of the branch to your fork of the repository. | ||
|
||
Our pipeline consists of a series of different tests that ensure | ||
that manim still works as intended and that the code you added | ||
sticks to our coding conventions. | ||
|
||
- *Code style*: We use the code style imposed | ||
by `Black <https://black.readthedocs.io/en/stable/>`_. The pipeline | ||
makes sure that the (Python) files changed in your pull request | ||
also adhere to this code style. If this step of the pipeline fails, | ||
fix your code style by running ``black <file or directory>`` to | ||
automatically format your files. | ||
|
||
- *Tests*: The pipeline runs manim's test suite on different operating systems | ||
(the latest versions of Ubuntu, MacOS, and Windows) for different versions of Python. | ||
The test suite consists of two different kinds of tests: integration tests | ||
and doctests. You can run them locally by executing ``poetry run pytest`` | ||
and ``poetry run pytest --doctest-modules manim``, respectively, from the | ||
root directory of your cloned fork. | ||
|
||
- *Documentation*: We also build a version of the documentation corresponding | ||
to your pull request. Make sure not to introduce any Sphinx errors, and have | ||
a look at the built HTML files to see whether the formatting of the documentation | ||
you added looks like you intended. You can build the documentation locally | ||
by running ``pip install -r docs/requirements.txt`` | ||
and then running ``make html``. | ||
|
||
Finally, if the pipeline passes and you are satisfied with your changes: wait for | ||
feedback and iterate over any requested changes. You will likely be asked to | ||
edit or modify your PR in one way or another during this process. This is not | ||
an indictment of your work, but rather a strong signal that the community | ||
wants to merge your changes! Once approved, your changes may be merged! | ||
|
||
Further useful guidelines | ||
========================= | ||
|
||
#. When submitting a PR, please make special note of whether your proposed | ||
changes will result in breaking changes. | ||
|
||
#. When submitting a PR, make sure that your proposed changes are as general as | ||
possible, and ready to be taken advantage of by all of manim's users. In | ||
particular, leave out any machine-specific configurations, or any personal | ||
information it may contain. | ||
|
||
#. If you are a maintainer, please label issues and PRs appropriately and | ||
frequently. | ||
|
||
#. When opening a new issue, if there are old issues that are related, link | ||
them in your new issue (even if the old ones are closed). | ||
|
||
#. When submitting a code review, it is highly recommended that you adhere to | ||
`these general guidelines <https://conventionalcomments.org/>`_. | ||
|
||
#. If you find stale or inactive issues that seem to be irrelevant, please post | ||
a comment saying 'This issue should be closed', and a community developer | ||
will take a look. | ||
|
||
#. Please do as much as possible to keep issues, PRs, and development in | ||
general as tidy as possible. | ||
|
||
|
||
You can find examples for the ``docs`` in several places: | ||
the :doc:`Example Gallery<examples>`, :doc:`Tutorials<tutorials>`, | ||
and :doc:`Reference Classes<reference>`. | ||
|
||
In case you are contributing, please have a look at this flowchart: | ||
|
||
.. raw:: html | ||
|
||
<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{"highlight":"#0000ff","nav":true,"resize":true,"toolbar":"zoom layers lightbox","edit":"_blank","url":"https://drive.google.com/uc?id=1aKyJTloYB97IhrzwqEENOu-WQyuVWMjM&export=download"}"></div> | ||
<script type="text/javascript" src="https://viewer.diagrams.net/embed2.js?&fetch=https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1aKyJTloYB97IhrzwqEENOu-WQyuVWMjM%26export%3Ddownload"></script> | ||
|
||
**Thank you for contributing!** | ||
contributing/development | ||
contributing/documentation | ||
contributing/testing |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.