Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
pyinstaller-smoke.py33 linesDownload Raw Back to tests
1"""A crude *bit of everything* smoke test to verify PyInstaller compatibility.
2
3PyInstaller typically goes wrong by forgetting to package modules, extension
4modules or shared libraries. This script should aim to touch as many of those
5as possible in an attempt to trip a ModuleNotFoundError or a DLL load failure
6due to an uncollected resource. Missing resources are unlikely to lead to
7arithmetic errors so there's generally no need to verify any calculation's
8output - merely that it made it to the end OK. This script should not
9explicitly import any of numpy's submodules as that gives PyInstaller undue
10hints that those submodules exist and should be collected (accessing implicitly
11loaded submodules is OK).
12
13"""
14import numpy as np
15
16a = np.arange(1., 10.).reshape((3, 3)) % 5
17np.linalg.det(a)
18a @ a
19a @ a.T
20np.linalg.inv(a)
21np.sin(np.exp(a))
22np.linalg.svd(a)
23np.linalg.eigh(a)
24
25np.unique(np.random.randint(0, 10, 100))
26np.sort(np.random.uniform(0, 10, 100))
27
28np.fft.fft(np.exp(2j * np.pi * np.arange(8) / 8))
29np.ma.masked_array(np.arange(10), np.random.rand(10) < .5).sum()
30np.polynomial.Legendre([7, 8, 9]).roots()
31
32print("I made it!")
33 
codekingpro/portable-devtools · Team Ai