From 66fc159506e7b2f40feff704c53c9da39bc381cd Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 20:30:25 -0400 Subject: [PATCH 01/11] debug NotADirectoryError --- build.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 8c46c47a7..8f3270f77 100644 --- a/build.py +++ b/build.py @@ -163,7 +163,15 @@ def linux_less_specific_so_target(self: T) -> T: def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination - destination.parent.mkdir(parents=True, exist_ok=True) + try: + destination.parent.mkdir(parents=True, exist_ok=True) + except NotADirectoryError: + print('destination_root', destination_root) + print('self.source', self.source) + print('self.destination', self.destination) + print('destination', destination) + print('destination.parent', destination.parent) + raise shutil.copy(src=fspath(self.source), dst=fspath(destination)) From 447a2effa7c95d684fb8ce9299388a085f07eb2d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 20:50:58 -0400 Subject: [PATCH 02/11] empty From 0eaec417a8304f41d2d6b065bed94ceb44cedca5 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 21:28:55 -0400 Subject: [PATCH 03/11] more --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 8f3270f77..577e309d4 100644 --- a/build.py +++ b/build.py @@ -170,7 +170,8 @@ def copy(self, destination_root: pathlib.Path) -> None: print('self.source', self.source) print('self.destination', self.destination) print('destination', destination) - print('destination.parent', destination.parent) + print('destination.parent', destination.parent, destination.parent.is_dir(), destination.parent.is_file()) + print('destination.parent.iterdir()', list(destination.parent.iterdir())) raise shutil.copy(src=fspath(self.source), dst=fspath(destination)) From 3d664a25b404924b0eddae95c81049c4b929e8ea Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 21:59:43 -0400 Subject: [PATCH 04/11] or FileExistsError --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 577e309d4..4510deedc 100644 --- a/build.py +++ b/build.py @@ -165,7 +165,7 @@ def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination try: destination.parent.mkdir(parents=True, exist_ok=True) - except NotADirectoryError: + except (NotADirectoryError, FileExistsError): print('destination_root', destination_root) print('self.source', self.source) print('self.destination', self.destination) From 5a671206f9f5c1b08952e7606864d77c2fec3ab4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 22:30:39 -0400 Subject: [PATCH 05/11] tenacity --- build.py | 20 ++++++++++---------- src/pep517/local_backend.py | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/build.py b/build.py index 4510deedc..460facee5 100644 --- a/build.py +++ b/build.py @@ -21,6 +21,7 @@ import lddwrap import requests import setuptools.command.build_py +import tenacity fspath = getattr(os, 'fspath', str) @@ -161,18 +162,17 @@ def linux_less_specific_so_target(self: T) -> T: return self + @tenacity.retry( + reraise=True, + retry=tenacity.retry_if_exception_type( + (NotADirectoryError, FileExistsError), + ), + stop=tenacity.stop_after_attempt(5), + wait=tenacity.wait_fixed(5), + ) def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination - try: - destination.parent.mkdir(parents=True, exist_ok=True) - except (NotADirectoryError, FileExistsError): - print('destination_root', destination_root) - print('self.source', self.source) - print('self.destination', self.destination) - print('destination', destination) - print('destination.parent', destination.parent, destination.parent.is_dir(), destination.parent.is_file()) - print('destination.parent.iterdir()', list(destination.parent.iterdir())) - raise + destination.parent.mkdir(parents=True, exist_ok=True) shutil.copy(src=fspath(self.source), dst=fspath(destination)) diff --git a/src/pep517/local_backend.py b/src/pep517/local_backend.py index 705da4410..d5cc30308 100644 --- a/src/pep517/local_backend.py +++ b/src/pep517/local_backend.py @@ -26,6 +26,7 @@ 'requests': '', 'setuptools': '', 'sip': '', + 'tenacity': '', 'vcversioner': '', 'wheel': '', } From 17e6374a7cc73a98c3664989bed832718bc61548 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 20 Oct 2020 23:17:54 -0400 Subject: [PATCH 06/11] bring back diagnostics --- build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 460facee5..c0e9c2c31 100644 --- a/build.py +++ b/build.py @@ -172,7 +172,16 @@ def linux_less_specific_so_target(self: T) -> T: ) def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination - destination.parent.mkdir(parents=True, exist_ok=True) + try: + destination.parent.mkdir(parents=True, exist_ok=True) + except (NotADirectoryError, FileExistsError): + print('destination_root', destination_root) + print('self.source', self.source) + print('self.destination', self.destination) + print('destination', destination) + print('destination.parent', destination.parent, destination.parent.is_dir(), destination.parent.is_file()) + print('destination.parent.iterdir()', list(destination.parent.iterdir())) + raise shutil.copy(src=fspath(self.source), dst=fspath(destination)) From 992cd4b33e3a62efa722fb7f308f1e4ad7804d35 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 21 Oct 2020 09:55:21 -0400 Subject: [PATCH 07/11] Revert "bring back diagnostics" This reverts commit 17e6374a7cc73a98c3664989bed832718bc61548. --- build.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/build.py b/build.py index c0e9c2c31..460facee5 100644 --- a/build.py +++ b/build.py @@ -172,16 +172,7 @@ def linux_less_specific_so_target(self: T) -> T: ) def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination - try: - destination.parent.mkdir(parents=True, exist_ok=True) - except (NotADirectoryError, FileExistsError): - print('destination_root', destination_root) - print('self.source', self.source) - print('self.destination', self.destination) - print('destination', destination) - print('destination.parent', destination.parent, destination.parent.is_dir(), destination.parent.is_file()) - print('destination.parent.iterdir()', list(destination.parent.iterdir())) - raise + destination.parent.mkdir(parents=True, exist_ok=True) shutil.copy(src=fspath(self.source), dst=fspath(destination)) From a251c133d82bea2e4e77d8339cf527567da32f8a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 21 Oct 2020 10:24:10 -0400 Subject: [PATCH 08/11] .resolve() the patch path --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 460facee5..3fa94533e 100644 --- a/build.py +++ b/build.py @@ -872,7 +872,7 @@ def windeployqt_list_source( def patch_pyqt(configuration, qt_paths): # TODO: gee golly get this figured out properly and configured etc patch_path = ( - pathlib.Path(__file__).parent + pathlib.Path(__file__).resolve().parent / 'pluginloader.{}.patch'.format(configuration.pyqt_version) ) From 9e082b332a263a20a8544743e1d68b39048d6d24 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 21 Oct 2020 11:52:17 -0400 Subject: [PATCH 09/11] Revert "Revert "bring back diagnostics"" This reverts commit 992cd4b33e3a62efa722fb7f308f1e4ad7804d35. --- build.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 3fa94533e..4d8634d28 100644 --- a/build.py +++ b/build.py @@ -172,7 +172,16 @@ def linux_less_specific_so_target(self: T) -> T: ) def copy(self, destination_root: pathlib.Path) -> None: destination = destination_root / self.destination - destination.parent.mkdir(parents=True, exist_ok=True) + try: + destination.parent.mkdir(parents=True, exist_ok=True) + except (NotADirectoryError, FileExistsError): + print('destination_root', destination_root) + print('self.source', self.source) + print('self.destination', self.destination) + print('destination', destination) + print('destination.parent', destination.parent, destination.parent.is_dir(), destination.parent.is_file()) + print('destination.parent.iterdir()', list(destination.parent.iterdir())) + raise shutil.copy(src=fspath(self.source), dst=fspath(destination)) From 326e758e3afc4eee03a230981f40bf646291d03b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 21 Oct 2020 21:41:38 -0400 Subject: [PATCH 10/11] df -h --- build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build.py b/build.py index 4d8634d28..5147f4c4b 100644 --- a/build.py +++ b/build.py @@ -175,6 +175,7 @@ def copy(self, destination_root: pathlib.Path) -> None: try: destination.parent.mkdir(parents=True, exist_ok=True) except (NotADirectoryError, FileExistsError): + subprocess.run(['df', '-h'], check=True) print('destination_root', destination_root) print('self.source', self.source) print('self.destination', self.destination) From 1da62156c4a075a5a92217a3488f81a235cca2a4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Sun, 25 Oct 2020 15:55:45 -0400 Subject: [PATCH 11/11] maybe fix NotADirectoryError --- build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.py b/build.py index d871cd602..b34981789 100644 --- a/build.py +++ b/build.py @@ -732,14 +732,14 @@ def build(configuration: Configuration): copy_actions.add(FileCopyAction( source=qml_plugin, - destination=package_plugins, + destination=package_plugins / qml_plugin.name, )) all_copy_actions[destinations.package].add(FileCopyAction( source=qml_plugin, destination=destinations.examples.relative_to( destinations.package, - ), + ) / qml_plugin.name, )) elif configuration.platform == 'linux': designer_plugin_path = build_path / 'designer' / 'libpyqt5.so' @@ -760,14 +760,14 @@ def build(configuration: Configuration): copy_actions.add(FileCopyAction( source=qml_plugin, - destination=package_plugins, + destination=package_plugins / qml_plugin.name, )) all_copy_actions[destinations.package].add(FileCopyAction( source=qml_plugin, destination=destinations.examples.relative_to( destinations.package, - ), + ) / qml_plugin.name, )) # elif configuration.platform == 'darwin': # package_plugins = destinations.qt / 'plugins'