Skip to content

Commit 3db1437

Browse files
authored
Merge pull request #850 from compas-dev/gh_clean
Remove ghuser components on invoke clean
2 parents dd98916 + d590e27 commit 3db1437

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ data/ctralie
140140
.vscode
141141

142142
# Grasshopper generated objects
143-
src/compas_ghpython/components/*.ghuser
143+
src/compas_ghpython/components/**/*.ghuser

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
* Allow str or int as joint type in `compas.robots.Joint` constructor.
2323
* `compas_ghpython.artists.FrameArtist.draw` now draws a Rhino Plane.
24+
* Changed directory where ghuser components are installed.
25+
* Added ghuser components directory to those removed by the `clean` task.
2426
* Fixed bug in `compas.geometry.bestfit_circle_numpy`.
2527

2628
### Removed

src/compas_ghpython/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ def after_rhino_install(installed_packages):
1818
if 'compas_ghpython' not in installed_packages:
1919
return []
2020

21-
installed_objects = install_userobjects(os.path.join(os.path.dirname(__file__), 'components'))
21+
installed_objects = install_userobjects(os.path.join(os.path.dirname(__file__), 'components', 'ghuser'))
2222

2323
return [('compas_ghpython', 'Installed {} GH User Objects'.format(len(installed_objects)), True)]

tasks.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def help(ctx):
6262
'docs': 'True to clean up generated documentation, otherwise False',
6363
'bytecode': 'True to clean up compiled python files, otherwise False.',
6464
'builds': 'True to clean up build/packaging artifacts, otherwise False.'})
65-
def clean(ctx, docs=True, bytecode=True, builds=True):
65+
def clean(ctx, docs=True, bytecode=True, builds=True, ghuser=True):
6666
"""Cleans the local copy from compiled artifacts."""
6767

6868
with chdir(BASE_FOLDER):
@@ -92,6 +92,9 @@ def clean(ctx, docs=True, bytecode=True, builds=True):
9292
folders.append('build/')
9393
folders.append('src/compas.egg-info/')
9494

95+
if ghuser:
96+
folders.append('src/compas_ghpython/components/ghuser')
97+
9598
for folder in folders:
9699
shutil.rmtree(os.path.join(BASE_FOLDER, folder), ignore_errors=True)
97100

@@ -192,7 +195,8 @@ def build_ghuser_components(ctx, gh_io_folder=None, ironpython=None):
192195
"""Build Grasshopper user objects from source"""
193196
with chdir(BASE_FOLDER):
194197
with tempfile.TemporaryDirectory('actions.ghcomponentizer') as action_dir:
195-
target_dir = source_dir = os.path.abspath('src/compas_ghpython/components')
198+
source_dir = os.path.abspath('src/compas_ghpython/components')
199+
target_dir = os.path.join(source_dir, 'ghuser')
196200
ctx.run('git clone https://github.com/compas-dev/compas-actions.ghpython_components.git {}'.format(action_dir))
197201
if not gh_io_folder:
198202
import compas_ghpython

0 commit comments

Comments
 (0)