Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
34 changes: 33 additions & 1 deletion .codespell.ignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
ake
alle
alll
alph
ba
brin
buda
buidl
buil
certi
cips
commun
coo
creat
datas
ether
fo
gage
gard
hel
hist
Expand All @@ -28,6 +32,7 @@ operatio
ot
parana
pres
requestor
ro
ser
shold
Expand All @@ -44,4 +49,31 @@ wew
yeld
zar
zlot
bootup
bootup
caf
trough
unparseable
newyorker
PADD
padds
serie
equipments
inpt
reciepts
worl
ois
eror
ags
sie
ons
bilt
oce
aer
addtional
seconary
sme
bu
medias
fallow
LEAS
TRANSPRT
27 changes: 0 additions & 27 deletions .github/labeler.yml

This file was deleted.

19 changes: 7 additions & 12 deletions .github/scripts/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@

ROOT_DIR = Path(__file__).parent.parent.parent
PLATFORM_DIR = ROOT_DIR / "openbb_platform"
PLATFORM_TESTS = [str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]]
PLATFORM_TESTS = [
str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]
]
CLI_DIR = ROOT_DIR / "cli"
CLI_TESTS = CLI_DIR / "tests"


@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"])
def unit_test_platform(session):
"""Run the test suite."""
session.install("poetry")
session.install("uv")
session.run(
"python",
str(PLATFORM_DIR / "dev_install.py"),
"-e",
external=True,
"python", str(PLATFORM_DIR / "dev_install.py"), "--routers", external=True
)
session.install("pytest")
session.install("pytest-cov")
Expand All @@ -36,13 +35,9 @@ def unit_test_platform(session):
@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"])
def unit_test_cli(session):
"""Run the test suite."""
session.install("poetry")
session.install("uv")
session.run(
"python",
str(PLATFORM_DIR / "dev_install.py"),
"-e",
"--cli",
external=True,
"python", str(PLATFORM_DIR / "dev_install.py"), "--routers", external=True
)
session.install("pytest")
session.install("pytest-cov")
Expand Down
33 changes: 24 additions & 9 deletions .github/scripts/summarize_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def fetch_pr_details(owner: str, repo: str, pr_number: str, github_token: str) -
return {}


