GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a PyInstaller hook to handle files correctly in PyInstaller · pythonnet/pythonnet@89a4b24

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pyproject.toml
  • pythonnet/_pyinstaller
    • __init__.py
    • hook-clr.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ email = "[email protected]"
5555
Homepage = "https://pythonnet.github.io/"
5656
Sources = "https://github.com/pythonnet/pythonnet"
5757

58+
[project.entry-points.pyinstaller40]
59+
hook-dirs = "pythonnet._pyinstaller:get_hook_dirs"
60+
5861
[tool.setuptools]
5962
zip-safe = false
6063
py-modules = ["clr"]
Collapse file

‎pythonnet/_pyinstaller/__init__.py‎

Copy file name to clipboard
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
def get_hook_dirs():
4+
return [os.path.dirname(__file__)]
Collapse file

‎pythonnet/_pyinstaller/hook-clr.py‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
2+
3+
try:
4+
binaries = collect_dynamic_libs("pythonnet")
5+
datas = collect_data_files("pythonnet")
6+
except Exception:
7+
# name conflict with https://pypi.org/project/clr/, do not crash if just clr is present
8+
binaries = []
9+
datas = []

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.