mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-13 21:02:13 +00:00
[V5] openbb-government-us: Refactor for V5 + Move uscongress (#7604)
* v5 government_us provider * workflow files * ty and add xlrd to pyproject * shrink test cassettes * dev dependencies * wheel packaging and more tests * python 3.10 thing..? * fix test * default state for multiselect dropdowns * replace congress html widgets with iframes * fallback to congress api for congress before 108 * ensure member passage voting count populates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: 📦 publish openbb-congress-gov
|
||||
name: 📦 publish openbb-government-us
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -12,14 +12,14 @@ permissions:
|
||||
jobs:
|
||||
version-check:
|
||||
name: Verify version bump
|
||||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/openbb-congress-gov-v')) || github.event_name == 'workflow_dispatch' }}
|
||||
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/openbb-government-us-v')) || github.event_name == 'workflow_dispatch' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.parse.outputs.version }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
@@ -40,15 +40,15 @@ jobs:
|
||||
env:
|
||||
VERSION: ${{ steps.parse.outputs.version }}
|
||||
run: |
|
||||
STATUS=$(curl -sS -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/openbb-congress-gov/${VERSION}/json")
|
||||
STATUS=$(curl -sS -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/openbb-government-us/${VERSION}/json")
|
||||
case "$STATUS" in
|
||||
200)
|
||||
echo "::error::openbb-congress-gov ${VERSION} is already published on PyPI."
|
||||
echo "Bump openbb_platform/providers/congress_gov/pyproject.toml [project].version and re-merge a fresh release branch."
|
||||
echo "::error::openbb-government-us ${VERSION} is already published on PyPI."
|
||||
echo "Bump openbb_platform/providers/government_us/pyproject.toml [project].version and re-merge a fresh release branch."
|
||||
exit 1
|
||||
;;
|
||||
404)
|
||||
echo "openbb-congress-gov ${VERSION} is not yet on PyPI — proceeding."
|
||||
echo "openbb-government-us ${VERSION} is not yet on PyPI — proceeding."
|
||||
;;
|
||||
*)
|
||||
echo "::error::Unexpected status $STATUS from PyPI JSON API. Aborting to avoid a silent skip."
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
VERSION: ${{ steps.parse.outputs.version }}
|
||||
BRANCH: ${{ github.event.pull_request.head.ref }}
|
||||
run: |
|
||||
EXPECTED="release/openbb-congress-gov-v${VERSION}"
|
||||
EXPECTED="release/openbb-government-us-v${VERSION}"
|
||||
if [ "$BRANCH" != "$EXPECTED" ]; then
|
||||
echo "::error::Release branch '${BRANCH}' does not match pyproject version '${VERSION}'."
|
||||
echo "Expected branch name: '${EXPECTED}'."
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
@@ -95,8 +95,8 @@ jobs:
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openbb-congress-gov-dist
|
||||
path: openbb_platform/providers/congress_gov/dist/
|
||||
name: openbb-government-us-dist
|
||||
path: openbb_platform/providers/government_us/dist/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
@@ -120,7 +120,7 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
@@ -133,8 +133,8 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: openbb-congress-gov-dist
|
||||
path: openbb_platform/providers/congress_gov/dist
|
||||
name: openbb-government-us-dist
|
||||
path: openbb_platform/providers/government_us/dist
|
||||
|
||||
- run: python -m pip install --upgrade pip uv
|
||||
|
||||
@@ -142,12 +142,12 @@ jobs:
|
||||
run: |
|
||||
uv pip install --system ../../core
|
||||
uv pip install --system --group dev
|
||||
uv pip install --system dist/openbb_congress_gov-*.whl
|
||||
uv pip install --system dist/openbb_government_us-*.whl
|
||||
|
||||
- name: Test the installed wheel
|
||||
run: |
|
||||
rm -rf openbb_congress_gov
|
||||
pytest tests --cov=openbb_congress_gov --cov-report=term-missing
|
||||
rm -rf openbb_government_us
|
||||
pytest tests --cov=openbb_government_us --cov-report=term-missing
|
||||
|
||||
publish:
|
||||
name: Publish to PyPI
|
||||
@@ -158,7 +158,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: openbb-congress-gov-dist
|
||||
name: openbb-government-us-dist
|
||||
path: dist
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
@@ -1,18 +1,18 @@
|
||||
name: 🧪 test openbb-congress-gov
|
||||
name: 🧪 test openbb-government-us
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [develop, main, v5]
|
||||
paths:
|
||||
- "openbb_platform/providers/congress_gov/**"
|
||||
- ".github/workflows/test-unit-openbb-congress-gov.yml"
|
||||
- "openbb_platform/providers/government_us/**"
|
||||
- ".github/workflows/test-unit-openbb-government-us.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: test-openbb-congress-gov-${{ github.event.pull_request.number || github.ref }}
|
||||
group: test-openbb-government-us-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
@@ -37,8 +37,8 @@ jobs:
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openbb-congress-gov-dist
|
||||
path: openbb_platform/providers/congress_gov/dist/
|
||||
name: openbb-government-us-dist
|
||||
path: openbb_platform/providers/government_us/dist/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
@@ -66,13 +66,13 @@ jobs:
|
||||
uv pip install --system --group dev
|
||||
|
||||
- name: ruff check
|
||||
run: ruff check openbb_congress_gov tests integration
|
||||
run: ruff check openbb_government_us tests integration
|
||||
|
||||
- name: ruff format --check
|
||||
run: ruff format --check openbb_congress_gov tests integration
|
||||
run: ruff format --check openbb_government_us tests integration
|
||||
|
||||
- name: ty check
|
||||
run: ty check openbb_congress_gov
|
||||
run: ty check openbb_government_us
|
||||
|
||||
test:
|
||||
name: Test (${{ matrix.os }} / Python ${{ matrix.python_version }})
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: openbb_platform/providers/congress_gov
|
||||
working-directory: openbb_platform/providers/government_us
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
@@ -105,8 +105,8 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: openbb-congress-gov-dist
|
||||
path: openbb_platform/providers/congress_gov/dist
|
||||
name: openbb-government-us-dist
|
||||
path: openbb_platform/providers/government_us/dist
|
||||
|
||||
- run: python -m pip install --upgrade pip uv
|
||||
|
||||
@@ -114,9 +114,9 @@ jobs:
|
||||
run: |
|
||||
uv pip install --system ../../core
|
||||
uv pip install --system --group dev
|
||||
uv pip install --system dist/openbb_congress_gov-*.whl
|
||||
uv pip install --system dist/openbb_government_us-*.whl
|
||||
|
||||
- name: Run unit tests against the built wheel
|
||||
run: |
|
||||
rm -rf openbb_congress_gov
|
||||
pytest tests --cov=openbb_congress_gov --cov-report=term-missing --cov-fail-under=100
|
||||
rm -rf openbb_government_us
|
||||
pytest tests --cov=openbb_government_us --cov-report=term-missing --cov-fail-under=100
|
||||
Reference in New Issue
Block a user