@@ -25,20 +25,54 @@ it takes a bit longer. For more details, read below.
25
25
## Preparing the environment
26
26
27
27
To reformat the code, check for common problems, and
28
- run the tests, you need to prepare a
29
- [ virtual environment] ( https://docs.python.org/3/tutorial/venv.html )
30
- with the necessary libraries installed using Python 3.8 or newer.
28
+ run the tests, it can be useful to prepare a
29
+ [ virtual environment] ( https://docs.python.org/3/tutorial/venv.html ) and install
30
+ certain libraries typeshed uses to check stub files.
31
+
32
+ Follow platform-specific instructions below. Following that, to automatically
33
+ check your code before committing, you can copy the file ` pre-commit ` to
34
+ ` .git/hooks/pre-commit ` .
35
+
36
+ ### Linux/Mac OS
37
+
38
+ On Linux and Mac OS, you will be able to run the full test suite on Python 3.8
39
+ or 3.9. Running the tests on <=3.7 is not supported, and the pytype tests
40
+ [ cannot currently be run on Python 3.10] ( https://github.com/google/pytype/issues/1022 ) .
41
+
42
+ To install the necessary requirements, run the following commands from a
43
+ terminal window:
31
44
32
- To do this, run:
33
45
```
34
46
$ python3 -m venv .venv3
35
47
$ source .venv3/bin/activate
36
48
(.venv3)$ pip install -U pip
37
49
(.venv3)$ pip install -r requirements-tests-py3.txt
38
50
```
39
51
40
- To automatically check your code before committing, copy the file
41
- ` pre-commit ` to ` .git/hooks/pre-commit ` .
52
+ ### Windows
53
+
54
+ If you are using a Windows operating system, you will not be able to run the
55
+ full test suite. One option is to install
56
+ [ Windows Subsystem for Linux] ( https://docs.microsoft.com/en-us/windows/wsl/faq ) ,
57
+ which will allow you to run the full suite of tests. If you choose to install
58
+ WSL, follow the Linux/Mac OS instructions above.
59
+
60
+ If you do not wish to install WSL, you will not be able to run the pytype
61
+ tests, as pytype
62
+ [ does not currently support running on Windows] ( https://github.com/google/pytype#requirements ) .
63
+ However, the upside of this is that you will be able to run all
64
+ Windows-compatible tests on Python 3.9, 3.8 or 3.10, as it is only the pytype
65
+ tests that cannot currently be run on 3.10.
66
+
67
+ To install all non-pytype requirements on Windows without WSL, run the
68
+ following commands from a Windows terminal:
69
+
70
+ ```
71
+ > python3 -m venv .venv3
72
+ > ".venv3/Scripts/activate"
73
+ (.venv3) > python -m pip install -U pip
74
+ (.venv3) > python -m pip install -r requirements-tests-py3.txt
75
+ ```
42
76
43
77
## Where to make changes
44
78
0 commit comments