Skip to content

Commit

Permalink
Merge branch 'develop' into hotfix/adjustments-pro
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone authored Apr 27, 2024
2 parents cbff630 + bd75a97 commit 3cf9094
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 32 deletions.
29 changes: 29 additions & 0 deletions .github/scripts/noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Nox sessions."""

from pathlib import Path

import nox

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"]
]


@nox.session(python=["3.9", "3.10", "3.11"])
def tests(session):
"""Run the test suite."""
session.install("poetry", "toml")
session.run(
"python",
str(PLATFORM_DIR / "dev_install.py"),
"-e",
"all",
external=True,
)
session.install("pytest")
session.install("pytest-cov")
session.run(
"pytest", *PLATFORM_TESTS, f"--cov={PLATFORM_DIR}", "-m", "not integration"
)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
- name: 🧬 Process Changelog
run: |
pip install requests openai
python process_changelog.py CHANGELOG.md ${{ github.event.inputs.release_pr_number }}
python summarize_changelog.py ${{ secrets.GITHUB_TOKEN }} ${{ secrets.OPENAI_API_KEY }}
python .github/scripts/process_changelog.py CHANGELOG.md ${{ github.event.inputs.release_pr_number }}
python .github/scripts/summarize_changelog.py ${{ secrets.GITHUB_TOKEN }} ${{ secrets.OPENAI_API_KEY }}
cat CHANGELOG.md
- name: 🛫 Create Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
- name: Run tests
run: |
pip install nox
nox -s tests --python ${{ matrix.python_version }}
nox -f .github/scripts/noxfile.py -s tests --python ${{ matrix.python_version }}
25 changes: 0 additions & 25 deletions noxfile.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from pydantic.fields import FieldInfo
from pydantic_core import PydanticUndefined

ROOT_DIR = Path(__file__).parent.parent.parent.parent

TEST_TEMPLATE = """\n\n@parametrize(
"params",
[
Expand All @@ -43,9 +45,9 @@ def find_extensions(filter_chart: Optional[bool] = True):
filter_ext = ["tests", "__pycache__"]
if filter_chart:
filter_ext.append("charting")
extensions = [x for x in Path("openbb_platform/extensions").iterdir() if x.is_dir()]
extensions = [x for x in (ROOT_DIR / "extensions").iterdir() if x.is_dir()]
extensions.extend(
[x for x in Path("openbb_platform/obbject_extensions").iterdir() if x.is_dir()]
[x for x in (ROOT_DIR / "obbject_extensions").iterdir() if x.is_dir()]
)
extensions = [x for x in extensions if x.name not in filter_ext]
return extensions
Expand Down
7 changes: 5 additions & 2 deletions openbb_platform/tests/test_pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import glob
import os
from pathlib import Path

import toml

ROOT_DIR = Path(__file__).parent.parent


def test_optional_packages():
"""Ensure only required extensions are built and versions respect pyproject.toml"""
data = toml.load("openbb_platform/pyproject.toml")
data = toml.load(ROOT_DIR / "pyproject.toml")
dependencies = data["tool"]["poetry"]["dependencies"]
extras = data["tool"]["poetry"]["extras"]
all_packages = extras["all"]
Expand All @@ -32,7 +35,7 @@ def test_optional_packages():

def test_default_package_files():
"""Ensure only required extensions are built and versions respect pyproject.toml"""
data = toml.load("openbb_platform/pyproject.toml")
data = toml.load(Path(ROOT_DIR / "pyproject.toml"))
dependencies = data["tool"]["poetry"]["dependencies"]
package_files = glob.glob("openbb_platform/openbb/package/*.py")

Expand Down

0 comments on commit 3cf9094

Please sign in to comment.