Skip to content

Commit

Permalink
release 2.0.0rc1 (#3531)
Browse files Browse the repository at this point in the history
* version change to 2.0.0rc1

* Update terminal_helper

* scipy to ^1.9.3

* signing files for intel

* Docker release for 2.0.0rc1

* scipy sign binary

* signing scipy removal

* Update build/pypi

* Checkout terminal_helper.py

* Make pypi build files executable

* changed the version checking

Co-authored-by: Chavithra PARANA <[email protected]>
Co-authored-by: Luqman Bello <[email protected]>
Co-authored-by: Theodore Aptekarev <[email protected]>
Co-authored-by: hjoaquim <[email protected]>
  • Loading branch information
5 people authored Nov 23, 2022
1 parent a0c5b49 commit 94e9e29
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/intel_macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ jobs:
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/.dylibs/*.dylib
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/.dylibs/*.dylib
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/sklearn/.dylibs/*.dylib
echo "Code Signing Other Files"
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/prophet_model.bin
/usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/diagnose
Expand Down
2 changes: 1 addition & 1 deletion build/nsis/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!define NAME "OpenBB Terminal"
!define COMPANY "OpenBB"
!define APPFILE "OpenBBTerminal.exe"
!define VERSION "1.9.0"
!define VERSION "2.0.0rc1"
!define SLUG "${NAME} v${VERSION}"

;--------------------------------
Expand Down
3 changes: 1 addition & 2 deletions build/pypi/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ OPENBB_LOGGING_APP_NAME="gst_packaged_pypi"
echo "OPENBB_LOGGING_APP_NAME='${OPENBB_LOGGING_APP_NAME}'" > openbb_terminal/.env
echo "OPENBB_LOGGING_COMMIT_HASH=${OPENBB_LOGGING_COMMIT_HASH}" >> openbb_terminal/.env

poetry build
poetry publish
poetry publish --build
9 changes: 9 additions & 0 deletions build/pypi/test_publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# BUILD `openbb_terminal/.env`
OPENBB_LOGGING_COMMIT_HASH="sha:$(git rev-parse --short=8 HEAD)"
OPENBB_LOGGING_APP_NAME="gst_packaged_pypi"
echo "OPENBB_LOGGING_APP_NAME='${OPENBB_LOGGING_APP_NAME}'" > openbb_terminal/.env
echo "OPENBB_LOGGING_COMMIT_HASH=${OPENBB_LOGGING_COMMIT_HASH}" >> openbb_terminal/.env

poetry publish -r testpypi --build
2 changes: 1 addition & 1 deletion docker/compose.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OPENBBTERMINAL_DOCKER_REGISTRY="ghcr.io"
OPENBBTERMINAL_DOCKER_RELEASE_VERSION="1.9.1"
OPENBBTERMINAL_DOCKER_RELEASE_VERSION="2.0.0rc1"
3 changes: 2 additions & 1 deletion docker/poetry.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ RUN curl -sSL https://install.python-poetry.org | python3 -
WORKDIR $PYSETUP_PATH

# Copy poetry files and install git
COPY pyproject.toml README.md poetry.lock ./
COPY pyproject.toml openbb_terminal/SDK_README.md poetry.lock ./

RUN mkdir $PYSETUP_PATH/openbb_terminal
RUN mv SDK_README.md ./openbb_terminal
RUN touch openbb_terminal/__init__.py

# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
try:
version = pkg_resources.get_distribution("OpenBBTerminal").version
except Exception:
version = "1.9.0m"
version = "2.0.0rc1"
VERSION = str(os.getenv("OPENBB_VERSION", version))

# Select the terminal translation language
Expand Down
55 changes: 39 additions & 16 deletions openbb_terminal/terminal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import subprocess # nosec
import sys
from typing import List
from typing import List, Optional

# IMPORTATION THIRDPARTY
import requests
Expand Down Expand Up @@ -220,23 +220,29 @@ def check_for_updates() -> None:
r = None

if r is not None and r.status_code == 200:
release: str = r.json()["html_url"].split("/")[-1].replace("v", "")
lastest_split = release.split(".")
current = obbff.VERSION.replace("m", "").split(".")
for i in range(3):
if int(lastest_split[i]) > int(current[i]):
console.print(
"[bold red]You are not using the latest version[/bold red]"
)
latest_version = r.json()["tag_name"]
latest_version_number = get_version_number(tag=latest_version)
current_version_number = get_version_number(tag=obbff.VERSION)

if latest_version_number and current_version_number:

if current_version_number == latest_version_number:
console.print("[green]You are using the latest stable version[/green]")
return
else:
console.print(
"[yellow]Check for updates at https://openbb.co/products/terminal#get-started[/yellow]"
"[yellow]You are not using the latest stable version[/yellow]"
)
break
if int(lastest_split[i]) < int(current[i]):
console.print("[yellow]You are using an unreleased version[/yellow]")
if release == obbff.VERSION.replace("m", ""):
console.print("[green]You are using the latest version[/green]")
break
if current_version_number < latest_version_number:
console.print(
"[yellow]Check for updates at https://openbb.co/products/terminal#get-started[/yellow]"
)
else:
console.print(
"[yellow]You are using an unreleased version[/yellow]"
)
else:
console.print("[red]You are using an unrecognized version.[/red]")
else:
console.print(
"[yellow]Unable to check for updates... "
Expand All @@ -245,6 +251,23 @@ def check_for_updates() -> None:
console.print("\n")


def get_version_number(tag: str) -> Optional[str]:
"""Get the release number from a tag."""

if not tag.startswith("v") and len(tag.split(".")) != 3:
return None

if tag.startswith("v"):
tag = tag[1:]

if "rc" in tag.split(".")[-1]:
tag_split = tag.split(".")
tag_split[-1] = tag_split[-1].split("rc")[0]
tag = ".".join(tag_split)

return tag


def welcome_message():
"""Print the welcome message
Expand Down
Loading

0 comments on commit 94e9e29

Please sign in to comment.