diff --git a/infragpt/website/public/install.sh b/infragpt/website/public/install.sh new file mode 100644 index 0000000..e5afd39 --- /dev/null +++ b/infragpt/website/public/install.sh @@ -0,0 +1,201 @@ +#!/bin/sh +# shellcheck shell=dash +# +# Licensed under the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -u + +APP_NAME="infragpt" +UV_VERSION="0.5.9" +INSTALLER_BASE_URL="${UV_INSTALLER_GITHUB_BASE_URL:-https://github.com}" +ARTIFACT_DOWNLOAD_URL="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/${UV_VERSION}" +PRINT_VERBOSE=${INSTALLER_PRINT_VERBOSE:-0} +PRINT_QUIET=${INSTALLER_PRINT_QUIET:-0} +NO_MODIFY_PATH=${INSTALLER_NO_MODIFY_PATH:-0} +INSTALL_UPDATER=1 +UNMANAGED_INSTALL="${INFRAGPT_UNMANAGED_INSTALL:-}" +PYTHON_VERSION="python3.12" + +if [ -n "${UNMANAGED_INSTALL}" ]; then + NO_MODIFY_PATH=1 + INSTALL_UPDATER=0 +fi + +usage() { + cat </dev/null || echo '') + reset=$(tput sgr0 2>/dev/null || echo '') + say "${red}ERROR${reset}: $1" >&2 + fi + exit 1 +} + +check_cmd() { + command -v "$1" > /dev/null 2>&1 + return $? +} + +# This wraps curl or wget. Try curl first, if not installed, +# use wget instead. +downloader() { + local _dld + + if check_cmd curl; then + _dld=curl + elif check_cmd wget; then + _dld=wget + else + err "Need curl or wget to download files" + fi + + if [ "$_dld" = curl ]; then + curl -sSfL "$1" -o "$2" + elif [ "$_dld" = wget ]; then + wget "$1" -O "$2" + else + err "Unknown downloader" # should not reach here + fi +} + +main "$@" || exit 1 diff --git a/pyproject.toml b/pyproject.toml index 311aa9d..c8d6296 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel"] +requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -20,7 +20,7 @@ classifiers = [ "Topic :: Utilities", "Topic :: System :: Systems Administration", ] - +# Remove empty dependencies list when using dynamic dynamic = ["dependencies"] [project.urls] @@ -29,8 +29,11 @@ Homepage = "https://github.com/priyanshujain/infragpt" [project.scripts] infragpt = "infragpt.cli:cli" +[tool.setuptools] +include-package-data = true + [tool.setuptools.packages.find] -include = ["infragpt"] +include = ["infragpt*"] [tool.setuptools.dynamic] -dependencies = { file = "requirements.txt" } +dependencies = {file = ["requirements.txt"]}