Skip to content

Commit 954bcc8

Browse files
authored
updates in version 0.11.1 (#32)
* updates in version 0.11.1 * remove line from test_pydantic * add conftest for integrations tests for model generation * try to fix python3.6 test * use platform to check version * add debug lines * switch package path to parse different way
1 parent 7a2a960 commit 954bcc8

File tree

11 files changed

+331
-181
lines changed

11 files changed

+331
-181
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
exclude = .github,.git,__pycache__,docs/source/conf.py,old,build,dist,models.py,omymodels/test.py
33
ignore = D100, D103, D101, D102, D104,D107, D403, D210, D400, D401, W503, W293, D205
44
max-complexity = 10
5-
max-line-length = 120
5+
max-line-length = 120

CHANGELOG.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
**v0.11.1**
2+
3+
### Improvements:
4+
1. added bytes type to pydantic - https://github.com/xnuinside/omymodels/pull/31
5+
2. parser version updated to the latest
6+
7+
18
**v0.11.0**
29

310
### Fixes:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ If you see any bugs or have any suggestions - feel free to open the issue. Any h
297297

298298

299299
## Changelog
300+
**v0.11.1**
301+
302+
### Improvements:
303+
1. added bytes type to pydantic - https://github.com/xnuinside/omymodels/pull/31
304+
2. parser version updated to the latest
305+
306+
300307
**v0.11.0**
301308

302309
### Fixes:

docs/README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ If you see any bugs or have any suggestions - feel free to open the issue. Any h
314314
Changelog
315315
---------
316316

317+
**v0.11.1**
318+
319+
Improvements:
320+
^^^^^^^^^^^^^
321+
322+
323+
#. added bytes type to pydantic - https://github.com/xnuinside/omymodels/pull/31
324+
#. parser version updated to the latest
325+
317326
**v0.11.0**
318327

319328
Fixes:

poetry.lock

Lines changed: 242 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323

2424
[tool.poetry.dependencies]
2525
python = ">=3.6.2,<4.0"
26-
simple-ddl-parser = "0.22.5"
26+
simple-ddl-parser = "0.26.1"
2727
Jinja2 = "^3.0.1"
2828
py-models-parser = "^0.5.0"
2929
pydantic = "^1.8.2"
@@ -34,6 +34,7 @@ pytest = "^5.2"
3434
m2r = "^0.2.1"
3535
black = "^20.8b1"
3636
twine = "^3.3.0"
37+
mistune = "0.8.4"
3738

3839
[tool.poetry.scripts]
3940
omm = 'omymodels.cli:main'

tests/functional/generator/test_pydantic_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,3 @@ class User(BaseModel):
196196
result = create_models(ddl, models_type="pydantic")
197197

198198
assert expected == result["code"]
199-

tests/integration/__init__.py

Whitespace-only changes.

tests/integration/pydantic/__init__.py

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import importlib
2+
import os
3+
import uuid
4+
from types import ModuleType
5+
from typing import Optional
6+
7+
import pytest
8+
9+
current_path = os.path.dirname(os.path.abspath(__file__))
10+
package = os.path.dirname(os.path.relpath(__file__)).replace("/", ".")
11+
12+
13+
@pytest.fixture
14+
def load_generated_code():
15+
def _inner(code_text: str, module_name: Optional[str] = None) -> ModuleType:
16+
"""method saves & returns new generated python module
17+
code_text - code to be saved in new module
18+
module_name: str - name of the module to use for saving the code
19+
"""
20+
if not module_name:
21+
module_name = f"module_{uuid.uuid1()}"
22+
23+
with open(os.path.join(current_path, f"{module_name}.py"), "w+") as f:
24+
f.write(code_text)
25+
print(current_path, "current_path")
26+
print(package, "package")
27+
module = importlib.import_module(f"{package}.{module_name}")
28+
29+
return module
30+
31+
yield _inner

0 commit comments

Comments
 (0)