Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Release v24.12 #1109

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ repos:
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/crate-ci/typos
rev: v1.28.2
rev: v1.28.4
hooks:
- id: typos
exclude: ^tests/|.xsd|xsdata/models/datatype.py$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.8.4
hooks:
- id: ruff
args: [ --fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.0
hooks:
- id: mypy
files: ^(xsdata/)
Expand Down
27 changes: 27 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 24.12 (2024-12-22)

**Fixes**

- Set the default value of prohibited fields to None
([#1098](https://github.com/tefra/xsdata/pull/1098))

- Set body and fault as optional in output soap classes
([#1099](https://github.com/tefra/xsdata/pull/1099))

- Resolve a conflict with type location when an element and a complex type have the same
name ([#1107](https://github.com/tefra/xsdata/pull/1107))

**Features**

- Allow Xml Parser subclasses to override how the root class is located
([#1090](https://github.com/tefra/xsdata/pull/1090))

- Include common soap encoding schema
([#1100](https://github.com/tefra/xsdata/pull/1100))

**Deprecations**

- Remove subscritable types config option
- Remove Type,Tuple,List,Dict from stop words
- Deprecate xsdata <SOURCE> shorthand, use xsdata generate <SOURCE> instead

## 24.11 (2024-11-03)

**Fixes**
Expand Down
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ pip install xsdata[cli,lxml,soap]

```console
$ # Generate models
$ xsdata tests/fixtures/primer/order.xsd --package tests.fixtures.primer
$ xsdata generate tests/fixtures/primer/order.xsd --package tests.fixtures.primer
```

```python
Expand Down Expand Up @@ -74,18 +74,29 @@ Check the [documentation](https://xsdata.readthedocs.io) for more ✨✨✨
- Support xinclude statements and unknown properties
- Customize behaviour through config

## Changelog: 24.11 (2024-11-03)
## Changelog: 24.12 (2024-12-22)

**Fixes**

- Avoid conflict with attributes named value when flattening extensions
([#1085](https://github.com/tefra/xsdata/pull/1085))
- Set the default value of prohibited fields to None
([#1098](https://github.com/tefra/xsdata/pull/1098))

- Set body and fault as optional in output soap classes
([#1099](https://github.com/tefra/xsdata/pull/1099))

- Resolve a conflict with type location when an element and a complex type have the same
name ([#1107](https://github.com/tefra/xsdata/pull/1107))

**Features**

- Add cli config to use generic collections
([#1082](https://github.com/tefra/xsdata/pull/1082))
- Allow Xml Parser subclasses to override how the root class is located
([#1090](https://github.com/tefra/xsdata/pull/1090))

- Include common soap encoding schema
([#1100](https://github.com/tefra/xsdata/pull/1100))

**Deprecations**

- Drop support for python 3.8
- Remove subscritable types config option
- Remove Type,Tuple,List,Dict from stop words
- Deprecate xsdata <SOURCE> shorthand, use xsdata generate <SOURCE> instead
2 changes: 1 addition & 1 deletion docs/codegen/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ print(output.getvalue())
**Usage**

```console
$ xsdata --config project/.xsdata.xml
$ xsdata generate --config project/.xsdata.xml
```

!!! Info "CLI options override the project configuration settings."
Expand Down
2 changes: 1 addition & 1 deletion docs/codegen/dtd_modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ pip install xsdata[lxml]
## Example

```console
$ xsdata --package tests.fixtures.dtd.models tests/fixtures/dtd/complete_example.dtd
$ xsdata generate --package tests.fixtures.dtd.models tests/fixtures/dtd/complete_example.dtd
```

=== "DTD Definition"
Expand Down
8 changes: 4 additions & 4 deletions docs/codegen/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ You can instruct the cli to search all subdirectories recursively with the
`-r, --recursive` flag.

```console
$ xsdata project/schemas
$ xsdata project/schemas --recursive
$ xsdata generate project/schemas
$ xsdata generate project/schemas --recursive
```

## Use a filename or URI as source

```console
$ xsdata project/schemas/feed.xsd
$ xsdata http://www.gstatic.com/localfeed/local_feed.xsd
$ xsdata generate project/schemas/feed.xsd
$ xsdata generate http://www.gstatic.com/localfeed/local_feed.xsd
```
4 changes: 2 additions & 2 deletions docs/codegen/samples_modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ merge and flatten duplicate classes, fields and field types.
## XML Documents

```console
$ xsdata --package tests.fixtures.artists tests/fixtures/artists
$ xsdata generate --package tests.fixtures.artists tests/fixtures/artists
```

=== "Sample #1"
Expand Down Expand Up @@ -38,7 +38,7 @@ $ xsdata --package tests.fixtures.artists tests/fixtures/artists
## JSON Documents

```console
$ xsdata --package tests.fixtures.series tests/fixtures/series/samples
$ xsdata generate --package tests.fixtures.series tests/fixtures/series/samples
```

=== "Sample #1"
Expand Down
2 changes: 1 addition & 1 deletion docs/codegen/wsdl_modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ pip install xsdata[cli,soap]
```

```console
$ xsdata --package calculator http://www.dneonline.com/calculator.asmx?WSDL
$ xsdata generate --package calculator http://www.dneonline.com/calculator.asmx?WSDL
```

## Message Model
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CodeWriter.register_generator("awesome", AwesomeGenerator)
Which can be used during code generation.

```console
$ xsdata --output awesome
$ xsdata generate --output awesome
```

## `xsdata.plugins.class_types`
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_generate_with_error(self, mock_process):
mock_process.side_effect = CodegenError("Testing", foo="bar")

source = fixtures_dir.joinpath("defxmlschema/chapter03.xsd")
result = self.runner.invoke(cli, [str(source), "--package", "foo"])
result = self.runner.invoke(cli, ["generate", str(source), "--package", "foo"])
expected = "=========\n" "Error: Testing\n" "foo: bar\n"

self.assertIn(expected, result.output)
Expand Down
2 changes: 1 addition & 1 deletion xsdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "24.11"
__version__ = "24.12"
15 changes: 14 additions & 1 deletion xsdata/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@
logging.captureWarnings(True)


@click.group(cls=DefaultGroup, default="generate", default_if_no_args=False)
class DeprecatedDefaultGroup(DefaultGroup):
"""Deprecated default group."""

def get_command(self, ctx: click.Context, cmd_name: str) -> click.Command:
"""Override to deprecate xsdata <source> shorthand."""
if cmd_name not in self.commands:
logger.warning(
"`xsdata <SOURCE>` is deprecated. "
"Use `xsdata generate <SOURCE>` instead."
)
return super().get_command(ctx, cmd_name)


@click.group(cls=DeprecatedDefaultGroup, default="generate", default_if_no_args=False)
@click.pass_context
@click.version_option(__version__)
def cli(ctx: click.Context, **kwargs: Any):
Expand Down
Loading