def parse_and_fetch_pr_details(markdown_text: str, owner: str, repo: str, github_token: str) -> dict[str, str]:
def parse_and_fetch_pr_details(
markdown_text: str, owner: str, repo: str, github_token: str
) -> dict[str, str]:
"""Parse the markdown text and fetch details of PRs mentioned in the text."""
sections = re.split(r"\n## ", markdown_text)
categories: dict[str, str] = {}
Expand All @@ -46,7 +48,9 @@ def parse_and_fetch_pr_details(markdown_text: str, owner: str, repo: str, github
"body": re.sub(r"\s+", " ", pr_details["body"].strip()).strip(),
}
except Exception as e:
logging.error("Failed to fetch PR details for PR #%s: %s", pr_number, e)
logging.error(
"Failed to fetch PR details for PR #%s: %s", pr_number, e
)
if category_name in categories:
categories[category_name].append(pr_info) # type: ignore
else:
Expand All @@ -55,7 +59,9 @@ def parse_and_fetch_pr_details(markdown_text: str, owner: str, repo: str, github
return categories


def insert_summary_into_markdown(markdown_text: str, category_name: str, summary: str) -> str:
def insert_summary_into_markdown(
markdown_text: str, category_name: str, summary: str
) -> str:
"""Insert a summary into the markdown text directly under the specified category name."""
marker = f"## {category_name}"
if marker in markdown_text:
Expand All @@ -66,7 +72,12 @@ def insert_summary_into_markdown(markdown_text: str, category_name: str, summary
if newline_pos != -1:
# Insert the summary right after the newline that follows the category name
# Ensuring it's on a new line and followed by two newlines before any subsequent content
updated_markdown = markdown_text[: newline_pos + 1] + "\n" + summary + markdown_text[newline_pos + 1 :]
updated_markdown = (
markdown_text[: newline_pos + 1]
+ "\n"
+ summary
+ markdown_text[newline_pos + 1 :]
)
else:
# If there's no newline (e.g., end of file), just append the summary
updated_markdown = markdown_text + "\n\n" + summary + "\n"
Expand All @@ -78,15 +89,15 @@ def insert_summary_into_markdown(markdown_text: str, category_name: str, summary

def summarize_text_with_openai(text: str, openai_api_key: str) -> str:
"""Summarize text using OpenAI's GPT model."""
from openai import OpenAI # pylint: disable=C0415
from openai import OpenAI

openai = OpenAI(api_key=openai_api_key)
response = openai.chat.completions.create(
model="gpt-4", # noqa: E501
messages=[
{
"role": "system",
"content": "Summarize the following text in a concise way to describe what happened in the new release. This will be used on top of the changelog to provide a high-level overview of the changes. Make sure it is well-written, concise, structured and that it captures the essence of the text. It should read like a concise story.", # noqa: E501 # pylint: disable=C0301
"content": "Summarize the following text in a concise way to describe what happened in the new release. This will be used on top of the changelog to provide a high-level overview of the changes. Make sure it is well-written, concise, structured and that it captures the essence of the text. It should read like a concise story.", # noqa: E501
},
{"role": "user", "content": text},
],
Expand Down Expand Up @@ -128,11 +139,13 @@ def summarize_changelog_v2(
aggregated_text = "\n".join(
[
f"- {pr['title']}: {re.sub(pattern, '', pr['body'])}" # type: ignore
for pr in categories[category_of_interest] # type: ignore
for pr in categories[category_of_interest]
]
)
summary = summarize_text_with_openai(aggregated_text, openai_api_key)
updated_markdown = insert_summary_into_markdown(updated_markdown, category_of_interest, summary)
updated_markdown = insert_summary_into_markdown(
updated_markdown, category_of_interest, summary
)

with open(changelog_v2, "w") as file:
logging.info("Writing updated file: %s", changelog_v2)
Expand All @@ -141,7 +154,9 @@ def summarize_changelog_v2(

if __name__ == "__main__":
if len(sys.argv) < 3:
logging.error("Usage: python summarize_changelog.py <github_token> <openai_api_key>")
logging.error(
"Usage: python summarize_changelog.py <github_token> <openai_api_key>"
)
sys.exit(1)

token = sys.argv[1]
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,16 @@ The first job, `code-linting`, runs on an Ubuntu machine and performs several li
- Checking out the code from the repository
- Setting up Python 3.10
- Installing a number of Python packages necessary for the linting tasks
- Running `bandit` to check for security vulnerabilities
- Running `black` to check the code formatting
- Running `codespell` to check the spelling of comments, strings, and variable names
- Running `ruff` to check the use of Python
- Running `pylint` to perform static analysis of the code
- Running `mypy` to check the type annotations
- Running `pydocstyle` to check the docstrings
- Running `black` to check the code formatting
- Running `ruff` to lint the code (replaces pylint, isort, flake8, and pydocstyle)
- Running `ty` to check the type annotations

The second job, `markdown-link-check`, runs on an Ubuntu machine and performs linting of the markdown files in the repository. It uses a Docker container `avtodev/markdown-lint` to perform the linting.

## 🏷️ Pull Request Labels

Automatic labelling of pull requests.
Validate that pull requests do not include the `do not merge` label.

## 🚉 Integration test Platform (API)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ name: "CodeQL Advanced"

on:
push:
branches: [ "develop", "PR-review", "gh-pages", "main" ]
branches: [ "develop", "PR-review", "gh-pages", "main", "v5" ]
paths-ignore:
- 'cookiecutter/**'
pull_request:
branches: [ "develop", "PR-review", "gh-pages", "main" ]
branches: [ "develop", "PR-review", "gh-pages", "main", "v5" ]
paths-ignore:
- 'cookiecutter/**'
schedule:
Expand Down
102 changes: 0 additions & 102 deletions .github/workflows/general-linting.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/gh-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,9 @@ jobs:
contents: read
pull-requests: write
steps:
# - uses: mheap/github-action-required-labels@v5
# with:
# mode: minimum
# count: 1
# labels: "guides, bug, build, docker, docs, feat XS, feat S, feat M, feat L, feat XL, help wanted, refactor, tests, dependencies, release"
- uses: mheap/github-action-required-labels@0ac283b4e65c1fb28ce6079dea5546ceca98ccbe # v5
with:
mode: exactly
count: 0
labels: "do not merge"

- name: 🏷️ Label OpenBB Platform PRs
uses: srvaroa/labeler@e8fbb2561481ef6e711a770f0234e9379dc76892 # master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading