File: README.md

package info (click to toggle)
pyinstaller 6.18.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,824 kB
  • sloc: python: 41,828; ansic: 12,123; makefile: 171; sh: 131; xml: 19
file content (129 lines) | stat: -rw-r--r-- 4,442 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Tests for PyInstaller
=====================

This directory contains tests for PyInstaller:

- `functional` directory contains tests where executables are created from
  Python scripts.
- `unit` directory contains simple unit tests.
- `old_suite` directory contains old structure of tests (TODO migrate all tests
  to a new structure).

Prerequisites
-------------

In order to run the tests, you will need the following Python packages/libraries
installed:

- pytest
- psutil
- execnet

The easiest way to install these (and some useful pytest add-ons) is running
```
pip install -U -r tests/requirements-tools.txt
```

Running the Tests
-----------------

To run the tests, navigate to the root directory of the PyInstaller project and
run the following command:

    py.test

Or, to speed up test runs by sending tests to multiple CPUs: (requires pytest-xdist)

    py.test -n NUM

Or, to run only the unit or functional tests, run one the following command:

    py.test tests/unit
    py.test tests/functional
    py.test tests/functional -k "not tests/functional/test_libraries.py"

Or, to run only the unit and functional tests, but not the huge library
test-suite:

    py.test tests/unit tests/functional -k "not tests/functional/test_libraries.py"


Or, to run only a particular test suite within a file, run the following
command:

    py.test tests/functional/test_basic.py -k test_pyz_as_external_file

Run all tests matching `test_ctypes_CDLL` resp. `ctypes_CDLL`:

    py.test -k test_ctypes_CDLL
    py.test -k ctypes_CDLL

Run both the onefile and ondir tests for
`test_ctypes_CDLL_find_library__nss_files`:

    py.test -k test_ctypes_CDLL_find_library__nss_files

Finally, to only run a particular test, run one of the following commands:

    py.test -k test_ctypes_CDLL_find_library__nss_files[onedir]
    py.test -k test_ctypes_CDLL_find_library__nss_files[onefile]

## Continuous Integration (CI)

Continuous integration (CI) automatically exercises all tests for all platforms
officially supported by PyInstaller.

### Python Packages

Regardless of platform or CI service, all Python packages to be tested should
be listed in `test/requirements-library.txt`. Python packages required for
exercising tests (e.g., `pytest`) should instead be listed in
`test/requirements-tools.txt`.

Both files are usual pip [requirements
files](https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format)
following the respective syntax (e.g.,
[`{package_name}>={minimum_version}`](https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers).
These packages will be installed with `pip` into remote testing environments
managed by third-party CI services.

Packages only available for specific version or platforms should get an appropriate
[environment
marker](https://www.python.org/dev/peps/pep-0426/#environment-markers) like
so:
```
SomeProject ==5.4 ; python_version != '3.6'
SomeProject       ; sys_platform == 'win32'
```

### GNU/Linux

The top-level `.travis.yml` file configures the Travis-CI service to remotely
test PyInstaller in an Ubuntu 12.04 (LTS) container, the most recent GNU/Linux
distribution supported by Travis-CI.

Non-Python dependencies installable through `apt-get` on Ubuntu 12.04 should be
listed as `- `-prefixed items in the `addons:` → `apt:` → `packages:` subsection
of `.travis.yml`. Since Ubuntu 12.04 provides _no_ Python 3 packages prefixed by
`python3-`, only Python 2.7 packages prefixed by `python-` are installable by
`apt-get`. Since installing only Python 2.7 packages would be useless, Python
packages should _always_ be installed by `pip` rather than `apt-get`. See
**"Python Packages"** above.

### OS X

The top-level `.travis.yml` file of a
[separate repository](https://github.com/pyinstaller/pyinstaller-osx-tests)
configures the Travis-CI service to remotely test PyInstaller in an OS X 10.9.5
virtual machine, the most recent OS X version supported by Travis-CI.

### Windows

The top-level `appveyor.yml` file configures the Appveyor service to remotely
test PyInstaller in a Windows virtual machine.

Non-Python dependencies installable through either Chocolatey (`cinst`),
PowerShell (`ps`), or WebPI (`WebpiCmd`) should be listed as `- `-prefixed items
in the `install:` section of `appveyor.yml`. See the
[official documentation](http://www.appveyor.com/docs/build-configuration#installing-additional-software)
for voluminous details.