mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2024-11-12 18:02:52 +00:00
add pyinstaller hook
This commit is contained in:
parent
46f7d13f70
commit
42f4e74c85
10
pre_edited_cs/__init__.py
Normal file
10
pre_edited_cs/__init__.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_path() -> Path:
|
||||
if getattr(sys, "frozen", False):
|
||||
file_dir = Path(getattr(sys, "_MEIPASS"))
|
||||
else:
|
||||
file_dir = Path(__file__).parent
|
||||
return file_dir
|
18
pre_edited_cs/__pyinstaller/__init__.py
Normal file
18
pre_edited_cs/__pyinstaller/__init__.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import os
|
||||
|
||||
|
||||
# Functions
|
||||
# =========
|
||||
#
|
||||
# .. _get_hook_dirs:
|
||||
#
|
||||
# get_hook_dirs
|
||||
# -------------
|
||||
#
|
||||
# Tell PyInstaller where to find hooks provided by this distribution;
|
||||
# this is referenced by the :ref:`hook registration <hook_registration>`.
|
||||
# This function returns a list containing only the path to this
|
||||
# directory, which is the location of these hooks.
|
||||
|
||||
def get_hook_dirs():
|
||||
return [os.path.dirname(__file__)]
|
5
pre_edited_cs/__pyinstaller/hook-pre-edited-cs.py
Normal file
5
pre_edited_cs/__pyinstaller/hook-pre-edited-cs.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from PyInstaller.utils.hooks import collect_data_files
|
||||
|
||||
# https://pyinstaller.readthedocs.io/en/stable/hooks.html#provide-hooks-with-package
|
||||
|
||||
datas = collect_data_files('pre_edited_cs', excludes=['__pyinstaller'])
|
18
setup.cfg
18
setup.cfg
|
@ -21,3 +21,21 @@ install_requires =
|
|||
include_package_data = True
|
||||
zip_safe = False
|
||||
python_requires = >=3.9
|
||||
|
||||
#
|
||||
# Entry Points for PyInstaller
|
||||
# ---------------------------------
|
||||
[options.entry_points]
|
||||
pyinstaller40 =
|
||||
# .. _hook_registration:
|
||||
#
|
||||
# **Hook registration**: This entry point refers to a function
|
||||
# that will be invoked with no parameters. It must return a
|
||||
# sequence of strings, each element of which provides an
|
||||
# additional absolute path to search for hooks. This is equivalent
|
||||
# to passing the ``additional-hooks-dir`` `command-line option
|
||||
# <https://pyinstaller.readthedocs.io/en/stable/usage.html#what-to-bundle-where-to-search>`_
|
||||
# to PyInstaller for each string in the sequence.
|
||||
#
|
||||
# In this project, the function is ``get_hook_dirs``.
|
||||
hook-dirs = pre_edited_cs.__pyinstaller:get_hook_dirs
|
Loading…
Reference in a new issue