mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-07 17:29:50 +00:00
Update Packaging
- Add changes from OSX build to local hscommon/build.py - Update package.py & srcpkg.sh - Remove invalid submodule references - Update srcpkg.sh to use xz - Update package.py pyinstaller configuration - Call PyInstaller inline - Add --noconfirm option to be more script friendly - Add UCRT Redist location to path should fix #545 as now all the dlls are included
This commit is contained in:
parent
7ba8aa3514
commit
de8a0a21b2
@ -393,7 +393,11 @@ class TestCaseGetMatches:
|
|||||||
eq_(getmatches([]), [])
|
eq_(getmatches([]), [])
|
||||||
|
|
||||||
def test_simple(self):
|
def test_simple(self):
|
||||||
itemList = [NamedObject("foo bar"), NamedObject("bar bleh"), NamedObject("a b c foo")]
|
itemList = [
|
||||||
|
NamedObject("foo bar"),
|
||||||
|
NamedObject("bar bleh"),
|
||||||
|
NamedObject("a b c foo"),
|
||||||
|
]
|
||||||
r = getmatches(itemList)
|
r = getmatches(itemList)
|
||||||
eq_(2, len(r))
|
eq_(2, len(r))
|
||||||
m = first(m for m in r if m.percentage == 50) # "foo bar" and "bar bleh"
|
m = first(m for m in r if m.percentage == 50) # "foo bar" and "bar bleh"
|
||||||
@ -514,7 +518,11 @@ class TestCaseGetMatches:
|
|||||||
sys.setrecursionlimit(1000)
|
sys.setrecursionlimit(1000)
|
||||||
|
|
||||||
def test_min_match_percentage(self):
|
def test_min_match_percentage(self):
|
||||||
itemList = [NamedObject("foo bar"), NamedObject("bar bleh"), NamedObject("a b c foo")]
|
itemList = [
|
||||||
|
NamedObject("foo bar"),
|
||||||
|
NamedObject("bar bleh"),
|
||||||
|
NamedObject("a b c foo"),
|
||||||
|
]
|
||||||
r = getmatches(itemList, min_match_percentage=50)
|
r = getmatches(itemList, min_match_percentage=50)
|
||||||
eq_(1, len(r)) # Only "foo bar" / "bar bleh" should match
|
eq_(1, len(r)) # Only "foo bar" / "bar bleh" should match
|
||||||
|
|
||||||
|
@ -480,7 +480,10 @@ def copy_embeddable_python_dylib(dst):
|
|||||||
|
|
||||||
def collect_stdlib_dependencies(script, dest_folder, extra_deps=None):
|
def collect_stdlib_dependencies(script, dest_folder, extra_deps=None):
|
||||||
sysprefix = sys.prefix # could be a virtualenv
|
sysprefix = sys.prefix # could be a virtualenv
|
||||||
real_lib_prefix = sysconfig.get_config_var("LIBDEST")
|
basesysprefix = sys.base_prefix # seems to be path to non-virtual sys
|
||||||
|
real_lib_prefix = sysconfig.get_config_var(
|
||||||
|
"LIBDEST"
|
||||||
|
) # leaving this in case it is neede
|
||||||
|
|
||||||
def is_stdlib_path(path):
|
def is_stdlib_path(path):
|
||||||
# A module path is only a stdlib path if it's in either sys.prefix or
|
# A module path is only a stdlib path if it's in either sys.prefix or
|
||||||
@ -490,7 +493,11 @@ def collect_stdlib_dependencies(script, dest_folder, extra_deps=None):
|
|||||||
return False
|
return False
|
||||||
if "site-package" in path:
|
if "site-package" in path:
|
||||||
return False
|
return False
|
||||||
if not (path.startswith(sysprefix) or path.startswith(real_lib_prefix)):
|
if not (
|
||||||
|
path.startswith(sysprefix)
|
||||||
|
or path.startswith(basesysprefix)
|
||||||
|
or path.startswith(real_lib_prefix)
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -508,6 +515,10 @@ def collect_stdlib_dependencies(script, dest_folder, extra_deps=None):
|
|||||||
"lib/python3."
|
"lib/python3."
|
||||||
) # we want to get rid of that lib/python3.x part
|
) # we want to get rid of that lib/python3.x part
|
||||||
relpath = relpath[len("lib/python3.X/") :]
|
relpath = relpath[len("lib/python3.X/") :]
|
||||||
|
elif p.startswith(basesysprefix):
|
||||||
|
relpath = op.relpath(p, basesysprefix)
|
||||||
|
assert relpath.startswith("lib/python3.")
|
||||||
|
relpath = relpath[len("lib/python3.X/") :]
|
||||||
else:
|
else:
|
||||||
raise AssertionError()
|
raise AssertionError()
|
||||||
if relpath.startswith(
|
if relpath.startswith(
|
||||||
|
38
package.py
38
package.py
@ -133,17 +133,6 @@ def package_source_txz():
|
|||||||
build_path = op.join(base_path, "build")
|
build_path = op.join(base_path, "build")
|
||||||
dest = op.join(build_path, name)
|
dest = op.join(build_path, name)
|
||||||
print_and_do("git archive -o {} HEAD".format(dest))
|
print_and_do("git archive -o {} HEAD".format(dest))
|
||||||
# Now, we need to include submodules
|
|
||||||
SUBMODULES = ["hscommon", "qtlib"]
|
|
||||||
for submodule in SUBMODULES:
|
|
||||||
print("Adding submodule {} to archive".format(submodule))
|
|
||||||
os.chdir(submodule)
|
|
||||||
archive_path = op.join(build_path, "{}.tar".format(submodule))
|
|
||||||
print_and_do(
|
|
||||||
"git archive -o {} --prefix {}/ HEAD".format(archive_path, submodule)
|
|
||||||
)
|
|
||||||
os.chdir(base_path)
|
|
||||||
print_and_do("tar -A {} -f {}".format(archive_path, dest))
|
|
||||||
print_and_do("xz {}".format(dest))
|
print_and_do("xz {}".format(dest))
|
||||||
|
|
||||||
|
|
||||||
@ -155,6 +144,10 @@ def package_windows():
|
|||||||
version_array = match.group(0).split(".")
|
version_array = match.group(0).split(".")
|
||||||
match = re.search("[0-9]+", arch)
|
match = re.search("[0-9]+", arch)
|
||||||
bits = match.group(0)
|
bits = match.group(0)
|
||||||
|
if bits == "64":
|
||||||
|
arch = "x64"
|
||||||
|
else:
|
||||||
|
arch = "x86"
|
||||||
# include locale files if they are built otherwise exit as it will break
|
# include locale files if they are built otherwise exit as it will break
|
||||||
# the localization
|
# the localization
|
||||||
if not op.exists("build/locale"):
|
if not op.exists("build/locale"):
|
||||||
@ -179,11 +172,24 @@ def package_windows():
|
|||||||
except Exception:
|
except Exception:
|
||||||
print("Error creating version info file, exiting...")
|
print("Error creating version info file, exiting...")
|
||||||
return
|
return
|
||||||
# run pyinstaller via command line
|
# run pyinstaller from here:
|
||||||
print_and_do(
|
import PyInstaller.__main__
|
||||||
"pyinstaller -w --name=dupeguru-win{0} --icon=images/dgse_logo.ico "
|
|
||||||
'--add-data "build/locale;locale" --add-data "build/help;help" '
|
# UCRT dlls are included if the system has the windows kit installed
|
||||||
"--version-file win_version_info.txt run.py".format(bits)
|
PyInstaller.__main__.run(
|
||||||
|
[
|
||||||
|
"--name=dupeguru-win{0}".format(bits),
|
||||||
|
"--windowed",
|
||||||
|
"--noconfirm",
|
||||||
|
"--icon=images/dgse_logo.ico",
|
||||||
|
"--add-data=build/locale;locale",
|
||||||
|
"--add-data=build/help;help",
|
||||||
|
"--version-file=win_version_info.txt",
|
||||||
|
"--paths=C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{0}".format(
|
||||||
|
arch
|
||||||
|
),
|
||||||
|
"run.py",
|
||||||
|
]
|
||||||
)
|
)
|
||||||
# remove version info file
|
# remove version info file
|
||||||
os.remove("win_version_info.txt")
|
os.remove("win_version_info.txt")
|
||||||
|
@ -7,7 +7,7 @@ dest="dupeguru-src-${version}.tar"
|
|||||||
git archive -o ${dest} HEAD
|
git archive -o ${dest} HEAD
|
||||||
|
|
||||||
# Now, we need to include submodules
|
# Now, we need to include submodules
|
||||||
submodules="hscommon qtlib cocoalib"
|
submodules="cocoalib"
|
||||||
|
|
||||||
for submodule in $submodules; do
|
for submodule in $submodules; do
|
||||||
echo "Adding submodule ${submodule} to archive"
|
echo "Adding submodule ${submodule} to archive"
|
||||||
@ -17,5 +17,5 @@ for submodule in $submodules; do
|
|||||||
rm ${archive_name}
|
rm ${archive_name}
|
||||||
done
|
done
|
||||||
|
|
||||||
gzip -f ${dest}
|
xz ${dest}
|
||||||
echo "Built source package ${dest}.gz"
|
echo "Built source package ${dest}.xz"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user