-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
187 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
name: Auto Assign to Project(s) | ||
# name: Auto Assign to Project(s) | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
pull_request: | ||
types: [opened] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# on: | ||
# issues: | ||
# types: [opened] | ||
# pull_request: | ||
# types: [opened] | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
assign_one_project: | ||
runs-on: ubuntu-latest | ||
name: Assign to the kaban Project | ||
steps: | ||
- name: Assign NEW issues and NEW pull requests to kaban project | ||
uses: srggrs/assign-one-project-github-action@1.2.1 | ||
if: github.event.action == 'opened' | ||
with: | ||
project: "https://github.com/12rambau/sepal_ui/projects/5" | ||
# jobs: | ||
# assign_one_project: | ||
# runs-on: ubuntu-latest | ||
# name: Assign to the kaban Project | ||
# steps: | ||
# - name: Assign NEW issues and NEW pull requests to kaban project | ||
# uses: srggrs/assign-one-project-github-action@1.2.1 | ||
# if: github.event.action == 'opened' | ||
# with: | ||
# project: "https://github.com/12rambau/sepal_ui/projects/5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ __pycache__/ | |
*$py.class | ||
*[Uu]ntitled* | ||
|
||
.github/workflows/act_unit.yml | ||
|
||
# C extensions | ||
*.so | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/python3 | ||
|
||
"""Script to rename the kernel of a notebook to a specific name.""" | ||
|
||
import argparse | ||
import json | ||
from pathlib import Path | ||
|
||
from colorama import Fore, init | ||
|
||
init() | ||
|
||
# init parser | ||
parser = argparse.ArgumentParser(description=__doc__, usage="entry_point") | ||
|
||
parser.add_argument("file", help="UI file path") | ||
|
||
# Add a optional argument | ||
parser.add_argument("-t", "--test", help="Either test or not (production)", action="store_true") | ||
|
||
|
||
def main() -> None: | ||
"""Launch the venv creation process.""" | ||
# read arguments (there should be none) | ||
args = parser.parse_args() | ||
|
||
ui_file = args.file | ||
test = args.test | ||
|
||
# welcome the user | ||
print(f"{Fore.YELLOW}UI renaming process{Fore.RESET}") | ||
|
||
# check that the local folder is a module folder | ||
ui_file = Path.cwd() / ui_file | ||
if not ui_file.is_file(): | ||
raise Exception(f"{Fore.RED}This is not a module folder.") | ||
|
||
entry_point = Path.cwd() / ui_file | ||
|
||
# create the kernel from venv | ||
prefix_name = "test-" if test else "venv-" | ||
prefix_display = "(test) test-" if test else " (venv) " | ||
|
||
name = f"{prefix_name}{Path.cwd().name}" | ||
display_name = f"{prefix_display}{Path.cwd().name}" | ||
|
||
# change the kernel of the entrypoint to use this one instead | ||
with entry_point.open() as f: | ||
data = json.load(f) | ||
|
||
data["metadata"]["kernelspec"]["display_name"] = display_name | ||
data["metadata"]["kernelspec"]["name"] = name | ||
|
||
entry_point.write_text(json.dumps(data, indent=1)) | ||
|
||
# display last message to the end user | ||
print( | ||
f'{Fore.GREEN}The python kernel of {args.file} has been updated"{display_name}".{Fore.RESET}' | ||
) | ||
|
||
return | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- 12.44577020563167 | ||
- 41.90021953934408 | ||
- 12.457671530175347 | ||
- 41.90667181034749 | ||
- 12.4458 | ||
- 41.9002 | ||
- 12.4458 | ||
- 41.9067 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.