P3.1: generate Python SDK prerelease - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5ff22dfd7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _obj = cls.model_validate({ | ||
| "firmware_release_id": obj.get("firmware_release_id"), | ||
| "name": obj.get("name"), | ||
| "metadata": obj.get("metadata") |
There was a problem hiding this comment.
Preserve omitted fields in update factories
When DeviceUpdate.from_dict() or from_json() receives a partial update such as {"metadata": {...}}, these unconditional obj.get() entries pass None for the omitted fields and mark them as explicitly set. to_dict() consequently includes both firmware_release_id and name as null, so update_device() sends a PATCH that can unintentionally clear existing values. Construct the validation input using only keys actually present in obj.
Useful? React with 👍 / 👎.
| def to_json(self) -> str: | ||
| """Returns the JSON representation of the model using alias""" | ||
| # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead | ||
| return json.dumps(self.to_dict()) |
There was a problem hiding this comment.
Encode datetimes before dumping model JSON
Calling Command.to_json() always reaches this statement with required created_at and updated_at values, but to_dict() uses Pydantic's default Python-mode model_dump, which leaves them as datetime objects. The standard json.dumps() encoder therefore raises TypeError: Object of type datetime is not JSON serializable; the same issue affects the other generated models containing datetimes. Use Pydantic's JSON-mode serialization or otherwise encode datetime values first.
Useful? React with 👍 / 👎.
| readme = "README.md" | ||
| requires-python = ">=3.9" | ||
| authors = [{ name = "CoreLink Platform" }] | ||
| license = "Proprietary" |
There was a problem hiding this comment.
Use valid PEP 621 license metadata
This value is not a valid SPDX license expression, so supported setuptools versions reject the project metadata before building a wheel; for example, setuptools 79 reports that project.license matches none of its permitted definitions. Older setuptools versions covered by the declared setuptools>=68 requirement expect the table form instead, so the package is not reliably buildable as configured. Use a valid LicenseRef-* expression with a sufficiently new setuptools floor, or use the compatible { text = "Proprietary" } form.
Useful? React with 👍 / 👎.
| "ca_certs": configuration.ssl_ca_cert, | ||
| "cert_file": configuration.cert_file, | ||
| "key_file": configuration.key_file, | ||
| "ca_cert_data": configuration.ca_cert_data, |
There was a problem hiding this comment.
Avoid unsupported ca_cert_data on allowed urllib3 versions
In environments using urllib3 2.0.7, which satisfies the declared urllib3>=1.25.3,<3.0.0 dependency, passing this key into PoolManager causes every API request to fail before network I/O with TypeError: PoolKey.__new__() got an unexpected keyword argument 'key_ca_cert_data'. Omit the argument when it is unset or raise the urllib3 lower bound to a version whose pool key supports it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 047fe3cb24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ## Planned capabilities | ||
| - Contract: `corelink-public-v1.yaml`, version `1.0.0-draft` | ||
| - Source branch: `agent/p3-1-contracts` | ||
| - Source commit: `701e693` |
There was a problem hiding this comment.
Record the actual contract commit
The README attributes this generated SDK to 701e693, while both .corelink-contract.json and CODEGEN.md identify the authoritative input as 2fb0dc8. This makes the documented provenance ambiguous and could cause a release or regeneration audit to select the wrong contract revision; update this entry to match the authoritative metadata.
Useful? React with 👍 / 👎.
| -g python \ | ||
| -o . \ | ||
| --additional-properties=packageName=corelink_sdk,projectName=corelink-sdk,packageVersion=0.1.0.dev0 \ | ||
| --global-property=apiDocs=false,modelDocs=false |
There was a problem hiding this comment.
Make the regeneration command reproduce the checked-in tree
Running this documented command in a clean worktree also generates supporting files recorded in .openapi-generator/FILES, including setup.py, setup.cfg, tox.ini, and several CI workflows; a repo-wide path check confirms those files are absent here, and .openapi-generator-ignore does not suppress them. Consequently the stated procedure cannot produce a clean generated diff without undocumented manual deletion, undermining deterministic regeneration; constrain the generated supporting files or document the cleanup step.
Useful? React with 👍 / 👎.
Part of CoreLinkPlatform/platform#94; depends on CoreLinkPlatform/api-contracts#2 and CoreLinkPlatform/platform#144.
Generated with OpenAPI Generator 7.12.0 from
corelink-public-v1.yamlat contract commit701e693.Validation: package wheel built successfully; generated modules compile and import against the platform test environment.