Skip to content

Commit 50d6cf9

Browse files
authored
Removed support for Python 2.x (#197)
1 parent 77787c8 commit 50d6cf9

25 files changed

+3
-513
lines changed

Diff for: README.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Generate code from JSON schema files.
1212
- [Installation](#installation)
1313
- [Usage](#usage)
1414
- [Code generation](#code-generation)
15-
- [Python2](#python-2)
1615
- [Python3](#python-3)
1716
- [Python3+Marshmallow](#python-3marshmallow)
1817
- [JavaScript+Flow and Flow](#javascriptflow-and-flow)
@@ -70,7 +69,7 @@ This allows the tool to be language agnostic, that is it just needs to generate
7069
7170
List of currently supported languages:
7271
73-
- Python 2.7+
72+
- Python 3.7+
7473
- JavaScript ES7+ with Flow annotations
7574
- pure Flow annotations
7675
@@ -109,14 +108,6 @@ optional arguments:
109108
110109
# Code generation
111110
112-
## Python 2
113-
114-
The generation of Python's code is integrated into the tool so it needs just a single invocation:
115-
116-
```shell
117-
json_codegen --language python --output <output_py_file> <json-schema>
118-
```
119-
120111
## Python 3
121112
122113
The egenerator of pure Python 3 compatible code:

Diff for: json_codegen/cli.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
LANGUAGES = {
14-
"python2": generators.Python2Generator,
1514
"python3": generators.Python3Generator,
1615
"python3+marshmallow": generators.Python3MarshmallowGenerator,
1716
"javascript+flow": generators.JavaScriptFlowGenerator,
@@ -49,7 +48,7 @@ def main():
4948
help=(
5049
"Output language. "
5150
"This option will be ignored if the --generator option is used. "
52-
"Default is python2"
51+
"Default is python3"
5352
),
5453
)
5554

Diff for: json_codegen/generators/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from json_codegen.generators.python2 import Python2Generator
21
from json_codegen.generators.python3 import Python3Generator
32
from json_codegen.generators.python3_marshmallow import Python3MarshmallowGenerator
43
from json_codegen.generators.javascript_flow import JavaScriptFlowGenerator

Diff for: json_codegen/generators/python2.py

-292
This file was deleted.

Diff for: tests/cli_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def test_langages():
88
languages = set(cli.LANGUAGES.keys())
9-
expected = set(["python2", "python3", "python3+marshmallow", "javascript+flow", "flow"])
9+
expected = set(["python3", "python3+marshmallow", "javascript+flow", "flow"])
1010

1111
assert languages == expected
1212

Diff for: tests/fixtures/python2/additional_properties_with_ref.py

-17
This file was deleted.

Diff for: tests/fixtures/python2/array_items_ref.py

-15
This file was deleted.

Diff for: tests/fixtures/python2/array_items_ref_as_alias.py

-8
This file was deleted.

0 commit comments

Comments
 (0)