1
- Contributing to Mypy
2
- ====================
1
+ # Contributing to Mypy
3
2
4
3
Welcome! Mypy is a community project that aims to work for a wide
5
- range of Python users and Python codebases. If you're trying Mypy on
4
+ range of Python users and Python codebases. If you're trying mypy on
6
5
your Python code, your experience and what you can contribute are
7
6
important to the project's success.
8
7
8
+ ## Code of Conduct
9
9
10
- Getting started, building, and testing
11
- --------------------------------------
10
+ Everyone participating in the Mypy community, and in particular in our
11
+ issue tracker, pull requests, and chat, is expected to treat
12
+ other people with respect and more generally to follow the guidelines
13
+ articulated in the [ Python Community Code of Conduct] ( https://www.python.org/psf/codeofconduct/ ) .
12
14
13
- If you haven't already, take a look at the project's
14
- [ README.md file] ( README.md )
15
- and the [ Mypy documentation] ( https://mypy.readthedocs.io/en/latest/ ) ,
16
- and try adding type annotations to your file and type-checking it with Mypy.
17
15
16
+ ## Getting started with development
18
17
19
- Discussion
20
- ----------
18
+ ### Setup
21
19
22
- If you've run into behavior in Mypy you don't understand, or you're
23
- having trouble working out a good way to apply it to your code, or
24
- you've found a bug or would like a feature it doesn't have, we want to
25
- hear from you!
20
+ Run the following:
21
+ ```
22
+ # Clone the mypy repository
23
+ git clone https://github.com/python/mypy.git
26
24
27
- Our main forum for discussion is the project's [ GitHub issue
28
- tracker] ( https://github.com/python/mypy/issues ) . This is the right
29
- place to start a discussion of any of the above or most any other
30
- topic concerning the project.
25
+ # Enter the repository
26
+ cd mypy
31
27
32
- For less formal discussion we have a chat room on
33
- [ gitter.im] ( https://gitter.im/python/typing ) . Some Mypy core developers
34
- are almost always present; feel free to find us there and we're happy
35
- to chat. Substantive technical discussion will be directed to the
36
- issue tracker.
28
+ # Create then activate a virtual environment
29
+ python3 -m venv venv
30
+ source venv/bin/actiate
37
31
38
- (We also have an IRC channel, ` #python-mypy ` on irc.freenode.net.
39
- This is lightly used, we have mostly switched to the gitter room
40
- mentioned above.)
32
+ # Install the test requirements and the project
33
+ python3 -m pip install -r test-requirements.txt
34
+ python3 -m pip install -e .
35
+ hash -r
36
+ ```
41
37
42
- #### Code of Conduct
38
+ ### Running tests
43
39
44
- Everyone participating in the Mypy community, and in particular in our
45
- issue tracker, pull requests, and IRC channel, is expected to treat
46
- other people with respect and more generally to follow the guidelines
47
- articulated in the [ Python Community Code of
48
- Conduct] ( https://www.python.org/psf/codeofconduct/ ) .
40
+ Once setup, you should be able to run tests:
41
+ ```
42
+ python3 runtests.py
43
+ ```
44
+
45
+ To use mypy to check mypy's own code, run:
46
+ ```
47
+ python3 runtests.py self
48
+ # or equivalently:
49
+ python3 -m mypy --config-file mypy_self_check.ini -p mypy
50
+ ```
51
+
52
+ You can also use ` tox ` to run tests, for instance:
53
+ ```
54
+ tox -e py
55
+ ```
56
+
57
+ ## First time contributors
58
+
59
+ If you're looking for things to help with, browse our [ issue tracker] ( https://github.com/python/mypy/issues ) !
49
60
50
- First Time Contributors
51
- -----------------------
61
+ In particular, look for:
62
+ - [ good first issues] ( https://github.com/python/mypy/labels/good-first-issue )
63
+ - [ good second issues] ( https://github.com/python/mypy/labels/good-second-issue )
64
+ - [ documentation issues] ( https://github.com/python/mypy/labels/documentation )
52
65
53
- Mypy appreciates your contribution! If you are interested in helping improve
54
- mypy, there are several ways to get started:
66
+ It's also extremely easy to get started contributing to our sister project
67
+ [ typeshed] ( https://github.com/python/typeshed/issues ) that provides type stubs
68
+ for libraries. This is a great way to become familiar with type syntax.
55
69
56
- * Contributing to [ typeshed] ( https://github.com/python/typeshed/issues ) is a great way to
57
- become familiar with Python's type syntax.
58
- * Work on [ documentation issues] ( https://github.com/python/mypy/labels/documentation ) .
59
- * Ask on [ the chat] ( https://gitter.im/python/typing ) or on
60
- [ the issue tracker] ( https://github.com/python/mypy/issues ) about good beginner issues.
70
+ If you need help getting started, don't hesitate to ask on
71
+ [ gitter] ( https://gitter.im/python/typing ) .
61
72
62
- Submitting Changes
63
- ------------------
73
+ To get help fixing a specific issue, it's often best to comment on the issue
74
+ itself. The more details you provide about what you've tried and where you've
75
+ looked, the easier it will be for you to get help.
76
+
77
+ Interactive debuggers like ` pdb ` and ` ipdb ` are really useful for getting
78
+ started with the mypy codebase. This is a
79
+ [ useful tutorial] ( https://realpython.com/python-debugging-pdb/ ) .
80
+
81
+ ## Submitting changes
64
82
65
83
Even more excellent than a good bug report is a fix for a bug, or the
66
- implementation of a much-needed new feature. ( * ) We'd love to have
84
+ implementation of a much-needed new feature. We'd love to have
67
85
your contributions.
68
86
69
- (* ) If your new feature will be a lot of work, we recommend talking to
70
- us early -- see below.
71
-
72
87
We use the usual GitHub pull-request flow, which may be familiar to
73
88
you if you've contributed to other projects on GitHub. For the mechanics,
74
89
see [ our git and GitHub workflow help page] ( https://github.com/python/mypy/wiki/Using-Git-And-GitHub ) ,
75
90
or [ GitHub's own documentation] ( https://help.github.com/articles/using-pull-requests/ ) .
76
91
77
92
Anyone interested in Mypy may review your code. One of the Mypy core
78
93
developers will merge your pull request when they think it's ready.
79
- For every pull request, we aim to promptly either merge it or say why
80
- it's not yet ready; if you go a few days without a reply, please feel
81
- free to ping the thread by adding a new comment.
82
-
83
- For a list of mypy core developers, see the file [ CREDITS] ( CREDITS ) .
84
94
85
-
86
- Preparing Changes
87
- -----------------
88
-
89
- Before you begin: if your change will be a significant amount of work
95
+ If your change will be a significant amount of work
90
96
to write, we highly recommend starting by opening an issue laying out
91
97
what you want to do. That lets a conversation happen early in case
92
98
other contributors disagree with what you'd like to do or have ideas
@@ -113,8 +119,7 @@ You may also find other pages in the
113
119
helpful in developing your change.
114
120
115
121
116
- Core developer guidelines
117
- -------------------------
122
+ ## Core developer guidelines
118
123
119
124
Core developers should follow these rules when processing pull requests:
120
125
@@ -138,52 +143,3 @@ Core developers should follow these rules when processing pull requests:
138
143
* If the PR fixes an issue, make sure something like "Fixes #xxx." occurs
139
144
in the body of the message (not in the subject).
140
145
* Use Markdown for formatting.
141
-
142
-
143
- Issue-tracker conventions
144
- -------------------------
145
-
146
- We aim to reply to all new issues promptly. We'll assign a milestone
147
- to help us track which issues we intend to get to when, and may apply
148
- labels to carry some other information. Here's what our milestones
149
- and labels mean.
150
-
151
- ### Task priority and sizing
152
-
153
- We use GitHub "labels" ([ see our
154
- list] ( https://github.com/python/mypy/labels ) ) to roughly order what we
155
- want to do soon and less soon. There's two dimensions taken into
156
- account: ** priority** (does it matter to our users) and ** size** (how
157
- long will it take to complete).
158
-
159
- Bugs that aren't a huge deal but do matter to users and don't seem
160
- like a lot of work to fix generally will be dealt with sooner; things
161
- that will take longer may go further out.
162
-
163
- We are trying to keep the backlog at a manageable size, an issue that is
164
- unlikely to be acted upon in foreseeable future is going to be
165
- respectfully closed. This doesn't mean the issue is not important, but
166
- rather reflects the limits of the team.
167
-
168
- The ** question** label is for issue threads where a user is asking a
169
- question but it isn't yet clear that it represents something to actually
170
- change. We use the issue tracker as the preferred venue for such
171
- questions, even when they aren't literally issues, to keep down the
172
- number of distinct discussion venues anyone needs to track. These might
173
- evolve into a bug or feature request.
174
-
175
- Issues ** without a priority or size** haven't been triaged. We aim to
176
- triage all new issues promptly, but there are some issues from previous
177
- years that we haven't yet re-reviewed since adopting these conventions.
178
-
179
- ### Other labels
180
-
181
- * ** needs discussion** : This issue needs agreement on some kind of
182
- design before it makes sense to implement it, and it either doesn't
183
- yet have a design or doesn't yet have agreement on one.
184
- * ** feature** , ** bug** , ** crash** , ** refactoring** , ** documentation** :
185
- These classify the user-facing impact of the change. Specifically
186
- "refactoring" means there should be no user-facing effect.
187
- * ** topic-** labels group issues touching a similar aspect of the
188
- project, for example PEP 484 compatibility, a specific command-line
189
- option or dependency.
0 commit comments