Skip to content

Commit

Permalink
fix DoH, DoQ not working in Windows binaries ( #185 )
Browse files Browse the repository at this point in the history
  • Loading branch information
URenko committed Aug 30, 2024
1 parent 17cebb8 commit 5ab7bee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install pyinstaller "dnspython[doh,doq]<2.6" rich
pip install pyinstaller dnspython[doh,doq] rich
pip install -r requirements.txt
- name: Package Application
run: |
Expand Down
18 changes: 14 additions & 4 deletions accesser.spec
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# -*- mode: python -*-
import os, tld
import os, tld, importlib, importlib.metadata
from packaging.requirements import Requirement
from PyInstaller.utils.hooks import copy_metadata

block_cipher = None

datas=[
('accesser/config.toml', 'accesser'),
('accesser/pac', 'accesser'),
(os.path.dirname(tld.__file__)+'/res/effective_tld_names.dat.txt', 'tld/res'),
]

for req in importlib.metadata.requires('dnspython'):
package_name = Requirement(req).name
if importlib.util.find_spec(package_name) is not None:
datas += copy_metadata(package_name, recursive=True)

a = Analysis(['accesser/__main__.py'],
pathex=['./'],
binaries=[],
datas=[('accesser/config.toml', 'accesser'),
('accesser/pac', 'accesser'),
(os.path.dirname(tld.__file__)+'/res/effective_tld_names.dat.txt', 'tld/res')],
datas=datas,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
Expand Down

0 comments on commit 5ab7bee

Please sign in to comment.