From 6ac629352ad956df35cfda37cf5078271ffd694e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 13 May 2015 12:21:04 -0400 Subject: [PATCH 1/5] Trying to get Travis CI to ignore the pythonocc branch This branch will be broken for some time, and we don't need the build status of the entire repo failing because of it. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 45600a2..81ba29e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,7 @@ script: after_success: - coveralls + +branches: + except: + - pythonocc From d36e5a10b7cd895fe7645de704d65858ccde84d1 Mon Sep 17 00:00:00 2001 From: moeb Date: Fri, 15 May 2015 12:50:39 +0200 Subject: [PATCH 2/5] fixes https://github.com/jmwright/cadquery-freecad-module/issues/53 and adds freecads library path for archlinux --- cadquery/freecad_impl/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index ac73b1e..46d6c64 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -39,6 +39,7 @@ def _fc_path(): "/usr/lib/freecad/lib", "/opt/freecad/lib/", "/usr/bin/freecad/lib", + "/usr/lib/freecad", ]: if os.path.exists(_PATH): return _PATH @@ -94,5 +95,11 @@ def _fc_path(): if os.path.exists(_PATH): return _PATH -#Make sure that the correct FreeCAD path shows up in Python's system path -sys.path.insert(0, _fc_path()) + +try: + import FreeCAD +except ImportError: + #Make sure that the correct FreeCAD path shows up in Python's system path + path = _fc_path() + if path: sys.path.insert(0, _fc_path()) + else: raise ImportError('cadquery was unable to determine freecads library path') From 205a6ef01ac7737d55f550947c9421df69904cb6 Mon Sep 17 00:00:00 2001 From: moeb Date: Fri, 15 May 2015 13:12:40 +0200 Subject: [PATCH 3/5] a little improvement to https://github.com/dcowden/cadquery/pull/87 --- cadquery/freecad_impl/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index 46d6c64..338bcea 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -96,10 +96,17 @@ def _fc_path(): return _PATH + +#Make sure that the correct FreeCAD path shows up in Python's system path +no_library_path = ImportError('cadquery was unable to determine freecads library path') try: import FreeCAD except ImportError: - #Make sure that the correct FreeCAD path shows up in Python's system path path = _fc_path() - if path: sys.path.insert(0, _fc_path()) - else: raise ImportError('cadquery was unable to determine freecads library path') + if path: + sys.path.insert(0, _fc_path()) + try: + import FreeCAD + except ImportError: + raise no_library_path + else: raise no_library_path From a6a9bc66141b7892e0e156d305d8985402c653b4 Mon Sep 17 00:00:00 2001 From: moeb Date: Fri, 15 May 2015 13:26:34 +0200 Subject: [PATCH 4/5] another improvement to https://github.com/dcowden/cadquery/pull/87 wich removes multiple calls to _fc_path --- cadquery/freecad_impl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadquery/freecad_impl/__init__.py b/cadquery/freecad_impl/__init__.py index 338bcea..3e041e3 100644 --- a/cadquery/freecad_impl/__init__.py +++ b/cadquery/freecad_impl/__init__.py @@ -104,7 +104,7 @@ try: except ImportError: path = _fc_path() if path: - sys.path.insert(0, _fc_path()) + sys.path.insert(0, path) try: import FreeCAD except ImportError: From 90ca29a2ff6f85e309c74f2156810715195ea1f6 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 15 May 2015 08:13:54 -0400 Subject: [PATCH 5/5] Updates to changelog --- changes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changes.md b/changes.md index 77456e4..2445102 100644 --- a/changes.md +++ b/changes.md @@ -38,3 +38,5 @@ v0.1.9 (Unreleased) * Added CQ.sphere operation that mirrors CQ.box * Updated copyright dates * Cleaned up spelling and misc errors in docstrings + * Fixed FreeCAD import error on Arch Linux (thanks @moeb) + * Made FreeCAD import report import error instead of silently failing (thanks @moeb)