Skip to content

Commit cc3ec87

Browse files
authored
feat: Add Python Support
Support producing Python 3.6+ artifacts
1 parent b2e106e commit cc3ec87

51 files changed

Lines changed: 4815 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
exclude = *.egg,*/interfaces.py,node_modules,.state
4+
ignore = W503,E203
5+
select = E,W,F,N
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
rm -rf dist/python
5+
mkdir -p dist/python
6+
mv *.whl dist/python
7+
mv *.tar.gz dist/python

packages/jsii-build-tools/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"package-js": "bin/package-js",
99
"package-java": "bin/package-java",
1010
"package-dotnet": "bin/package-dotnet",
11-
"package-ruby": "bin/package-ruby"
11+
"package-ruby": "bin/package-ruby",
12+
"package-python": "bin/package-python"
1213
},
1314
"scripts": {
1415
"build": "chmod +x bin/*"

packages/jsii-calc/lib/compliance.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,73 @@ export class JavaReservedWords {
856856
public while = 'hello';
857857
}
858858

859+
export class PythonReservedWords {
860+
861+
public and() {}
862+
863+
public as() {}
864+
865+
public assert() {}
866+
867+
public async() {}
868+
869+
public await() {}
870+
871+
public break() {}
872+
873+
public class() {}
874+
875+
public continue() {}
876+
877+
public def() {}
878+
879+
public del() {}
880+
881+
public elif() {}
882+
883+
public else() {}
884+
885+
public except() {}
886+
887+
public finally() {}
888+
889+
public for() {}
890+
891+
public from() {}
892+
893+
public global() {}
894+
895+
public if() {}
896+
897+
public import() {}
898+
899+
public in() {}
900+
901+
public is() {}
902+
903+
public lambda() {}
904+
905+
public nonlocal() {}
906+
907+
public not() {}
908+
909+
public or() {}
910+
911+
public pass() {}
912+
913+
public raise() {}
914+
915+
public return() {}
916+
917+
public try() {}
918+
919+
public while() {}
920+
921+
public with() {}
922+
923+
public yield() {}
924+
}
925+
859926
export interface UnionProperties {
860927
foo?: string | number;
861928
readonly bar: AllTypes | string | number;

packages/jsii-calc/test/assembly.jsii

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2932,6 +2932,113 @@
29322932
],
29332933
"name": "PublicClass"
29342934
},
2935+
"jsii-calc.PythonReservedWords": {
2936+
"assembly": "jsii-calc",
2937+
"fqn": "jsii-calc.PythonReservedWords",
2938+
"initializer": {
2939+
"initializer": true
2940+
},
2941+
"kind": "class",
2942+
"methods": [
2943+
{
2944+
"name": "and"
2945+
},
2946+
{
2947+
"name": "as"
2948+
},
2949+
{
2950+
"name": "assert"
2951+
},
2952+
{
2953+
"name": "async"
2954+
},
2955+
{
2956+
"name": "await"
2957+
},
2958+
{
2959+
"name": "break"
2960+
},
2961+
{
2962+
"name": "class"
2963+
},
2964+
{
2965+
"name": "continue"
2966+
},
2967+
{
2968+
"name": "def"
2969+
},
2970+
{
2971+
"name": "del"
2972+
},
2973+
{
2974+
"name": "elif"
2975+
},
2976+
{
2977+
"name": "else"
2978+
},
2979+
{
2980+
"name": "except"
2981+
},
2982+
{
2983+
"name": "finally"
2984+
},
2985+
{
2986+
"name": "for"
2987+
},
2988+
{
2989+
"name": "from"
2990+
},
2991+
{
2992+
"name": "global"
2993+
},
2994+
{
2995+
"name": "if"
2996+
},
2997+
{
2998+
"name": "import"
2999+
},
3000+
{
3001+
"name": "in"
3002+
},
3003+
{
3004+
"name": "is"
3005+
},
3006+
{
3007+
"name": "lambda"
3008+
},
3009+
{
3010+
"name": "nonlocal"
3011+
},
3012+
{
3013+
"name": "not"
3014+
},
3015+
{
3016+
"name": "or"
3017+
},
3018+
{
3019+
"name": "pass"
3020+
},
3021+
{
3022+
"name": "raise"
3023+
},
3024+
{
3025+
"name": "return"
3026+
},
3027+
{
3028+
"name": "try"
3029+
},
3030+
{
3031+
"name": "while"
3032+
},
3033+
{
3034+
"name": "with"
3035+
},
3036+
{
3037+
"name": "yield"
3038+
}
3039+
],
3040+
"name": "PythonReservedWords"
3041+
},
29353042
"jsii-calc.ReferenceEnumFromScopedPackage": {
29363043
"assembly": "jsii-calc",
29373044
"docs": {
@@ -3842,5 +3949,5 @@
38423949
}
38433950
},
38443951
"version": "0.7.15",
3845-
"fingerprint": "P2Hdg9vVBT0QqTFN71VaRnkkGvJ74jnUBL7BduuDsjU="
3952+
"fingerprint": "IWSOEhdZzuvrss5K2WBjZCawXayV13yCAKTj/kJ9+mo="
38463953
}

0 commit comments

Comments
 (0)