Skip to content

Commit 95b3ec4

Browse files
authored
Merge pull request #10 from bogdandm/cli
Cli
2 parents df9efb0 + 745f265 commit 95b3ec4

34 files changed

+37666
-319
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ exclude_lines =
88
pragma: no cover
99
def __repr__
1010
def __str__
11+
def main
1112
if self\.debug
1213
raise AssertionError
1314
raise NotImplementedError

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22
.pytest_cache/
33
venv/
44
/test.py
5+
/json2python-models-*/
56

67
htmlcov/
78
.coverage
9+
.coverage.*
810
coverage.xml
911

1012
*.pyc
1113
*.log
1214
*.tmp
1315
tmp.*
1416

15-
testing_tools/real_apis/*/
17+
testing_tools/real_apis/*/
18+
19+
.eggs/
20+
build/
21+
dist/
22+
lib/
23+
*.egg-info/

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ dist: xenial
33
language: python
44
cache: pip
55
install:
6-
- pip install -r requirements.txt
6+
- python setup.py install
77
- pip install pytest pytest-cov requests coveralls codacy-coverage
88
script:
9-
- pytest --cov-config .coveragerc --cov=json_to_models -m "not no_expected" test/
9+
- python setup.py test -a '--cov-config .coveragerc --cov=json_to_models -m "not no_expected" test/'
1010
after_success:
1111
- coverage xml
1212
- coveralls

TODO.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- (!) README.md
2-
- Remove OrderedDict (dictionaries in Python 3.7 are now ordered)
2+
- Do not use OrderedDict (dictionaries in Python 3.7 are now ordered)
33
- Features
44
- Models layer
55
- [X] Data variant converting
@@ -28,20 +28,15 @@
2828
- [ ] OptionalFieldsPolicy
2929
- [X] Merge (default)
3030
- [ ] Field sets
31-
- [ ] Key as data (does not process json dict as a model but process it as a python dict)
31+
- [X] Key as data (does not process json dict as a model but process it as a python dict)
3232
- [ ] Complex python types annotations
3333
- [ ] Decorator to specify field metatype
3434
- [ ] Specify metatype in attr/dataclass argument (if dataclasses has such)
35-
- [ ] String based types (Warning: 6 times slow down)
35+
- [X] String based types (Warning: 6 times slow down)
3636
- [X] ISO date
3737
- [X] ISO time
3838
- [X] ISO datetime
39-
- API Layer
40-
- [ ] Route object
41-
- [ ] Register model as route in/out data spec
42-
- Generate OpenAPI spec
43-
- [ ] Meta-model -> OpenAPI model converter
44-
- [ ] Route -> OpenAPI converter
39+
- [ ] Cli tool
4540

4641
- Testing
4742
- Models layer
@@ -62,20 +57,22 @@
6257
- [ ] Implement existing models registration
6358
- [ ] attrs
6459
- [ ] dataclasses
60+
- [X] String based types
61+
- [X] ISO date
62+
- [X] ISO time
63+
- [X] ISO datetime
64+
65+
- Build, Deploy, CI
66+
- [ ] setup.py
67+
- [ ] setup.py + pytest integration
68+
- [X] TravisCI integration
69+
- [ ] pip package
70+
71+
- Long term plans
6572
- API Layer
6673
- [ ] Route object
6774
- [ ] Register model as route in/out data spec
6875
- Generate OpenAPI spec
6976
- [ ] Meta-model -> OpenAPI model converter
70-
- [ ] Route -> OpenAPI converter
71-
- [ ] String based types
72-
- [ ] ISO date
73-
- [ ] ISO time
74-
- [ ] ISO datetime
75-
76-
- Build, Deploy, CI
77-
- [ ] setup.py
78-
- [ ] setup.py + pytest integration
79-
- [ ] Tox integration
80-
- [X] TravisCI integration
81-
- [ ] pip package
77+
- [ ] Route -> OpenAPI converter
78+
- [ ] Tox integration

json_to_models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from pkg_resources import parse_version
2+
3+
__version__ = "0.1a1"
4+
VERSION = parse_version(__version__)

json_to_models/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if __name__ == '__main__':
2+
from json_to_models.cli import main
3+
4+
main()

0 commit comments

Comments
 (0)