Skip to content

Commit

Permalink
Add python SDK to CLI (#1432)
Browse files Browse the repository at this point in the history
* Add python SDK to CLI

* Update live-test

* Add release blocker
  • Loading branch information
zachkirsch authored Mar 26, 2023
1 parent c11adfc commit fb96305
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const GeneratorName = {
JAVA_SPRING: "fernapi/fern-java-spring",
PYTHON_FASTAPI: "fernapi/fern-fastapi-server",
PYTHON_PYDANTIC: "fernapi/fern-pydantic-model",
PYTHON_SDK: "fernapi/fern-python-sdk",
OPENAPI: "fernapi/fern-openapi",
STOPLIGHT: "fernapi/fern-stoplight",
POSTMAN: "fernapi/fern-postman",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const GENERATOR_INVOCATIONS: Record<GeneratorName, Omit<GeneratorInvocati
[GeneratorName.PYTHON_FASTAPI]: {
version: "0.0.33",
},
[GeneratorName.PYTHON_SDK]: {
version: "0.0.52-3-gd9df38df",
},
[GeneratorName.OPENAPI]: {
version: "0.0.11",
config: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export const V10_TO_V9_MIGRATION: IrMigration<
[GeneratorName.PYTHON_FASTAPI]: AlwaysRunMigration,
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v10): IrVersions.V9.ir.IntermediateRepresentation => {
const v9Services: Record<IrVersions.V9.commons.ServiceId, IrVersions.V9.http.HttpService> = mapValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export const V11_TO_V10_MIGRATION: IrMigration<
[GeneratorName.PYTHON_FASTAPI]: AlwaysRunMigration,
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: "0.0.40-1-g9aa2117",
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v11, context): IrVersions.V10.ir.IntermediateRepresentation => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const V12_TO_V11_MIGRATION: IrMigration<
[GeneratorName.STOPLIGHT]: "0.0.23-8-g479c860",
[GeneratorName.OPENAPI]: "0.0.22-1-g1c86b58",
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v12, { taskContext, targetGenerator }): IrVersions.V11.ir.IntermediateRepresentation => {
const v11Types: Record<string, IrVersions.V11.types.TypeDeclaration> = mapValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const V13_TO_V12_MIGRATION: IrMigration<
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v13): IrVersions.V12.ir.IntermediateRepresentation => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const V14_TO_V13_MIGRATION: IrMigration<
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v14): IrVersions.V13.ir.IntermediateRepresentation => {
const v13Types: Record<string, IrVersions.V13.types.TypeDeclaration> = mapValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const V15_TO_V14_MIGRATION: IrMigration<
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: "0.0.52-3-gd9df38df",
},
migrateBackwards: (v14): IrVersions.V14.ir.IntermediateRepresentation => {
const v13Types: Record<string, IrVersions.V14.types.TypeDeclaration> = mapValues(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const V2_TO_V1_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
},
migrateBackwards: (v2): IrVersions.V1.ir.IntermediateRepresentation => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const V3_TO_V2_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
},
migrateBackwards: (v3): IrVersions.V2.ir.IntermediateRepresentation => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export const V4_TO_V3_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI]: "0.0.11-4-g1c29f6c",
[GeneratorName.POSTMAN]: "0.0.32-rc0",
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v4): IrVersions.V3.ir.IntermediateRepresentation => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const V5_TO_V4_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: "0.0.33-9-gf683b5e",
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
},
migrateBackwards: (v5): IrVersions.V4.ir.IntermediateRepresentation => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export const V6_TO_V5_MIGRATION: IrMigration<
[GeneratorName.PYTHON_FASTAPI]: "0.0.35-1-g071a04a",
[GeneratorName.PYTHON_PYDANTIC]: "0.0.35-1-g071a04a",
[GeneratorName.OPENAPI]: "0.0.16-1-ga2c0ada",
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
},
migrateBackwards: (v6, { taskContext, targetGenerator }): IrVersions.V5.ir.IntermediateRepresentation => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export const V7_TO_V6_MIGRATION: IrMigration<
[GeneratorName.PYTHON_FASTAPI]: AlwaysRunMigration,
[GeneratorName.PYTHON_PYDANTIC]: AlwaysRunMigration,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
},
migrateBackwards: (v7): IrVersions.V6.ir.IntermediateRepresentation => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export const V8_TO_V7_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: "0.0.45-1-g8bb600f",
[GeneratorName.OPENAPI_PYTHON_CLIENT]: "0.0.0",
[GeneratorName.OPENAPI]: "0.0.20-1-gbbeb9bd",
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v8): IrVersions.V7.ir.IntermediateRepresentation => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const V9_TO_V8_MIGRATION: IrMigration<
[GeneratorName.PYTHON_PYDANTIC]: "0.0.51-1-g977dd1f",
[GeneratorName.OPENAPI_PYTHON_CLIENT]: AlwaysRunMigration,
[GeneratorName.OPENAPI]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: AlwaysRunMigration,
[GeneratorName.STOPLIGHT]: undefined,
[GeneratorName.POSTMAN]: AlwaysRunMigration,
[GeneratorName.PYTHON_SDK]: undefined,
},
migrateBackwards: (v9, { taskContext, targetGenerator }): IrVersions.V8.ir.IntermediateRepresentation => {
for (const [_, type] of Object.entries(v9.types)) {
Expand Down
3 changes: 2 additions & 1 deletion release-blockers.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# if there are any release blockers in this list, releasing will fail on Circle
release-blockers: []
release-blockers:
- fern-python version is a dev version
1 change: 1 addition & 0 deletions scripts/live-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ echo "Running Fern Commands!"
set -x
node "$cli_path" init --organization fern
node "$cli_path" add fern-java-sdk
node "$cli_path" add fern-python-sdk
node "$cli_path" add fern-postman
node "$cli_path" generate --log-level debug
set +x
Expand Down

0 comments on commit fb96305

Please sign in to comment.