OLD | NEW |
(Empty) | |
| 1 .. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 |
| 2 .. For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt |
| 3 |
| 4 .. _install: |
| 5 |
| 6 ============ |
| 7 Installation |
| 8 ============ |
| 9 |
| 10 .. :history: 20100725T225600, new for 3.4. |
| 11 .. :history: 20100820T151500, updated for 3.4b1. |
| 12 .. :history: 20100906T134800, updated for 3.4b2. |
| 13 .. :history: 20110604T213400, updated for 3.5b1. |
| 14 .. :history: 20110629T082400, updated for 3.5. |
| 15 .. :history: 20110923T081900, updated for 3.5.1. |
| 16 .. :history: 20120429T162500, updated for 3.5.2b1. |
| 17 .. :history: 20120503T234000, updated for 3.5.2. |
| 18 .. :history: 20120929T093600, updated for 3.5.3. |
| 19 .. :history: 20121117T095000, Now setuptools is a pre-req. |
| 20 .. :history: 20121128T203000, updated for 3.6b1. |
| 21 .. :history: 20121223T180800, updated for 3.6b2. |
| 22 .. :history: 20121229T112400, updated for 3.6b3. |
| 23 .. :history: 20130105T174400, updated for 3.6. |
| 24 .. :history: 20131005T210600, updated for 3.7. |
| 25 .. :history: 20131212T213500, updated for 3.7.1. |
| 26 .. :history: 20140927T102700, updated for 4.0a1. |
| 27 |
| 28 |
| 29 .. highlight:: console |
| 30 |
| 31 .. _coverage_pypi: http://pypi.python.org/pypi/coverage |
| 32 .. _setuptools: http://pypi.python.org/pypi/setuptools |
| 33 .. _Distribute: http://packages.python.org/distribute/ |
| 34 |
| 35 |
| 36 Installing coverage.py is done in the usual ways. The simplest way is with |
| 37 pip:: |
| 38 |
| 39 $ pip install coverage |
| 40 |
| 41 .. ifconfig:: prerelease |
| 42 |
| 43 To install a pre-release version, you will need to specify ``--pre``:: |
| 44 |
| 45 $ pip install --pre coverage |
| 46 |
| 47 |
| 48 The alternate old-school technique is: |
| 49 |
| 50 #. Install (or already have installed) `setuptools`_ or `Distribute`_. |
| 51 |
| 52 #. Download the appropriate kit from the |
| 53 `coverage.py page on the Python Package Index`__. |
| 54 |
| 55 #. Run ``python setup.py install``. |
| 56 |
| 57 .. __: coverage_pypi_ |
| 58 |
| 59 |
| 60 Installing from source |
| 61 ---------------------- |
| 62 |
| 63 Coverage.py includes a C extension for speed. If you are installing from |
| 64 source, you may need to install the python-dev support files, for example |
| 65 with:: |
| 66 |
| 67 $ sudo apt-get install python-dev |
| 68 |
| 69 or for Python 3.x:: |
| 70 |
| 71 $ sudo apt-get install python3-dev |
| 72 |
| 73 |
| 74 Installing on Windows |
| 75 --------------------- |
| 76 |
| 77 For Windows, kits are provided on the `PyPI page`__ for different versions of |
| 78 Python and different CPU architectures. These kits require that `setuptools`_ |
| 79 be installed as a pre-requisite, but otherwise are self-contained. They have |
| 80 the C extension pre-compiled so there's no need to worry about compilers. |
| 81 |
| 82 .. __: coverage_pypi_ |
| 83 |
| 84 |
| 85 Checking the installation |
| 86 ------------------------- |
| 87 |
| 88 If all went well, you should be able to open a command prompt, and see |
| 89 coverage.py installed properly: |
| 90 |
| 91 .. ifconfig:: not prerelease |
| 92 |
| 93 .. parsed-literal:: |
| 94 |
| 95 $ coverage --version |
| 96 Coverage.py, version |release|. |
| 97 Documentation at https://coverage.readthedocs.org |
| 98 |
| 99 .. ifconfig:: prerelease |
| 100 |
| 101 .. parsed-literal:: |
| 102 |
| 103 $ coverage --version |
| 104 Coverage.py, version |release|. |
| 105 Documentation at https://coverage.readthedocs.org/en/coverage-|release| |
| 106 |
| 107 You can also invoke coverage.py as a module: |
| 108 |
| 109 .. ifconfig:: not prerelease |
| 110 |
| 111 .. parsed-literal:: |
| 112 |
| 113 $ python -m coverage --version |
| 114 Coverage.py, version |release|. |
| 115 Documentation at https://coverage.readthedocs.org |
| 116 |
| 117 .. ifconfig:: prerelease |
| 118 |
| 119 .. parsed-literal:: |
| 120 |
| 121 $ python -m coverage --version |
| 122 Coverage.py, version |release|. |
| 123 Documentation at https://coverage.readthedocs.org/en/coverage-|release| |
OLD | NEW |