Improve instructions on how to run tests and set up a dev environment

This commit is contained in:
Dion Moult
2022-08-26 13:37:45 +10:00
parent b5f4c8218d
commit 4b4e2e1622
2 changed files with 40 additions and 18 deletions
+36 -18
View File
@@ -60,20 +60,15 @@ uninstalling the old add-on, and installing a new build is a slow process.
Although it works, it is very slow, so we do not recommend it. Although it works, it is very slow, so we do not recommend it.
A more rapid approach is to follow the **Unstable installation** method, as this A more rapid approach is to follow the **Unstable installation** method, as this
provides all dependencies for you out of the box. Then, we can replace certain provides all dependencies for you out of the box.
Python files that tend to be updated frequently with those from the Git
repository. We're going to use symlinks (Windows users can use ``mklink``), so
we can code in our Git repository, and see the changes in our Blender
installation (you will need to restart Blender to see changes).
In addition, we're also going to replace the Python code of the IfcOpenShell Once you've done this, you can replace certain Python files that tend to be
dependency with our Git repository, since most of the BlenderBIM Add-on updated frequently with those from the Git repository. We're going to use
functionality is agnostic of Blender, and is actually part of IfcOpenShell. symlinks (Windows users can use ``mklink``), so we can code in our Git
Therefore, we need to keep this dependency highly updated as well. repository, and see the changes in our Blender installation (you will need to
restart Blender to see changes).
The downside with this approach is that if a new dependency is added, or a For Linux or Mac:
compiled dependency version requirement has changed, or the build system
changes, you'll need to fix your setup manually. But this is relatively rare.
:: ::
@@ -98,7 +93,14 @@ changes, you'll need to fix your setup manually. But this is relatively rare.
$ ln -s src/ifcopenshell-python/ifcopenshell/api /path/to/blender/X.XX/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/api $ ln -s src/ifcopenshell-python/ifcopenshell/api /path/to/blender/X.XX/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/api
$ ln -s src/ifcopenshell-python/ifcopenshell/util /path/to/blender/X.XX/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/util $ ln -s src/ifcopenshell-python/ifcopenshell/util /path/to/blender/X.XX/scripts/addons/blenderbim/libs/site/packages/ifcopenshell/util
On Windows: # Manually download some third party dependencies
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/data/gantt
$ wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
$ wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema
$ wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
Or, if you're on Windows:
:: ::
@@ -123,15 +125,31 @@ On Windows:
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api" "src\ifcopenshell-python\ifcopenshell\api" $ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\api" "src\ifcopenshell-python\ifcopenshell\api"
$ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util" "src\ifcopenshell-python\ifcopenshell\util" $ mklink /D "\path\to\blender\X.XX\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\util" "src\ifcopenshell-python\ifcopenshell\util"
# Manually download some third party dependencies
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/data/gantt
$ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js -outfile jsgantt.js
$ curl https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.css -outfile jsgantt.css
$ cd /path/to/blender/X.XX/scripts/addons/blenderbim/bim/schema
$ curl https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl -outfile Brick.ttl
After you modify your code in the Git repository, you will need to restart After you modify your code in the Git repository, you will need to restart
Blender for the changes to take effect. Blender for the changes to take effect.
There is a useful Blender Addon that adds a Reboot button in File menu. The downside with this approach is that if a new dependency is added, or a
In this way, it's possible to directly restart Blender and test the modified source code. compiled dependency version requirement has changed, or the build system
The add on is available `here <https://blenderartists.org/uploads/short-url/yto1sjw7pqDRVNQzpVLmn51PEDN.zip>`__ changes, you'll need to fix your setup manually. But this is relatively rare.
(check also the related forum discussion `here <https://blenderartists.org/t/reboot-blender-addon/640465/13>`__)
There is also a VS Code called `Blender Development <https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development>`__ that has a similar functionality. .. seealso::
There is a `useful Blender Addon
<https://blenderartists.org/uploads/short-url/yto1sjw7pqDRVNQzpVLmn51PEDN.zip>`__
(see `forum thread
<https://blenderartists.org/t/reboot-blender-addon/640465/13>`__`) that adds
a Reboot button in File menu. In this way, it's possible to directly
restart Blender and test the modified source code. There is also a VS Code
add-on called `Blender Development
<https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development>`__
that has a similar functionality.
Distro installation Distro installation
@@ -122,6 +122,10 @@ and also check simple property and scene changes.
Before running these tests, follow the instructions for running tool tests Before running these tests, follow the instructions for running tool tests
above. above.
You will also need to enable the **Sun Position** add-on, as it is required to
test georeferencing features: ``Edit > Preferences > Add-ons`` and enable
**Lighting: Sun Position**.
.. code-block:: bash .. code-block:: bash
$ cd src/blenderbim/ $ cd src/blenderbim/