Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: koxudaxi/datamodel-code-generator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.27.0
Choose a base ref
...
head repository: koxudaxi/datamodel-code-generator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.27.1
Choose a head ref
  • 2 commits
  • 6 files changed
  • 3 contributors

Commits on Feb 6, 2025

  1. Support isort 6 (#2289)

    The breaking changes in isort 6 are just to remove support for Python
    3.8 (see https://github.com/PyCQA/isort/releases), so there's no need
    for this project to treat it differently from isort 5.
    
    Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
    cjwatson and koxudaxi authored Feb 6, 2025
    Copy the full SHA
    94c21e6 View commit details
  2. Fix version CLI showing 0.0.0 (#2305)

    Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
    gaborbernat authored Feb 6, 2025
    Copy the full SHA
    2eac729 View commit details
Showing with 112 additions and 108 deletions.
  1. +2 −2 datamodel_code_generator/__main__.py
  2. +0 −1 datamodel_code_generator/version.py
  3. +1 −1 pyproject.toml
  4. +2 −2 tests/main/graphql/test_main_graphql.py
  5. +1 −1 tests/main/jsonschema/test_main_jsonschema.py
  6. +106 −101 uv.lock
4 changes: 2 additions & 2 deletions datamodel_code_generator/__main__.py
Original file line number Diff line number Diff line change
@@ -399,9 +399,9 @@ def main(args: Optional[Sequence[str]] = None) -> Exit:
arg_parser.parse_args(args, namespace=namespace)

if namespace.version:
from datamodel_code_generator.version import version
from datamodel_code_generator import get_version

print(version)
print(get_version())
exit(0)

pyproject_config = _get_pyproject_toml_config(Path().resolve())
1 change: 0 additions & 1 deletion datamodel_code_generator/version.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ dependencies = [
"graphql-core>=3.2.3",
"httpx>=0.24.1",
"inflect>=4.1,<6",
"isort>=4.3.21,<6",
"isort>=4.3.21,<7",
"jinja2>=2.10.1,<4",
"openapi-spec-validator>=0.2.8,<0.7",
"packaging",
4 changes: 2 additions & 2 deletions tests/main/graphql/test_main_graphql.py
Original file line number Diff line number Diff line change
@@ -218,15 +218,15 @@ def test_main_graphql_additional_imports_isort_4():


@pytest.mark.skipif(
not isort.__version__.startswith('5.'),
isort.__version__.startswith('4.'),
reason='See https://github.com/PyCQA/isort/issues/1600 for example',
)
@freeze_time('2019-07-26')
@pytest.mark.skipif(
black.__version__.split('.')[0] == '19',
reason="Installed black doesn't support the old style",
)
def test_main_graphql_additional_imports_isort_5():
def test_main_graphql_additional_imports_isort_5_or_6():
with TemporaryDirectory() as output_dir:
output_file: Path = Path(output_dir) / 'output.py'
return_code: Exit = main(
2 changes: 1 addition & 1 deletion tests/main/jsonschema/test_main_jsonschema.py
Original file line number Diff line number Diff line change
@@ -2458,7 +2458,7 @@ def test_version(capsys):
main(['--version'])
assert e.value.code == Exit.OK
captured = capsys.readouterr()
assert captured.out == '0.0.0\n'
assert captured.out != '0.0.0\n'
assert captured.err == ''


Loading