1- Contributing to Mypy
2- ====================
1+ # Contributing to Mypy
32
43Welcome! 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
65your Python code, your experience and what you can contribute are
76important to the project's success.
87
8+ ## Code of Conduct
99
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/ ) .
1214
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.
1715
16+ ## Getting started with development
1817
19- Discussion
20- ----------
18+ ### Setup
2119
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
2624
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
3127
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
3731
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+ ```
4137
42- #### Code of Conduct
38+ ### Running tests
4339
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 ) !
4960
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 )
5265
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.
5569
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 ) .
6172
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
6482
6583Even 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
6785your contributions.
6886
69- (* ) If your new feature will be a lot of work, we recommend talking to
70- us early -- see below.
71-
7287We use the usual GitHub pull-request flow, which may be familiar to
7388you if you've contributed to other projects on GitHub. For the mechanics,
7489see [ our git and GitHub workflow help page] ( https://github.com/python/mypy/wiki/Using-Git-And-GitHub ) ,
7590or [ GitHub's own documentation] ( https://help.github.com/articles/using-pull-requests/ ) .
7691
7792Anyone interested in Mypy may review your code. One of the Mypy core
7893developers 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 ) .
8494
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
9096to write, we highly recommend starting by opening an issue laying out
9197what you want to do. That lets a conversation happen early in case
9298other contributors disagree with what you'd like to do or have ideas
@@ -113,8 +119,7 @@ You may also find other pages in the
113119helpful in developing your change.
114120
115121
116- Core developer guidelines
117- -------------------------
122+ ## Core developer guidelines
118123
119124Core developers should follow these rules when processing pull requests:
120125
@@ -138,52 +143,3 @@ Core developers should follow these rules when processing pull requests:
138143 * If the PR fixes an issue, make sure something like "Fixes #xxx." occurs
139144 in the body of the message (not in the subject).
140145 * 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