-
Notifications
You must be signed in to change notification settings - Fork 1
Rework project structure #55
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
Conversation
This exception is exposed to the user in blueye.sdk, so to avoid having to make a breaking change there we'll duplicate it here.
3.0.0 is an old yanked version.
1f59dc3 to
31e5e2a
Compare
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
Reorganize the project by extracting legacy UDP/TCP protocol code into its own package, replacing Poetry/Flake8 with uv/Ruff, and removing setup.py in favor of PEP 621 metadata.
- Extract legacy protocol modules into
blueye.legacyprotocolwith its own pyproject.toml, README, and LICENSE - Update generators and imports to point to the new
legacyprotocolpath - Migrate CI workflows from Poetry/flake8 to uv/Ruff and remove
setup.py
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| legacyprotocol/pyproject.toml | Added project metadata and dependencies for new package |
| legacyprotocol/blueye/legacyprotocol/udp_protocol_parser.py | Refactored parser, updated imports, and formatting |
| legacyprotocol/blueye/legacyprotocol/udp_protocol_dict.py | Bumped _generator_hash in autogenerated protocol dictionary |
| legacyprotocol/blueye/legacyprotocol/udp_client.py | Switched to local exception import and streamlined socket init |
| legacyprotocol/blueye/legacyprotocol/tcp_client.py | Updated exception imports to use local package |
| legacyprotocol/blueye/legacyprotocol/init.py | Defined public API exports |
| legacyprotocol/README.md | Added package overview and deprecation notice |
| legacyprotocol/LICENSE | Included LGPLv3 license text |
| generators/generate_udp_protocol.py | Changed hard-coded paths to script-relative paths |
| generators/generate_tcp_protocol.py | Updated module path and cleaned code formatting |
| blueye/protocol/init.py | Removed legacy protocol exports from the main package |
| blueye/init.py | Dropped deprecated pkg_resources namespace declaration |
| README.md | Updated to uv/Ruff and removed setup.py instructions |
| .github/workflows/update-protocol.yml | Switched CI from Poetry to uv in update workflow |
| .github/workflows/tests.yml | Switched CI from Poetry to uv and flake8 to Ruff in tests |
| .github/workflows/publish-release.yml | Switched CI from Poetry to uv for release publishing |
| .flake8 | Removed old Flake8 configuration |
Comments suppressed due to low confidence (4)
legacyprotocol/blueye/legacyprotocol/udp_protocol_parser.py:83
- Using
peek()only works on gzip file objects; for regular filesopen()doesn’t exposepeek(). Consider reading the first two bytes withread(2)then seeking back or always wrapping in a buffered stream that supports peek.
version, packet_type = bin_file.peek(2)[:2]
legacyprotocol/blueye/legacyprotocol/udp_protocol_parser.py:52
- Typo in error message: 'Endianess' should be spelled 'Endianness'.
raise ValueError("Endianess not supported")
legacyprotocol/blueye/legacyprotocol/udp_protocol_parser.py:1
- Key methods like
np_array_from_fileandunpack_datalack associated tests. Consider adding unit tests to cover gzipped and non-gzipped parsing, edge cases, and version mismatches.
#!/usr/bin/env python3
legacyprotocol/pyproject.toml:24
- The dev dependencies still include Flake8 even though the CI and docs now reference Ruff—remove Flake8 to avoid redundant linting tools.
"flake8~=7.1",
| with open(protocol_definitions_path, "r") as f: | ||
| data = json.loads(f.read(), object_pairs_hook=OrderedDict) | ||
|
|
||
| protocol_md5 = md5(protocol_definitions_path) |
Copilot
AI
Jun 6, 2025
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.
You compute protocol_md5 and generator_script_md5 but never inject them into data_file. Update the template to embed these checksums in the generated header so _json_hash and _generator_hash stay in sync.
88cf799 to
9175f78
Compare
9175f78 to
faa2516
Compare
blueye.legacyprotocol). This is a breaking change, hence the version bump to v3.