diff --git a/src/ifcbimtester/patch/model_core.patch b/src/ifcbimtester/patch/model_core.patch new file mode 100644 index 0000000000..9452fd4985 --- /dev/null +++ b/src/ifcbimtester/patch/model_core.patch @@ -0,0 +1,14 @@ +--- behave/model_core.py 2018-02-26 02:53:03.000000000 +1100 ++++ /home/dion/Projects/IfcOpenShell/src/ifcblenderexport/patch-behave-model_core.py 2021-03-21 11:57:27.625195794 +1100 +@@ -269,7 +269,10 @@ + class BasicStatement(object): + def __init__(self, filename, line, keyword, name): + filename = filename or '' +- filename = os.path.relpath(filename, os.getcwd()) # -- NEEDS: abspath? ++ try: ++ filename = os.path.relpath(filename, os.getcwd()) # -- NEEDS: abspath? ++ except ValueError: ++ pass + self.location = FileLocation(filename, line) + assert isinstance(keyword, six.text_type) + assert isinstance(name, six.text_type) diff --git a/src/ifcbimtester/patch/runner_util.patch b/src/ifcbimtester/patch/runner_util.patch new file mode 100644 index 0000000000..d6a5ba7729 --- /dev/null +++ b/src/ifcbimtester/patch/runner_util.patch @@ -0,0 +1,14 @@ +--- behave/runner_util.py 2018-02-26 02:53:03.000000000 +1100 ++++ /home/dion/Projects/IfcOpenShell/src/ifcblenderexport/patch-behave-runner_util.py 2021-03-21 11:58:29.777638958 +1100 +@@ -381,7 +381,10 @@ + locals_["__file__"] = filename + with open(filename, "rb") as f: + # pylint: disable=exec-used +- filename2 = os.path.relpath(filename, os.getcwd()) ++ try: ++ filename2 = os.path.relpath(filename, os.getcwd()) ++ except ValueError: ++ filename2 = filename + code = compile(f.read(), filename2, "exec", dont_inherit=True) + exec(code, globals_, locals_) + diff --git a/src/ifcblenderexport/Makefile b/src/ifcblenderexport/Makefile index 3eabe9d1d4..0479dc8a25 100644 --- a/src/ifcblenderexport/Makefile +++ b/src/ifcblenderexport/Makefile @@ -249,6 +249,11 @@ endif cd dist/working && wget https://files.pythonhosted.org/packages/c8/4b/d0a8c23b6c8985e5544ea96d27105a273ea22051317f850c2cdbf2029fe4/behave-1.2.6.tar.gz cd dist/working && tar -xzvf behave* cd dist/working/behave-1.2.6/ && cp -r behave ../../blenderbim/libs/site/packages/ + # See bug #1294 + cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.6.0/src/ifcbimtester/patch/model_core.patch + cd dist/working/ && wget https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.6.0/src/ifcbimtester/patch/runner_util.patch + cd dist/working/ && patch ../../blenderbim/libs/site/packages/behave/model_core.py < model_core.patch + cd dist/working/ && patch ../../blenderbim/libs/site/packages/behave/runner_util.py < runner_util.patch rm -rf dist/working # Required by behave