diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..a67ea0f --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +ui-elements diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b61cd36..17e9ea2 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,6 +1,23 @@ { "version": "2.0.0", + "osx": { + "options": { + "shell": { + "executable": "${env:SHELL}", + "args": ["--login", "--interactive"] + } + } + }, "tasks": [ + { + "type": "shell", + "command": "./scripts/install_dependencies.sh", + "label": "Install dependencies", + "options": { + "cwd": "${workspaceFolder}", + }, + "problemMatcher": [] + }, { "type": "npm", "script": "start", diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh new file mode 100755 index 0000000..0b00a06 --- /dev/null +++ b/scripts/install_dependencies.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +project=ui-elements +pyenv_version=3.12.3 + +brew update && brew install pyenv pyenv-virtualenv node + +if ! pyenv virtualenvs | grep -q "$project"; then + pyenv install $pyenv_version --skip-existing + pyenv virtualenv $pyenv_version $project + pyenv local $project +fi + +pyenv activate $project + +pip install -r requirements.txt + +(cd src && npm install) \ No newline at end of file diff --git a/scripts/publish_npm_package.py b/scripts/publish_npm_package.py index a3bb2a2..194e51b 100644 --- a/scripts/publish_npm_package.py +++ b/scripts/publish_npm_package.py @@ -4,13 +4,16 @@ from pathlib import Path from publish_tools import ansible_utils from publish_tools import npm_utils +from publish_tools import version_utils root_directory = Path(__file__).parent.parent -secrets = ansible_utils.load_vars(sys.argv[2], root_directory / 'vars/vault.yaml') +secrets = ansible_utils.load_vars(sys.argv[2], root_directory / "vars/vault.yaml") +version = version_utils.get_version(src=root_directory, tag_prefix="version") npm_utils.publish_npm_package( src=root_directory, tag_prefix="version", - npm_access_token=secrets['npm_access_token'], - github_access_token=sys.argv[1] + version=version, + npm_access_token=secrets["npm_access_token"], + github_access_token=sys.argv[1], )