Skip to content

Commit e8a392f

Browse files
committed
Fix Info component
1 parent 6189b0a commit e8a392f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
* Changed `requirements.txt` to allow `numpy>=2`.
2323
* Fixed bug in `compas.geometry.Polygon.points` setter by removing duplicate points if they exist.
2424
* Fixed bug in `compas.geometry.Polygon.plane` by aligning the normal of the bestfit plane with the approximate normal of the polygon faces.
25-
* Changed the order of face vertices in `compas.geometry.Surface.to_vertices_and_faces` to a counter clockwise cycling direction and outward facing normals for curved surfaces.>>>>>>> main
25+
* Changed the order of face vertices in `compas.geometry.Surface.to_vertices_and_faces` to a counter clockwise cycling direction and outward facing normals for curved surfaces.
2626
* Deprecated the `-v8.0` flag in `compas_rhino.install`. Install to Rhino8 by following: https://compas.dev/compas/latest/userguide/cad.rhino8.html.
27+
* Fixed `Info` Grasshopper component for cpython to handle non-bootstrapped environments.
2728

2829
### Removed
2930

src/compas_ghpython/components_cpython/Compas_Info/code.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
"""
33
Displays information about the active COMPAS environment.
44
"""
5-
6-
import compas_bootstrapper
75
import Grasshopper
86

7+
import os
98
import compas
109

1110

1211
class CompasInfo(Grasshopper.Kernel.GH_ScriptInstance):
1312
def RunScript(self):
13+
try:
14+
import compas_bootstrapper
15+
environment_name = compas_bootstrapper.ENVIRONMENT_NAME
16+
except ImportError:
17+
environment_name = os.path.dirname(compas.__file__)
18+
environment_name = os.path.abspath(os.path.join(environment_name, ".."))
19+
1420
ghenv.Component.Message = "COMPAS v{}".format(compas.__version__) # noqa: F821
1521
info = "COMPAS Version: {}\nEnvironment: {}"
16-
return info.format(compas.__version__, compas_bootstrapper.ENVIRONMENT_NAME)
22+
return info.format(compas.__version__, environment_name)

0 commit comments

Comments
 (0)