@@ -47,7 +47,7 @@ versions (2.x and 3.x) installed on the same system without problems.
47
47
48
48
In Ubuntu, Mint and Debian you can install Python 3 like this:
49
49
50
- $ sudo apt-get install python3
50
+ $ sudo apt-get install python3 python3-pip
51
51
52
52
For other Linux flavors, OS X and Windows, packages are available at
53
53
@@ -59,57 +59,76 @@ Quick start
59
59
60
60
Mypy can be installed using pip:
61
61
62
- $ pip install mypy-lang
62
+ $ pip3 install mypy-lang
63
63
64
- Depending on your configuration, you may have to use ` pip3 `
65
- instead:
64
+ * Note that the package name is ` mypy-lang ` , not ` mypy ` .*
66
65
67
- $ pip3 install mypy-lang
66
+ Now, if Python on your system is configured properly (else see
67
+ "Troubleshooting" below), you can type-check a program like this:
68
68
69
- If you want to contribute, first clone the mypy git repository:
69
+ $ mypy PROGRAM
70
70
71
- $ git clone https://github.com/JukkaL/mypy.git
71
+ You can always use a Python interpreter to run your statically typed
72
+ programs, even if they have type errors:
72
73
73
- Run the supplied ` setup.py ` script to install mypy:
74
+ $ python3 PROGRAM
74
75
75
- $ python3 setup.py install
76
76
77
- Replace ` python3 ` with your Python 3 interpreter. You may have to do
78
- the above as root. For example, in Ubuntu and Mac OS X:
77
+ Web site and documentation
78
+ --------------------------
79
79
80
- $ sudo python3 setup.py install
80
+ Documentation and additional information is available at the web site:
81
81
82
- This installs the ` mypy ` script and dependencies, including the
83
- ` typing ` module, to system-dependent locations. Sometimes the script
84
- directory will not be in ` PATH ` , and you have to add the target
85
- directory to ` PATH ` manually or create a symbolic link to the script.
86
- In particular, on Mac OS X, the script may be installed under
87
- ` /Library/Frameworks ` :
82
+ http://www.mypy-lang.org/
88
83
89
- /Library/Frameworks/Python.framework/Versions/<version>/bin
90
84
91
- Now, on a Unix-like system, you can type check a program like this:
85
+ Troubleshooting
86
+ ---------------
92
87
93
- $ mypy PROGRAM
88
+ Depending on your configuration, you may have to run ` pip ` like
89
+ this:
90
+
91
+ $ python3 -m pip install mypy-lang
92
+
93
+ If the ` mypy ` command isn't found after installation: After either
94
+ ` pip3 install ` or ` setup.py install ` , the ` mypy ` script and
95
+ dependencies, including the ` typing ` module, will be installed to
96
+ system-dependent locations. Sometimes the script directory will not
97
+ be in ` PATH ` , and you have to add the target directory to ` PATH `
98
+ manually or create a symbolic link to the script. In particular, on
99
+ Mac OS X, the script may be installed under ` /Library/Frameworks ` :
100
+
101
+ /Library/Frameworks/Python.framework/Versions/<version>/bin
94
102
95
103
In Windows, the script is generally installed in
96
104
` \PythonNN\Scripts ` . So, type check a program like this (replace
97
105
` \Python34 ` with your Python installation path):
98
106
99
107
C:\>\Python34\python \Python34\Scripts\mypy PROGRAM
100
108
101
- You can always use a Python interpreter to run your statically typed
102
- programs, even if they have type errors:
103
109
104
- $ python3 PROGRAM
110
+ Quick start for contributing to mypy
111
+ ------------------------------------
105
112
113
+ If you want to contribute, first clone the mypy git repository:
106
114
107
- Web site and documentation
108
- --------------------------
115
+ $ git clone https://github.com/JukkaL/mypy.git
109
116
110
- Documentation and additional information is available at the web site :
117
+ Run the supplied ` setup.py ` script to install mypy :
111
118
112
- http://www.mypy-lang.org/
119
+ $ python3 setup.py install
120
+
121
+ Replace ` python3 ` with your Python 3 interpreter. You may have to do
122
+ the above as root. For example, in Ubuntu and Mac OS X:
123
+
124
+ $ sudo python3 setup.py install
125
+
126
+ Now you can use the ` mypy ` program just as above. In case of trouble
127
+ see "Troubleshooting" above.
128
+
129
+ The mypy wiki contains some useful information for contributors:
130
+
131
+ http://www.mypy-lang.org/wiki/DeveloperGuides
113
132
114
133
115
134
Running tests and linting
@@ -131,7 +150,8 @@ run unit tests only, which run pretty quickly:
131
150
132
151
$ ./runtests.py unit-test
133
152
134
- You can run a subset of test suites by passing postive or negative filters:
153
+ You can run a subset of test suites by passing positive or negative
154
+ filters:
135
155
136
156
$ ./runtests.py lex parse -x lint -x stub
137
157
@@ -166,21 +186,21 @@ To run the linter:
166
186
Development status
167
187
------------------
168
188
169
- Mypy is work in progress and is not yet production quality ( though
170
- mypy development is already done using mypy!).
189
+ Mypy is work in progress and is not yet production quality, though
190
+ mypy development has been done using mypy for a while!
171
191
172
192
Here are some of the more significant Python features not supported
173
193
right now (but all of these will improve):
174
194
175
- - Python 2.x support not usable yet
195
+ - Python 2.x support needs polish and documentation
176
196
- properties with setters not supported
177
197
- limited metaclass support
178
198
- only a subset of Python standard library modules are supported, and some
179
199
only partially
180
200
- 3rd party module support is limited
181
201
182
202
The current development focus is to have a good coverage of Python
183
- features and the standard library (initially 3.x, and later 2.7).
203
+ features and the standard library (both 3.x and 2.7).
184
204
185
205
186
206
Issue tracker
0 commit comments