__init__.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #-----------------------------------------------------------------------------
  2. # Copyright (c) 2005-2023, PyInstaller Development Team.
  3. #
  4. # Distributed under the terms of the GNU General Public License (version 2
  5. # or later) with exception for distributing the bootloader.
  6. #
  7. # The full license is in the file COPYING.txt, distributed with this software.
  8. #
  9. # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10. #-----------------------------------------------------------------------------
  11. __all__ = ('HOMEPATH', 'PLATFORM', '__version__', 'DEFAULT_DISTPATH', 'DEFAULT_SPECPATH', 'DEFAULT_WORKPATH')
  12. import os
  13. from PyInstaller import compat
  14. # Note: Keep this variable as plain string so it could be updated automatically when doing a release.
  15. __version__ = '6.21.0'
  16. # Absolute path of this package's directory. Save this early so all submodules can use the absolute path. This is
  17. # required for example if the current directory changes prior to loading the hooks.
  18. PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
  19. HOMEPATH = os.path.dirname(PACKAGEPATH)
  20. # Default values of paths where to put files created by PyInstaller. If changing these, do not forget to update the
  21. # help text for corresponding command-line options, defined in build_main.
  22. # Where to put created .spec file.
  23. DEFAULT_SPECPATH = os.getcwd()
  24. # Where to put the final frozen application.
  25. DEFAULT_DISTPATH = os.path.join(os.getcwd(), 'dist')
  26. # Where to put all the temporary files; .log, .pyz, etc.
  27. DEFAULT_WORKPATH = os.path.join(os.getcwd(), 'build')
  28. PLATFORM = compat.system + '-' + compat.architecture
  29. # Include machine name in path to bootloader for some machines (e.g., 'arm'). Explicitly avoid doing this on macOS,
  30. # where we keep universal2 bootloaders in Darwin-64bit folder regardless of whether we are on x86_64 or arm64.
  31. if compat.machine and not compat.is_darwin:
  32. PLATFORM += '-' + compat.machine
  33. # Similarly, disambiguate musl Linux from glibc Linux.
  34. if compat.is_musl:
  35. PLATFORM += '-musl'