-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(protocol-designer): start wiring up "Export Python" button to generate Python #17453
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## edge #17453 +/- ##
==========================================
- Coverage 20.07% 20.05% -0.02%
==========================================
Files 3187 3194 +7
Lines 229811 230200 +389
Branches 8190 8204 +14
==========================================
+ Hits 46132 46171 +39
- Misses 183679 184029 +350
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -47,6 +47,7 @@ import type { | |||
import type { LabwareDefByDefURI } from '../../labware-defs' | |||
import type { Selector } from '../../types' | |||
import type { PDMetadata } from '../../file-types' | |||
import { pythonImports, pythonMetadata } from './pythonFile' |
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.
can this import go above the types? 😄
not sure if you were told our preferred import order but we like to do it like:
- dependencies
- top level imports from other projects like
@opentrons/components
- local paths furtherest away to closest so like
../.../
should go above../
- types (types follow the same pattern as a non type)
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.
Ah, I wasn't aware of that preferred order, thanks!
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.
looks great, just left a small nit. Thanks for leaving the comments, they make it easy to follow along whats going on. Tested it out and got the python metadata output 🚀
…nerate Python (#17453) # Overview Make the "Export Python" button start generating the skeleton of a Python protocol file. This just generates the `metadata` section right now. AUTH-1091 AUTH-1393 AUTH-1385 I tried to follow the structure of the existing `createFile()` function. Eventually, the `createPythonFile()` function is just going to replace `createFile()`, so that's why I'm reusing the existing `SAVE_PROTOCOL_FILE` action rather than defining a bunch of new Python-specific constants and interfaces. ## Test Plan and Hands on Testing Added unit tests for both the top-level file creator, and for the specific metadata fields. I also tested the button in my browser. ## Risk assessment Low. This is all hidden behind a feature flag, and doesn't interact with any existing functionality.
…nerate Python (#17453) # Overview Make the "Export Python" button start generating the skeleton of a Python protocol file. This just generates the `metadata` section right now. AUTH-1091 AUTH-1393 AUTH-1385 I tried to follow the structure of the existing `createFile()` function. Eventually, the `createPythonFile()` function is just going to replace `createFile()`, so that's why I'm reusing the existing `SAVE_PROTOCOL_FILE` action rather than defining a bunch of new Python-specific constants and interfaces. ## Test Plan and Hands on Testing Added unit tests for both the top-level file creator, and for the specific metadata fields. I also tested the button in my browser. ## Risk assessment Low. This is all hidden behind a feature flag, and doesn't interact with any existing functionality.
Overview
Make the "Export Python" button start generating the skeleton of a Python protocol file. This just generates the
metadata
section right now. AUTH-1091 AUTH-1393 AUTH-1385I tried to follow the structure of the existing
createFile()
function. Eventually, thecreatePythonFile()
function is just going to replacecreateFile()
, so that's why I'm reusing the existingSAVE_PROTOCOL_FILE
action rather than defining a bunch of new Python-specific constants and interfaces.Test Plan and Hands on Testing
Added unit tests for both the top-level file creator, and for the specific metadata fields.
I also tested the button in my browser.
Risk assessment
Low. This is all hidden behind a feature flag, and doesn't interact with any existing functionality.