@@ -4,71 +4,36 @@ Thank you for contributing to Manim! However you have decided to contribute or
44interact with the community, please always be civil and respect other members
55of the community. Manim is a free open source software for mathematical
66animations, and as such we welcome ** everyone** who is interested in
7- mathematics, pedagogy, computer animations, open source, software development,
7+ mathematics, pedagogy, computer animations, open- source, software development,
88and beyond. Manim accepts contributions of many kinds, detailed below.
99
10-
11- ## Reporting bugs
12-
13- One of the best ways of contributing to Manim is by reporting bugs. If you
14- have encountered something that you believe is a bug, please follow these
15- steps:
16-
17- 1 . First of all, make sure you are running the latest version of manim. If
18- not, update your version and try again.
19-
20- 2 . Make sure to search for other users who may have had similar issues in the
21- past. Search the repository's issues page (don't forget to search closed
22- issues), bring it up on Discord, use sites like StackOverflow, and exercise
23- your best Google practices. If you can't find anything helpful, then go to
24- the next step.
25-
26- 3 . Make sure you can reproduce the issue, i.e. that you have some code that
27- illustrates the bug ** every time** (or at least most of the time) it is
28- executed.
29-
30- 4 . Make sure to clarify what behavior you expected, and how the actual behavior
31- differs from your expectation.
32-
33- 5 . Make sure to gather information about your environment, such as your
34- operating system, python version, and any stack traces that the code may
35- have generated (if applicable).
36-
37- 4 . Please open an issue only after you have gathered this information. When
38- submitting an issue, make sure to follow the template (this is the default
39- text you are shown when first opening the 'New Issue' page). A community
40- member will (hopefully) respond and start a conversation to address the
41- issue.
42-
43- 7 . Please give the community a reasonable amount of time before asking again,
44- or insisting on your issue. Keep in mind that everyone is a volunteer. If
45- you wait for a reasonable amount of time and you receive no response, feel
46- free to ask again.
47-
48-
49- ## Contributing code
50-
5110Many ways of contributing will involve writing, reading, testing, or
5211refactoring code. As our repository is a Fork of [ Manim by
53123b1b] ( https://github.com/3b1b/manim ) , contributing in this way can be a bit
5413confusing. Here is a short guide on how to do it.
5514
56- 1 . First, make a fork of this repository. This creates your own copy of the
57- whole codebase on GitHub.
15+ 1 . Make a fork of this repository on Github.
16+
17+ You will need an account with Github. This will allow you to make pull requests (PR)
18+ to the ManimCommunity repo later on.
5819
59- 2 . Clone the repository you forked using the command below (bash/zsh) .
20+ 2 . Clone your fork .
6021
22+ You can clone your Github fork by running:
6123 ``` sh
6224 git clone < your-fork-url>
6325 cd manim
6426 ```
65- Note: do not `git clone` the original ManimCommunity repository. You must
27+ GitHub will provide both a SSH (
` [email protected] :<your-username>/manim.git` ) and
28+ HTTPS (` https://github.com/<your-username>/manim.git ` ) URL for cloning the repo.
29+ You can use whichever one you are setup for.
30+
31+ Note: Do not ` git clone ` the original ManimCommunity repository. You must
6632 clone your own fork. After this step, there are three different
6733 repositories to keep track of: the original ManimCommunity repo, your own
6834 fork of it, and your local repository.
6935
70- 3 . You have to make ` git ` be aware of the two remote repositories, by entering
71- the commands below.
36+ 3 . Make ` git ` aware of the ManimCommunity repo.
7237
7338 ``` sh
7439 git remote add upstream https://github.com/ManimCommunity/manim.git
@@ -79,85 +44,118 @@ confusing. Here is a short guide on how to do it.
7944 (referred to as 'origin') as well as the main ManimCommunity repository
8045 (referred to as 'upstream').
8146
82- 4 . Choose the correct branch for your changes. If you are working on a branch
83- that already exists on the main repository, you can execute
47+ 4 . Choose the branch for your changes.
48+
49+ To work on the ManimCommunity master branch, you can change to it with:
8450 ``` sh
85- git checkout -b < branch-name > upstream/master
51+ git checkout -b master upstream/master
8652 ```
8753
8854 If you are starting a new branch, execute
8955 ``` sh
9056 git checkout -b < new_branch-name>
9157 ```
58+ 5 . Install manim.
59+
60+ Install the required packages and manim itself:
61+ ``` sh
62+ pip install -e .
63+ ```
64+
65+ Manim has other requirements that you will need to install,
66+ explained in the [ Installation] ( installation ) instructions.
67+
9268
93- You can now make any changes to your local repository, add them, and commit
69+ 6 . Write some awesome code!
70+
71+ You're ready to make changes in your local repository, add them, and commit
9472 them.
9573
96- 5 . To make your changes visible in your GitHub fork, instead of typing in `git
97- push` as usual, you need to enter the command below.
74+ 7 . Update docstrings and documentation.
9875
99- ``` sh
100- git push -u origin < branch-name>
101- ```
76+ You should update the docstrings (the text in triple quotation marks) of any functions
77+ or classes you change and include them with any new functions you add.
78+ There is a [ Wiki Entry for
79+ Documentation] ( https://github.com/ManimCommunity/manim/wiki//Documentation-guidelines-(WIP) )
80+ with more information about how we prefer our code to be documented.
81+
82+ You must check that the command ` make doctest ` , executed from the ` docs/ ` folder
83+ terminates without problems after your changes.
84+
85+ 8 . Add/update tests.
86+
87+ Depending on the changes you are making you will need to update or add new tests.
88+ If you have added a new feature or bug fix, it is strongly
89+ preferred that you include tests with your PR.
90+ Please check out the [ Wiki Entry for Testing] ( https://github.com/ManimCommunity/manim/wiki/Testing )
91+ to learn how our tests work.
10292
103- Doing so creates a new branch with the updated contents of your fork on
104- GitHub (the 'origin').
93+ 9 . Check for merge conflicts.
10594
106- 6 . If you want your changes to be incorporated to the main ManimCommunity
95+ If you want your changes to be incorporated to the main ManimCommunity
10796 repository, you need to make sure that there are no merge conflicts between
108- the current upstream/master and the changes you are trying to make. For
109- this purpose, please execute ` git pull upstream master ` before you push
110- changes to your fork. If this generates merge conflicts, make sure to
111- resolve them before submitting a PR.
97+ the current upstream/master and the changes you are trying to make. To do this
98+ you will need to update your local repo with any changes that have
99+ been made to the ManimCommunity repo while you've been working with
100+ ` git pull upstream master ` .
101+ This will probably generate merge conflicts that you will need to resolve.
112102
113- 7 . Further, make sure that you run the tests locally and that they all pass
114- before submitting a PR. You can run the tests locally by executing ` pytest `
115- from the main ` manim/ ` folder (do not execute pytest from the code folder
116- ` manim/manim ` ).
103+ 10 . Run the ` black ` autoformatter.
117104
118- 8 . Finally, make sure to use the ` black ` autoformatter before submitting a PR.
119- You can execute it by running ` black <your_file> ` . This will make changes
120- to your code, and you will need to add/commit those changes.
105+ You can run black on a file or directory with ` black <file_or_directory> ` to
106+ format your code to the same standard as the rest of ManimCommunity.
107+ This will make changes to your code, so you will need to add/commit those changes
108+ if you commit before running it. Most python IDE/text editors have packages for
109+ running black after every save if you would like to keep formatting consistent while
110+ you work.
121111
122- 9 . To request the ManimCommunity dev team to incorporate the changes in your
123- fork into the main repository, you can make a Pull Request to the Manim
124- Community repo from your fork. Make sure to select ` ManimCommunity/manim `
125- instead of ` 3b1b/manim ` as the ` base repository ` and your fork and branch as
126- ` head repository ` - see the picture below.
112+ 11 . Run ` pytest ` .
127113
128- ![ pull-requests-example-manim-community] ( ./_static/pull-requests.PNG )
114+ You can check that everything is still working properly after your modifications
115+ with ` pytest ` . Make sure that you run the tests locally and that they all pass
116+ before submitting a PR. ` pytest ` should be run from the main ` manim/ `
117+ folder (Not the ` manim/manim ` subfolder).
129118
130- Once again, please make sure to follow the template (this is the default
119+ 12 . Update your GitHub fork with local changes.
120+
121+ To make your changes visible in your GitHub fork, instead of typing in `git
122+ push` as usual, you need to enter the command below.
123+
124+ ``` sh
125+ git push -u origin < branch-name>
126+ ```
127+
128+ Doing so creates a new branch with the updated contents of your fork on
129+ GitHub (the ' origin' ).
130+
131+ 13. Make a Pull Request on Github.
132+
133+ To request the ManimCommunity dev team to incorporate the changes in your
134+ fork into the main repository, you can make a Pull Request to the Manim
135+ Community repo from your fork. Make sure to select `ManimCommunity/manim`
136+ instead of ` 3b1b/manim` as the ` base repository` and your fork and branch as
137+ ` head repository` - see the screenshot below.
138+
139+ ! [pull-requests-example-manim-community](./_static/pull-requests.PNG)
140+
141+ Please make sure you follow the template (this is the default
131142 text you are shown when first opening the ' New Pull Request' page)
132143
133- 10 . Once a PR is submitted, it will require at least two approving code
134- reviews from community developers, as well as all tests passing. It is
135- very likely that you will be asked to edit or modify your PR in one way or
144+ 14. Wait for feedback and make any requested changes.
145+
146+ Thank you for contributing! Once your PR is submitted, it will require at least
147+ two approving code reviews from community developers. It will also be automatically
148+ tested. These tests must all pass for the PR to be merged.
149+ You will likely be asked to edit or modify your PR in one way or
136150 another during this process. This is not an indictment of your work, but
137151 rather a strong signal that the dev community wants to merge your changes!
138152
139- Note: before submitting a PR please make sure that you update the docstrings of
140- any methods, classes, or modules that your PR modifies, if necessary.
141-
142- Note: if you are contributing new features or bug fixes, it is strongly
143- preferred that you include tests that accompany them in your PR. For this
144- purpose, you can create a new file under the ` tests/ ` folder and make sure that
145- your new tests pass before submitting your PR. Please check out the [ Wiki Entry
146- for Testing] ( https://github.com/ManimCommunity/manim/wiki/Testing ) to learn
147- more about how our tests work.
148-
149- Note: if you are contributing documentation, you must also make sure that the
150- command ` make doctest ` , executed from the ` docs/ ` folder terminates without
151- problems. Please check out the [ Wiki Entry for
152- Documentation] ( https://github.com/ManimCommunity/manim/wiki//Documentation-guidelines-(WIP) )
153- to learn more about how we prefer our code documented.
154-
155- Note: In order to open a PR, you do not need to have everything
156- (documentation/tests) complete and ready to go. However, the more complete
157- your PR is, the easier it will be for community devs to review it, and the
158- quicker it will be merged. If you open a PR that is still under development
159- and you want a quick overview or start some discussion about planned
160- yet-to-be-implemented changes, please mark your PR as a draft.
153+ Note: To open a PR, you do not need to have everything
154+ (documentation/tests) complete and ready to go. However, the more complete
155+ your PR is, the easier it will be for community devs to review it, and the
156+ quicker it will be merged. If you open a PR that is still under development
157+ and you want a quick overview or start some discussion about planned
158+ yet-to-be-implemented changes, please mark your PR as a draft.
161159
162160
163161# # Other guidelines
0 commit comments