Skip to content

Commit

Permalink
WIP: testing folder zipping
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Apr 16, 2024
1 parent e59a562 commit e7ad6f4
Show file tree
Hide file tree
Showing 19 changed files with 166 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rhinoplugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ScriptSync.rhp
path: ./CsRhino/bin/Release/net48/ScriptSync.rhp
path: ./CsRhino/bin/Release/net48/
10 changes: 9 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ icon: logo.png
```
Now, create the `.yak` package by running the following command in the terminal:
```terminal
yak build script_sync-1.0.2-rh8-win
yak build
```
The `.yak` package is created in the folder `script_sync-1.0.2-rh8-win.yak`.

Expand All @@ -58,6 +58,14 @@ Script-sync is released as a `.vsix` package via the VSCE executable provided by
### Build the VSCode extension
Start by building the VSCode extension as described in the [contribution guideline](#contribution-guideline). OR, grab the latest version of the extension from the artifacts of the latest successful build on the latest e.g., [CI](https://github.com/ibois-epfl/script-sync/actions/runs/7349030262).

Make sure to change the correct version number in the `package.json` file.
```json
"version": "1.1.4",
"engines": {
"vscode": "^1.85.0"
},
```

### Publish the `.vsix` package to the VSCode marketplace
To upload the package to the VSCode marketplace, run the following command in the terminal in the folder containing the `.vsix` file:
```terminal
Expand Down
2 changes: 1 addition & 1 deletion VSCode/scriptsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/ibois-epfl/script-sync"
},
"version": "1.1.3",
"version": "1.1.4",
"engines": {
"vscode": "^1.85.0"
},
Expand Down
34 changes: 34 additions & 0 deletions invokes/yakerize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! python3

"""
This script collects all the files needed to create the yak package.
"""

from invoke import run
import os


# Run a command just like you would in the shell
result = run("dir", hide=True, warn=True)

# You can check if the command was successful
if result.ok:
# print it in green
print("\033[92mCommand succeeded\033[0m")
else:
print("\033[91mCommand failed\033[0m")

# print(secret)
# # You can access the output of the command
# print("Command output was:")
# print(result.stdout)

############################################

path_rhldir : str = "./"

# copy the yaker directory to the build folder
result = run("cd yaker", hide=True, warn=True)
# result = run("cd", hide=False, warn=True)

# get the rhino .rhp and its dependencies
9 changes: 9 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# tasks.py
from invoke import task

@task
def yakerize(c):
path_yakerize : str = "./invokes/yakerize.py"
c.run(f"python {path_yakerize}")

#access a repository secret
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file added yaker/exec/script-sync-1.1.4-rh8-any/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions yaker/exec/script-sync-1.1.4-rh8-any/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: script-sync
version: 1.1.4
authors:
- Andrea Settimi
description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8.
url: https://github.com/ibois-epfl/script-sync
keywords:
- Rhino
- Cs
- Python
- IronPython
- CPython
- VScode
- Utility
icon: logo.png
21 changes: 21 additions & 0 deletions yaker/exec/script-sync-1.1.4-rh8-any/misc/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Laboratory for Timber Constructions IBOIS, EPFL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 59 additions & 0 deletions yaker/exec/script-sync-1.1.4-rh8-any/misc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<p align="center">
<img src="VSCode\scriptsync\logo\scriptsync_480.png" width="140">
</p>

# script-sync

This repository contains the code and Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8.

![record_vid_gif20fps](https://github.com/ibois-epfl/script-sync/assets/50238678/7ccb2aa5-e646-45cd-9657-95776d24a48a)

## Features
To start `script-sync` in RhinoV8, run the command `ScriptSyncStart` in RhinoV8. This will start a server that listens to commands from VSCode.

Open a `.py` or `.cs` file in VSCode and run it in RhinoV8 by pressing `F4`.
Add a `shebang` to the first line of the file to specify the Python interpreter to use, e.g.:
* `#!python3` to interpret it with CPython
* `#!python2` to interpret it with IronPython

To close `script-sync` in RhinoV8, run the command `ScriptSyncStop` in RhinoV8.

## Requirements
The plug-in needs to be installed on RhinoV8.

## Caveats
There is no intellisense for C# and Python in VSCode.

## Release Notes

### 1.0.0

First release of script-sync: it can run C# and Python (IronPython or CPython) in RhinoV8 from VSCode. It is only tested on Windows.
* Extension for VSCode
* Rhino plug-in with basic commands to start/stop script-sync server
* basic documentation

## References

There are a lot of plug-ins that allow to run Python in Rhino. Among them, [CodeListener](https://github.com/ccc159/CodeListener) was working until RhinoV8 and it was a source of inspiration for this project. This is a simplified version, but it can run `C#` and both `IronPython` and `CPython` in RhinoV8.

## Citation
This project is part of the research activities of the [IBOIS lab](https://www.epfl.ch/labs/ibois/) at EPFL. It was developed by [Andrea Settimi](https://github.com/9and3).


## For more information

* [GitHub repo](https://github.com/ibois-epfl/script-sync)
* [IBOIS GitHub organization](https://github.com/ibois-epfl)
* [IBOIS lab page](https://www.epfl.ch/labs/ibois/)


## Roadmap
- [ ] publish yak package + auto pipeline
- [ ] publish on tools website lab
- [ ] add instructions for dev and contribution
- [ ] add icons
- [ ] write ci
- [ ] write tests
- [ ] ci action to publish automatic releases
- [ ] possibly redirect output from RhinoApp.RunScript() to vscode consoles or log file
Binary file not shown.
Binary file added yaker/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions yaker/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: script-sync
version: 1.1.4
authors:
- Andrea Settimi
description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8.
url: https://github.com/ibois-epfl/script-sync
keywords:
- Rhino
- Cs
- Python
- IronPython
- CPython
- VScode
- Utility
icon: logo.png

0 comments on commit e7ad6f4

Please sign in to comment.