def test_maskespec_basic(tmpdir, monkeypatch): py = tmpdir.join('abcd.py').ensure() print(); print(py) spec = tmpdir.join('abcd.spec') monkeypatch.setattr('sys.argv', ['foobar', str(py)]) # changing cwd does not work, since DEFAULT_SPECPATH is set *very* early monkeypatch.setattr('PyInstaller.building.makespec.DEFAULT_SPECPATH', str(tmpdir)) makespec.run() assert spec.exists() text = spec.read_text('utf-8') assert 'Analysis' in text
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- # This utility is primary meant to be used when PyInstaller is not # installed, eg. when be run by a git checkout. from PyInstaller.utils.cliutils.makespec import run run()