Skip to content

updated packages and GHA#253

Merged
Padraic Shafer (padraic-shafer) merged 9 commits into
NSLS2:mainfrom
HarikaBishai:feature/update-packages
May 12, 2026
Merged

updated packages and GHA#253
Padraic Shafer (padraic-shafer) merged 9 commits into
NSLS2:mainfrom
HarikaBishai:feature/update-packages

Conversation

@HarikaBishai

@HarikaBishai Harika Bishai (HarikaBishai) commented May 6, 2026

Copy link
Copy Markdown
Contributor

This pull request includes a series of dependency updates, workflow improvements, and resource management fixes across the codebase. The most significant changes are grouped below by theme.

Dependency and Development Environment Updates:

  • Updated multiple Python package dependencies to their latest versions in requirements-dev.txt to address security, compatibility, and feature improvements. Notable updates include aiohttp, anyio, attrs, black, certifi, locust, pytest, and many others. Removed pytest-asyncio and added new dependencies such as python-discovery and vcs-versioning. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
  • Updated pyproject.toml to use anyio_mode instead of asyncio_mode for pytest configuration, reflecting the shift away from pytest-asyncio.
  • Removed pytest-asyncio from requirements-dev.in, aligning with the above configuration change.

CI/CD Workflow Improvements:

  • Upgraded several GitHub Actions in .github/workflows/docker-publish.yml to their latest versions for improved security and reliability. Also standardized YAML formatting for consistency. [1] [2] [3]
  • Minor cleanup in the workflow environment section.

Resource Management and Database Connection Handling:

  • Modified MongoDB connection initialization in scripts (scripts/create_new_beamline.py, scripts/update_beamline.py) and the FastAPI app lifespan (src/nsls2api/infrastructure/app_setup.py) to return and explicitly close the MongoDB client, ensuring proper cleanup of resources. [1] [2] [3] [4] [5] [6] [7]

Model and Schema Adjustments:

  • Updated the ApiUser model in src/nsls2api/models/apikeys.py to use json_schema_extra for the user_api_keys field, improving schema clarity. https://beanie-odm.dev/tutorial/relations/#back-links
  • Updated the ProposalDisplay model in src/nsls2api/models/proposals.py to use the modern model_config approach with ConfigDict for extra field handling, replacing the deprecated Config class. [1] [2]

Minor Script and Typing Fixes:

  • Minor fix to add a trailing comma in a function call for consistency in scripts/update_beamline.py.

These changes collectively improve dependency management, resource handling, and codebase maintainability.

Commands to Upgrade Dependencies:

uv pip compile requirements-dev.in --upgrade -o requirements-dev.txt
uv pip compile requirements.in --upgrade -o requirements.txt

Test Cases Summary:

image

JIRA: https://jira.nsls2.bnl.gov/browse/DT1-1431

@HarikaBishai Harika Bishai (HarikaBishai) marked this pull request as draft May 6, 2026 21:53
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@HarikaBishai Harika Bishai (HarikaBishai) marked this pull request as ready for review May 7, 2026 15:00
@HarikaBishai Harika Bishai (HarikaBishai) changed the title updated packages updated packages and GHA May 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes look good, though if we can continue to use any, let's use that instead of asyncio.

Co-authored-by: Copilot <copilot@github.com>
Comment thread src/nsls2api/tests/conftest.py
@HarikaBishai

Copy link
Copy Markdown
Contributor Author

All changes look good, though if we can continue to use any, let's use that instead of asyncio.

I have changed all the tests to use anyio, updated pyproject.toml to use anyio_mode

Had to add

@pytest.fixture
def anyio_backend():
    return "asyncio"

in confest.py to run all @pytest.mark.anyio tests using the asyncio backend only.

image

Comment thread requirements-dev.in Outdated
Co-authored-by: Copilot <copilot@github.com>
@padraic-shafer Padraic Shafer (padraic-shafer) merged commit bcae7d6 into NSLS2:main May 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants