Skip to content

Commit 5c8fb34

Browse files
authored
Merge pull request #7297 from OpenBB-finance/release/4.6.0
[Release] OpenBB v.4.6.0
2 parents 0a2feaf + 88f0f0b commit 5c8fb34

File tree

1,487 files changed

+410595
-1041111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,487 files changed

+410595
-1041111
lines changed

.codespell.skip

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@
1313
*.scss
1414
*.txt
1515
*.yaml
16+
*.cdx.xml
1617
./build/pyinstaller
1718
./**/node_modules
1819
./frontend-components/**
20+
./cookiecutter/**
1921
./openbb_platform/providers/econdb/openbb_econdb/utils/helpers.py
2022
./openbb_platform/core/openbb/package/**
2123
./openbb_platform/providers/imf/openbb_imf/utils/constants.py
2224
./openbb_platform/extensions/economy/openbb_economy/economy_views.py
23-
./openbb_platform/providers/fmp/openbb_fmp/models/calendar_ipo.py
25+
./openbb_platform/providers/fmp/openbb_fmp/models/calendar_ipo.py
26+
./openbb_platform/providers/imf/openbb_imf/models/consumer_price_index.py
27+
./openbb_platform/providers/government_us/openbb_government_us/utils/psd_codes.py
28+
./desktop/src-tauri/src/tauri_handlers/startup.rs
29+
./desktop/src/routes/environments.tsx
30+
./desktop/src/tests/routes/installation-progress.test.tsx
31+
./desktop/src/tests/routes/index.test.tsx

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ omit =
44
tests/*
55
**/tests/**
66
**/package/**
7+
cookiecutter/**
78
source = .

.github/codeql/desktop-only.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: desktop-only
2+
paths:
3+
- desktop/**

.github/scripts/noxfile.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,42 @@
66

77
ROOT_DIR = Path(__file__).parent.parent.parent
88
PLATFORM_DIR = ROOT_DIR / "openbb_platform"
9-
PLATFORM_TESTS = [
10-
str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]
11-
]
9+
PLATFORM_TESTS = [str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]]
1210
CLI_DIR = ROOT_DIR / "cli"
1311
CLI_TESTS = CLI_DIR / "tests"
1412

1513

16-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
14+
@nox.session(python=["3.10", "3.11", "3.12", "3.13"])
1715
def unit_test_platform(session):
1816
"""Run the test suite."""
19-
session.install("poetry", "toml")
17+
session.install("poetry")
2018
session.run(
2119
"python",
2220
str(PLATFORM_DIR / "dev_install.py"),
2321
"-e",
24-
"all",
2522
external=True,
2623
)
2724
session.install("pytest")
2825
session.install("pytest-cov")
2926

30-
# Determine if we should ignore mcp_server tests based on Python version
31-
ignore_args = []
32-
if session.python == "3.9":
33-
ignore_args = ["--ignore=" + str(PLATFORM_DIR / "extensions/mcp_server/tests")]
34-
3527
session.run(
3628
"pytest",
3729
*PLATFORM_TESTS,
38-
*ignore_args,
3930
f"--cov={PLATFORM_DIR}",
4031
"-m",
4132
"not integration",
4233
)
4334

4435

45-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
36+
@nox.session(python=["3.10", "3.11", "3.12", "3.13"])
4637
def unit_test_cli(session):
4738
"""Run the test suite."""
48-
session.install("poetry", "toml")
39+
session.install("poetry")
4940
session.run(
5041
"python",
5142
str(PLATFORM_DIR / "dev_install.py"),
5243
"-e",
53-
"all",
44+
"--cli",
5445
external=True,
5546
)
5647
session.install("pytest")

.github/scripts/process_changelog.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,17 @@ def process_changelog(file_path, release_pr_number):
2929
pr_occurrences[pr_number].append(i)
3030

3131
# Set of indices to remove: includes all but last occurrence of each PR number
32-
to_remove = {
33-
i
34-
for pr, indices in pr_occurrences.items()
35-
if len(indices) > 1
36-
for i in indices[:-1]
37-
}
32+
to_remove = {i for pr, indices in pr_occurrences.items() if len(indices) > 1 for i in indices[:-1]}
3833
# Also remove any PR entries less than or equal to the specified release PR number
39-
to_remove.update(
40-
i
41-
for pr, indices in pr_occurrences.items()
42-
for i in indices
43-
if pr <= release_pr_number
44-
)
34+
to_remove.update(i for pr, indices in pr_occurrences.items() for i in indices if pr <= release_pr_number)
4535

4636
# Filter out lines marked for removal
4737
processed_lines = [line for i, line in enumerate(lines) if i not in to_remove]
4838

4939
# Final sweep: Ensure no missed duplicates, keeping only the last occurrence
5040
final_lines = []
5141
seen_pr_numbers = set() # Track seen PR numbers to identify duplicates
52-
for line in reversed(
53-
processed_lines
54-
): # Start from the end to keep the last occurrence
42+
for line in reversed(processed_lines): # Start from the end to keep the last occurrence
5543
match = re.search(r"\(#(\d+)\)", line)
5644
if match:
5745
pr_number = int(match.group(1))
@@ -72,9 +60,7 @@ def process_changelog(file_path, release_pr_number):
7260
if __name__ == "__main__":
7361
# Ensure correct command line arguments
7462
if len(sys.argv) < 3:
75-
logging.error(
76-
"Usage: python process_changelog.py <changelog_file> <release_pr_number>"
77-
)
63+
logging.error("Usage: python process_changelog.py <changelog_file> <release_pr_number>")
7864
sys.exit(1)
7965

8066
file_path = sys.argv[1]

.github/scripts/summarize_changelog.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import re
55
import sys
6-
from typing import Dict
76

87
import requests
98

@@ -24,12 +23,10 @@ def fetch_pr_details(owner: str, repo: str, pr_number: str, github_token: str) -
2423
return {}
2524

2625

27-
def parse_and_fetch_pr_details(
28-
markdown_text: str, owner: str, repo: str, github_token: str
29-
) -> Dict[str, str]:
26+
def parse_and_fetch_pr_details(markdown_text: str, owner: str, repo: str, github_token: str) -> dict[str, str]:
3027
"""Parse the markdown text and fetch details of PRs mentioned in the text."""
3128
sections = re.split(r"\n## ", markdown_text)
32-
categories: Dict[str, str] = {}
29+
categories: dict[str, str] = {}
3330

3431
for section in sections:
3532
split_section = section.split("\n", 1)
@@ -49,9 +46,7 @@ def parse_and_fetch_pr_details(
4946
"body": re.sub(r"\s+", " ", pr_details["body"].strip()).strip(),
5047
}
5148
except Exception as e:
52-
logging.error(
53-
"Failed to fetch PR details for PR #%s: %s", pr_number, e
54-
)
49+
logging.error("Failed to fetch PR details for PR #%s: %s", pr_number, e)
5550
if category_name in categories:
5651
categories[category_name].append(pr_info) # type: ignore
5752
else:
@@ -60,9 +55,7 @@ def parse_and_fetch_pr_details(
6055
return categories
6156

6257

63-
def insert_summary_into_markdown(
64-
markdown_text: str, category_name: str, summary: str
65-
) -> str:
58+
def insert_summary_into_markdown(markdown_text: str, category_name: str, summary: str) -> str:
6659
"""Insert a summary into the markdown text directly under the specified category name."""
6760
marker = f"## {category_name}"
6861
if marker in markdown_text:
@@ -73,12 +66,7 @@ def insert_summary_into_markdown(
7366
if newline_pos != -1:
7467
# Insert the summary right after the newline that follows the category name
7568
# Ensuring it's on a new line and followed by two newlines before any subsequent content
76-
updated_markdown = (
77-
markdown_text[: newline_pos + 1]
78-
+ "\n"
79-
+ summary
80-
+ markdown_text[newline_pos + 1 :]
81-
)
69+
updated_markdown = markdown_text[: newline_pos + 1] + "\n" + summary + markdown_text[newline_pos + 1 :]
8270
else:
8371
# If there's no newline (e.g., end of file), just append the summary
8472
updated_markdown = markdown_text + "\n\n" + summary + "\n"
@@ -144,9 +132,7 @@ def summarize_changelog_v2(
144132
]
145133
)
146134
summary = summarize_text_with_openai(aggregated_text, openai_api_key)
147-
updated_markdown = insert_summary_into_markdown(
148-
updated_markdown, category_of_interest, summary
149-
)
135+
updated_markdown = insert_summary_into_markdown(updated_markdown, category_of_interest, summary)
150136

151137
with open(changelog_v2, "w") as file:
152138
logging.info("Writing updated file: %s", changelog_v2)
@@ -155,9 +141,7 @@ def summarize_changelog_v2(
155141

156142
if __name__ == "__main__":
157143
if len(sys.argv) < 3:
158-
logging.error(
159-
"Usage: python summarize_changelog.py <github_token> <openai_api_key>"
160-
)
144+
logging.error("Usage: python summarize_changelog.py <github_token> <openai_api_key>")
161145
sys.exit(1)
162146

163147
token = sys.argv[1]
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: build-macos-x64
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
release:
7+
required: false
8+
type: boolean
9+
default: false
10+
workflow_dispatch:
11+
inputs:
12+
release:
13+
description: 'Set to true to create a release build'
14+
required: false
15+
type: boolean
16+
default: false
17+
18+
jobs:
19+
build-and-sign:
20+
runs-on: "macos-15-intel"
21+
permissions:
22+
contents: write
23+
defaults:
24+
run:
25+
working-directory: desktop
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
30+
- name: Import Code Signing Certificate
31+
uses: apple-actions/import-codesign-certs@v3
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
35+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
36+
with:
37+
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
38+
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
39+
40+
- name: Setup Cargo Cache
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.cargo/registry
45+
~/.cargo/git
46+
key: macos-x64-cargo-registry-${{ hashFiles('desktop/**/Cargo.lock') }}
47+
restore-keys: |
48+
macos-x64-cargo-registry-
49+
50+
- name: Setup Node Cache
51+
uses: actions/cache@v4
52+
with:
53+
path: ~/.npm
54+
key: macos-x64-node-${{ hashFiles('desktop/**/package-lock.json') }}
55+
restore-keys: |
56+
macos-x64-node-
57+
58+
- name: Setup Node
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: lts/*
62+
63+
- name: Install cyclonedx-npm
64+
run: npm install -g @cyclonedx/cyclonedx-npm
65+
66+
- name: install Rust stable
67+
uses: dtolnay/rust-toolchain@stable
68+
with:
69+
targets: "x86_64-apple-darwin"
70+
71+
- name: Install Modules
72+
run: |
73+
npm install
74+
cyclonedx-npm --output-format XML --gather-license-texts --output-file src-tauri/open-data-platform-SBOM-npm.cdx.xml
75+
76+
- name: Install cargo-cyclonedx
77+
run: |
78+
cargo install cargo-cyclonedx
79+
cargo cyclonedx
80+
if [ -f "src-tauri/openbb-platform.cdx.xml" ]; then
81+
mv src-tauri/openbb-platform.cdx.xml "src-tauri/open-data-platform-SBOM-cargo.cdx.xml"
82+
fi
83+
84+
- name: Build Tauri App
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
88+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
89+
APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
90+
APPLE_PASSWORD: ${{ secrets.NOTARIZE_APPLE_PWD }}
91+
APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
92+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
93+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
94+
run: npm run tauri build
95+
96+
- name: Rename artifacts
97+
run: |
98+
VERSION=$(jq -r .version src-tauri/tauri.conf.json)
99+
cd target/release/bundle/dmg
100+
for file in *.dmg; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.dmg"; done
101+
cd ../macos
102+
for file in *.app.tar.gz; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.app.tar.gz"; done
103+
for file in *.app.tar.gz.sig; do mv "$file" "Open-Data-Platform_${VERSION}_x86_64.app.tar.gz.sig"; done
104+
105+
- name: Upload Artifacts
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: macos-x64-artifacts
109+
path: |
110+
desktop/target/release/bundle/dmg/*.dmg
111+
desktop/target/release/bundle/macos/*.app.tar.gz
112+
desktop/target/release/bundle/macos/*.app.tar.gz.sig
113+
114+
- name: Clean old bundle artifacts
115+
if: always()
116+
run: |
117+
bundlePath="${{ github.workspace }}/desktop/target/release/bundle"
118+
if [ -d "$bundlePath" ]; then
119+
rm -rf "$bundlePath"
120+
fi

0 commit comments

Comments
 (0)