-
Notifications
You must be signed in to change notification settings - Fork 6
Pixi update #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Pixi update #193
Conversation
…y management - Added pixi.toml for project configuration and dependencies. - Removed poetry.toml and pyproject.toml files. - Deleted various scripts related to Poetry build and installation processes. - Cleaned up project scripts and configurations to align with new dependency management approach.
- Updated import statements and logging configurations for clarity. - Improved error handling and validation in GridAPPSD class. - Enhanced formatting and style across multiple files to adhere to PEP 8 standards. - Consolidated JSON handling functions for better maintainability. - Added ruff.toml for linting configuration and removed legacy pixi.toml settings. - General cleanup of comments and docstrings for improved documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request modernizes the project's build system and CI/CD pipeline by migrating from Poetry to Pixi and overhauling GitHub Actions workflows. The changes streamline dependency management, standardize code formatting, and improve release automation.
Key changes:
- Migration from Poetry to Pixi for package and environment management
- Implementation of new unified CI workflow with comprehensive testing across Python versions and operating systems
- Overhaul of release workflows to support both stable and development releases with automated versioning and Docker image publishing
Reviewed changes
Copilot reviewed 47 out of 50 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pixi.toml |
New Pixi workspace configuration replacing Poetry, defines dependencies, tasks, and multi-Python environment support |
ruff.toml |
New Ruff linter/formatter configuration for code quality enforcement |
.github/workflows/ci.yml |
New unified CI workflow for linting, type checking, testing, and building |
.github/workflows/release.yml |
Rewritten stable release workflow with Pixi-based builds and Docker publishing |
.github/workflows/deploy-dev-release.yml |
Rewritten development release workflow with flexible version bumping |
README.md |
Updated with Pixi-based development instructions and improved quick start guide |
docs/INSTALLATION.md |
New comprehensive installation guide for various dependency managers |
Dockerfile |
Simplified multi-stage build using Python 3.12 slim base |
gridappsd-python-lib/gridappsd/*.py |
Code formatting updates to comply with Ruff standards |
gridappsd-field-bus-lib/gridappsd_field_bus/*.py |
Code formatting updates to comply with Ruff standards |
| Poetry-specific files | Removed Poetry configuration files (poetry.toml, pyproject.toml at root) |
| Legacy scripts | Removed Poetry-based build and utility scripts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gridappsd-field-bus-lib/gridappsd_field_bus/field_interface/agents/agents.py
Outdated
Show resolved
Hide resolved
gridappsd-field-bus-lib/gridappsd_field_bus/field_interface/interfaces.py
Outdated
Show resolved
Hide resolved
…d update documentation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: craig8 <[email protected]>
…ents/agents.py Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: craig8 <[email protected]>
…terfaces.py Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 48 out of 51 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gridappsd-field-bus-lib/gridappsd_field_bus/field_interface/interfaces.py
Show resolved
Hide resolved
…ck (#194) Addresses review feedback on PR #193 regarding unused code in the `__onmeasurement` callback method. ## Changes - Removed `message["simulation_id"]` access in `Simulation.__onmeasurement()` that extracted but never used the value - The simulation ID is already stored as `self.simulation_id` when the simulation starts, making this extraction redundant ```python def __onmeasurement(self, headers, message): """Call the measurement callbacks""" - message["simulation_id"] # Dead code timestamp = message["message"]["timestamp"] measurements = message["message"]["measurements"] for p in self.__filterable_measurement_callback_set: p[0](self, timestamp, measurements) ``` <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/GRIDAPPSD/gridappsd-python/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
The `dump()` function wrapper was missing a return type annotation,
causing type checking ambiguity.
## Changes
- Added `-> None` return type annotation to `dump()` in
`gridappsd/json_extension.py`
The function wraps `json.dump()`, which writes to a file object and
returns `None`. The annotation now matches the standard library's
signature.
```python
def dump(
data: Any,
fo: TextIO,
*,
skipkeys=False,
ensure_ascii=True,
check_circular=True,
allow_nan=True,
indent=None,
separators=None,
default=None,
sort_keys=False,
**kw,
) -> None: # Added
_json.dump(...)
```
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
Thanks for the feedback on #193. I've created this new PR, which merges into #193, to address your comment. I will work on the changes and keep this PR's description up to date as I make progress. Original PR: #193 Triggering review: #193 (comment) > @copilot open a new pull request to apply changes based on [this feedback](#193 (comment)) <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
…t handling in field_interface
- Included types-python-dateutil version 2.8 or higher - Included types-pyyaml version 6.0 or higher Fixed type errors in gridappsd-python-lib: houses.py: Added TYPE_CHECKING import guard, fixed namedtuple definition json_extension.py: Fixed dataclasses.asdict type narrowing goss.py: Removed duplicate on_error method app_registration.py: Removed Python 2 compatibility import simulation.py: Converted List, Dict, Union → lowercase generics main.py: Fixed call to non-existent run_simulation method Fixed type errors in gridappsd-field-bus-lib: interfaces.py: Converted to lowercase generics, fixed Optional usage, type-narrowed ConnectionType gridappsd_field_bus.py: Implemented stub methods returning proper values context.py: Added missing timeout argument utils.py: Added proper type annotation agents.py: Converted Dict → dict, added proper type annotations context_manager_agents.py: Converted to lowercase generics
…S matrix and standardizing on ubuntu-latest
…nse handling in LocalContext
This pull request overhauls the project's CI/CD GitHub Actions workflows to modernize, simplify, and better align the automation with current project requirements. It introduces a new unified CI workflow, rewrites the development and production release workflows to use Pixi instead of Poetry, and removes legacy or redundant workflows. The changes streamline versioning, testing, packaging, and Docker publishing for both development and stable releases.
Key changes include:
CI Workflow Modernization:
.github/workflows/ci.ymlworkflow that runs linting, formatting, type checking, tests (across multiple OSes and Python versions), coverage reporting, and build steps using Pixi as the environment and package manager. This replaces fragmented or outdated CI processes and ensures consistent quality checks for pushes and pull requests.Release Workflow Overhaul:
release.ymlwith a new workflow that supports both tag-based and manual stable releases. The new workflow uses Pixi for environment management, automates version bumping and tagging, runs all quality checks and tests, builds packages, creates GitHub releases, publishes to PyPI, and builds/pushes multi-platform Docker images.Development Release Workflow Rewrite:
deploy-dev-release.ymlworkflow to support manual, branch-restricted development releases. It enables flexible prerelease version bumping, updates all relevant version files, runs tests and builds, creates GitHub prereleases, and builds/pushes Docker images. The workflow is now Pixi-based and removes PyPI publishing for development releases.Removal of Legacy and Redundant Workflows:
main.ymlDocker build/push workflow, consolidating Docker image publishing into the release workflows for better maintainability and consistency.Build and Docker Publishing Improvements:
These changes provide a more robust, maintainable, and consistent CI/CD pipeline for the project.
CI/CD Workflow Modernization
.github/workflows/ci.ymlto run lint, format, typecheck, test (across OSes and Python versions), coverage, and build steps using Pixi, standardizing CI checks for all pushes and PRs..github/workflows/main.ymlDocker build workflow, consolidating Docker publishing into the new release workflows.Release Automation and Versioning
.github/workflows/release.ymlto support stable releases via tags or manual dispatch, with automated version bumping, Pixi-based builds, GitHub release creation, PyPI publishing, and Docker image build/push.Development Release Improvements
.github/workflows/deploy-dev-release.ymlto allow manual, branch-restricted development releases with flexible prerelease version bumping, Pixi-based builds, GitHub prerelease creation, and Docker image build/push (no PyPI publishing).Build and Docker Publishing Enhancements