Skip to content

Commit

Permalink
feat: Add Python Support
Browse files Browse the repository at this point in the history
Support producing Python 3.6+ artifacts
  • Loading branch information
dstufft committed Mar 12, 2019
1 parent b2e106e commit cc3ec87
Show file tree
Hide file tree
Showing 51 changed files with 4,815 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 88
exclude = *.egg,*/interfaces.py,node_modules,.state
ignore = W503,E203
select = E,W,F,N
7 changes: 7 additions & 0 deletions packages/jsii-build-tools/bin/package-python
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail

rm -rf dist/python
mkdir -p dist/python
mv *.whl dist/python
mv *.tar.gz dist/python
3 changes: 2 additions & 1 deletion packages/jsii-build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"package-js": "bin/package-js",
"package-java": "bin/package-java",
"package-dotnet": "bin/package-dotnet",
"package-ruby": "bin/package-ruby"
"package-ruby": "bin/package-ruby",
"package-python": "bin/package-python"
},
"scripts": {
"build": "chmod +x bin/*"
Expand Down
67 changes: 67 additions & 0 deletions packages/jsii-calc/lib/compliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,73 @@ export class JavaReservedWords {
public while = 'hello';
}

export class PythonReservedWords {

public and() {}

public as() {}

public assert() {}

public async() {}

public await() {}

public break() {}

public class() {}

public continue() {}

public def() {}

public del() {}

public elif() {}

public else() {}

public except() {}

public finally() {}

public for() {}

public from() {}

public global() {}

public if() {}

public import() {}

public in() {}

public is() {}

public lambda() {}

public nonlocal() {}

public not() {}

public or() {}

public pass() {}

public raise() {}

public return() {}

public try() {}

public while() {}

public with() {}

public yield() {}
}

export interface UnionProperties {
foo?: string | number;
readonly bar: AllTypes | string | number;
Expand Down
109 changes: 108 additions & 1 deletion packages/jsii-calc/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,113 @@
],
"name": "PublicClass"
},
"jsii-calc.PythonReservedWords": {
"assembly": "jsii-calc",
"fqn": "jsii-calc.PythonReservedWords",
"initializer": {
"initializer": true
},
"kind": "class",
"methods": [
{
"name": "and"
},
{
"name": "as"
},
{
"name": "assert"
},
{
"name": "async"
},
{
"name": "await"
},
{
"name": "break"
},
{
"name": "class"
},
{
"name": "continue"
},
{
"name": "def"
},
{
"name": "del"
},
{
"name": "elif"
},
{
"name": "else"
},
{
"name": "except"
},
{
"name": "finally"
},
{
"name": "for"
},
{
"name": "from"
},
{
"name": "global"
},
{
"name": "if"
},
{
"name": "import"
},
{
"name": "in"
},
{
"name": "is"
},
{
"name": "lambda"
},
{
"name": "nonlocal"
},
{
"name": "not"
},
{
"name": "or"
},
{
"name": "pass"
},
{
"name": "raise"
},
{
"name": "return"
},
{
"name": "try"
},
{
"name": "while"
},
{
"name": "with"
},
{
"name": "yield"
}
],
"name": "PythonReservedWords"
},
"jsii-calc.ReferenceEnumFromScopedPackage": {
"assembly": "jsii-calc",
"docs": {
Expand Down Expand Up @@ -3842,5 +3949,5 @@
}
},
"version": "0.7.15",
"fingerprint": "P2Hdg9vVBT0QqTFN71VaRnkkGvJ74jnUBL7BduuDsjU="
"fingerprint": "IWSOEhdZzuvrss5K2WBjZCawXayV13yCAKTj/kJ9+mo="
}

0 comments on commit cc3ec87

Please sign in to comment.