diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b763ac7..391aa96 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: check-hooks-apply - repo: https://github.com/pre-commit/pre-commit-hooks - rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: check-merge-conflict - id: check-case-conflict @@ -32,24 +32,24 @@ repos: args: [--pytest-test-first] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: a6273196190bb0f68caf1dc68073cf62c719f725 # frozen: v2.14.0 + rev: 4380fbb73a154b5f5624794c1c78d9719ccc860f # frozen: v2.16.0 hooks: - id: pretty-format-yaml args: [--autofix, --indent, '2'] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 06e4cc849d03f3a59ca223a4046f4bb5bb2aba6d # frozen: 0.33.0 + rev: c4654a7e007c9619a5eb63c39a456572a0fa1851 # frozen: 0.38.0 hooks: - id: check-dependabot - id: check-github-workflows - repo: https://github.com/tox-dev/pyproject-fmt - rev: 57b6ff7bf72affdd12c7f3fd6de761ba18a33b3a # frozen: v2.5.1 + rev: 3b42b9776870badc9eaffdef9a4a0834b764d87c # frozen: v2.29.3 hooks: - id: pyproject-fmt - repo: https://github.com/executablebooks/mdformat - rev: ff29be1a1ba8029d9375882aa2c812b62112a593 # frozen: 0.7.22 + rev: 2d496dbc18e31b83a1596685347ffe0b6041daf0 # frozen: 1.0.0 hooks: - id: mdformat args: [--number, --wrap=120, --ignore-missing-references] @@ -66,21 +66,21 @@ repos: - mdformat-mkdocs[recommended]>=v2.0.7 - repo: https://github.com/provinzkraut/unasyncd - rev: 572842a04440d45bd7d6bee5a6a4d006891d8c66 # frozen: v0.8.1 + rev: b776e25a7e51956c222d676c0cc6acd36bf75396 # frozen: v0.10.1 hooks: - id: unasyncd additional_dependencies: - ruff==0.6.1 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: e84319e627902e1b348574ecf3238dc511933dc7 # frozen: v0.11.7 + rev: 321478e58f4938179c6b86e4ddfa923d1547a49b # frozen: v0.16.6 hooks: - id: ruff args: [--fix, --show-fixes, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: f40886d54c729f533f864ed6ce584e920feb0af7 # frozen: v1.15.0 + rev: 7ff8d35ae36a7d2b968f2f90b4c723e292e594ee # frozen: v2.3.1 hooks: - id: mypy args: [--config-file=pyproject.toml] @@ -94,24 +94,24 @@ repos: - xsdata>=24.5 - repo: https://github.com/scientific-python/cookie - rev: f801700e5a8beb2f42e63d752d7116aa4dbaa0f1 # frozen: 2025.01.22 + rev: 1589a99867d6cac494ac7545fe6a83108580a3ee # frozen: 2026.08.14 hooks: - id: sp-repo-review - repo: https://github.com/crate-ci/typos - rev: 15ff058881549e16b0edb975a9b0b0d0cccd612c # frozen: v1 + rev: c132f8b9e3ac7f8f0625490b1cb5b906d1d6a63a # frozen: v1 hooks: - id: typos args: [--force-exclude] exclude: src/re3data/_resources/repository.py|tests/conftest.py - repo: https://github.com/FHPythonUtils/LicenseCheck/ - rev: 1396d3408d6c08cad89229fa30ef17a35e35d5c4 # frozen: 2025.1.0 + rev: 21abbebb654a297a8e7b62ddebe7a77504171386 # frozen: 2026.0.8 hooks: - id: licensecheck - repo: https://github.com/compilerla/conventional-pre-commit - rev: fa1915d04e129bcd0dccabf6aca53cdc19787ab4 # frozen: v4.1.0 + rev: 3db014c16a9d31997ab8c07a4d61fcce936c8f0d # frozen: v4.4.0 hooks: - id: conventional-pre-commit stages: [commit-msg] diff --git a/pyproject.toml b/pyproject.toml index 2377890..1a8de76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Text Processing :: Markup :: XML", "Typing :: Typed", @@ -83,22 +84,23 @@ docs = [ "mkdocstrings[python]", ] -[tool.hatch.build.targets.sdist] -only-include = [ +[tool.hatch] +build.targets.wheel.packages = [ "src/re3data", ] -exclude = [ +build.targets.sdist.exclude = [ "src/re3data/_resources/*.md", "src/re3data/_resources/*.xml", ] - -[tool.hatch.build.targets.wheel] -only-packages = true -packages = [ +build.targets.sdist.only-include = [ "src/re3data", ] +build.targets.wheel.only-packages = true -[tool.ruff] # Ref: https://docs.astral.sh/ruff/configuration/ +[tool.uv] +default-groups = [ "dev", "test" ] + +[tool.ruff] # Ref: https://docs.astral.sh/ruff/configuration/ line-length = 120 src = [ "src", @@ -151,7 +153,7 @@ lint.isort.known-first-party = [ ] lint.pydocstyle.convention = "google" -[tool.repo-review] # Ref: https://github.com/scientific-python/cookie/tree/main#list-of-checks +[tool.repo-review] # Ref: https://github.com/scientific-python/cookie/tree/main#list-of-checks ignore = [ # PC is Pre-commit "PC111", # blacken-docs @@ -162,90 +164,69 @@ ignore = [ "RTD", # read the docs ] -[tool.pytest.ini_options] # Ref: https://docs.pytest.org/en/stable/customize.html -minversion = "8.0" -addopts = [ +[tool.typos] # Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md +# add "spellchecker:disable-line" to ignore specific lines +default.extend-ignore-re = [ + "(?Rm)^.*# spellchecker:disable-line$", +] + +[tool.mypy] # Ref: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file +python_version = "3.10" +warn_unreachable = true +enable_error_code = [ + "ignore-without-code", + "redundant-expr", + "truthy-bool", +] +strict = true +show_error_context = true +show_column_numbers = true +pretty = true + +[tool.pytest] +# Ref: https://docs.pytest.org/en/stable/customize.html +ini_options.minversion = "8.0" +ini_options.testpaths = "tests" +ini_options.addopts = [ "-ra", "--showlocals", "--strict-markers", "--strict-config", "-m not e2e", # default behaviour: do not run e2e tests ] -asyncio_mode = "auto" -asyncio_default_fixture_loop_scope = "function" -filterwarnings = [ - "error", -] -log_cli_level = "INFO" -xfail_strict = true -testpaths = "tests" -markers = [ +ini_options.markers = [ "e2e: marks tests as end-to-end tests, requesting the live api", ] +ini_options.xfail_strict = true +ini_options.filterwarnings = [ + "error", +] +ini_options.log_cli_level = "INFO" +ini_options.asyncio_default_fixture_loop_scope = "function" +ini_options.asyncio_mode = "auto" -[tool.coverage.run] # Ref: https://coverage.readthedocs.io/en/latest/config.html -branch = true -parallel = true -source = [ +[tool.coverage] +run.source = [ "re3data", ] -omit = [ +run.omit = [ "__main__.py", ] - -[tool.coverage.report] -exclude_also = [ - "if TYPE_CHECKING:", +# Ref: https://coverage.readthedocs.io/en/latest/config.html +run.branch = true +run.parallel = true +report.fail_under = 90 +report.exclude_also = [ "@overload", + "if TYPE_CHECKING:", ] -fail_under = 90 -show_missing = true -skip_covered = true -skip_empty = true - -[tool.mypy] # Ref: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file -python_version = "3.10" -strict = true -pretty = true -show_column_numbers = true -show_error_context = true -enable_error_code = [ - "ignore-without-code", - "redundant-expr", - "truthy-bool", -] -warn_unreachable = true - -[tool.uv] -default-groups = [ "dev", "test" ] +report.skip_covered = true +report.skip_empty = true +report.show_missing = true -[tool.licensecheck] # Ref: https://github.com/FHPythonUtils/LicenseCheck/#example-1-pyprojecttoml -using = "PEP631" -format = "ansi" - -[tool.unasyncd] # Ref: https://github.com/provinzkraut/unasyncd?tab=readme-ov-file#configuration -add_editors_note = true -ruff_fix = true -ruff_format = true -transform_docstrings = true - -[tool.unasyncd.files] -"src/re3data/_client/_async.py" = "src/re3data/_client/_sync.py" -"tests/integration/test_async_client.py" = "tests/integration/test_client.py" - -[tool.unasyncd.add_replacements] -"AsyncClient" = "Client" -"re3data.AsyncClient" = "re3data.Client" -"async_client" = "client" -"async_log_response" = "log_response" -"httpx.AsyncClient" = "httpx.Client" -"AsyncRepositoryManager" = "RepositoryManager" - -[tool.semantic_release] # Ref: https://python-semantic-release.readthedocs.io/en/latest/configuration.html#settings -commit_author = "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" -commit_message = "chore: release {version}\n\nAutomatically generated by python-semantic-release [skip ci]" -major_on_zero = false +[tool.semantic_release] # Ref: https://python-semantic-release.readthedocs.io/en/latest/configuration.html#settings tag_format = "{version}" +major_on_zero = false version_toml = [ "pyproject.toml:project.version", ] @@ -255,14 +236,28 @@ sed -i "s/^date-released: .*/date-released: $(date "+%Y-%m-%d")/" CITATION.cff sed -i "s|/compare/[0-9]*\.[0-9]*\.[0-9]*...main|/compare/$NEW_VERSION...main|" CHANGELOG.md git add CHANGELOG.md CITATION.cff ''' -changelog.mode = "update" +commit_message = "chore: release {version}\n\nAutomatically generated by python-semantic-release [skip ci]" +commit_author = "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" +changelog.environment.keep_trailing_newline = false +changelog.exclude_commit_patterns = [ "^build", "^chore", "^style", "^ci" ] changelog.insertion_flag = "" +changelog.mode = "update" changelog.template_dir = ".github/templates" -changelog.exclude_commit_patterns = [ "^build", "^chore", "^style", "^ci" ] -changelog.environment.keep_trailing_newline = false -[tool.typos] # Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md -# add "spellchecker:disable-line" to ignore specific lines -default.extend-ignore-re = [ - "(?Rm)^.*# spellchecker:disable-line$", -] +[tool.licensecheck] # Ref: https://github.com/FHPythonUtils/LicenseCheck/#example-1-pyprojecttoml +using = "PEP631" +format = "ansi" + +[tool.unasyncd] # Ref: https://github.com/provinzkraut/unasyncd?tab=readme-ov-file#configuration +add_editors_note = true +ruff_fix = true +ruff_format = true +transform_docstrings = true +files."src/re3data/_client/_async.py" = "src/re3data/_client/_sync.py" +files."tests/integration/test_async_client.py" = "tests/integration/test_client.py" +add_replacements.AsyncClient = "Client" +add_replacements."re3data.AsyncClient" = "re3data.Client" +add_replacements.async_client = "client" +add_replacements.async_log_response = "log_response" +add_replacements."httpx.AsyncClient" = "httpx.Client" +add_replacements.AsyncRepositoryManager = "RepositoryManager" diff --git a/src/re3data/_cli.py b/src/re3data/_cli.py index d3a80f6..6672229 100644 --- a/src/re3data/_cli.py +++ b/src/re3data/_cli.py @@ -7,7 +7,7 @@ import logging import sys from pathlib import Path -from typing import Annotated, Any, Optional +from typing import Annotated, Any from rich.console import Console @@ -91,7 +91,7 @@ def callback( @repositories_app.command("list") def list_repositories( query: Annotated[ - Optional[str], # noqa: UP007 - typer does not support "str | None" + str | None, typer.Option( help="A query to filter the results. If provided, only repositories matching the query will be returned." ), @@ -99,7 +99,7 @@ def list_repositories( return_type: ReturnType = ReturnType.DATACLASS, count: bool = False, outfile: Annotated[ - Optional[Path], # noqa: UP007 - typer does not support "Path | None" + Path | None, typer.Option( file_okay=True, dir_okay=False, @@ -118,7 +118,7 @@ def get_repository( repository_id: str, return_type: ReturnType = ReturnType.DATACLASS, outfile: Annotated[ - Optional[Path], # noqa: UP007 - typer does not support "Path | None" + Path | None, typer.Option( file_okay=True, dir_okay=False, diff --git a/src/re3data/_client/base.py b/src/re3data/_client/base.py index ce41a43..90e94d7 100644 --- a/src/re3data/_client/base.py +++ b/src/re3data/_client/base.py @@ -143,7 +143,7 @@ class BaseClient: def __init__( self, - client: type[httpx.Client] | type[httpx.AsyncClient], + client: type[httpx.Client | httpx.AsyncClient], ) -> None: self._client = client( base_url=BASE_URL, diff --git a/src/re3data/_resources/README.md b/src/re3data/_resources/README.md index d4eea36..90607a1 100644 --- a/src/re3data/_resources/README.md +++ b/src/re3data/_resources/README.md @@ -25,7 +25,7 @@ Here's an example: >>> repository_summary = re3data.repositories.list()[0] >>> repository_summary.link.href 'https://www.re3data.org/api/beta/repository/r3d100010468' ->>> repository_summary.href # for convenience +>>> repository_summary.href # for convenience 'https://www.re3data.org/api/beta/repository/r3d100010468' ``` @@ -48,7 +48,7 @@ Here's an example: >>> repository = re3data.repositories.get("r3d100010468") >>> repository.re3data_org_identifier 'r3d100010468' ->>> repository.id # for convenience +>>> repository.id # for convenience 'r3d100010468' ``` diff --git a/src/re3data/_resources/repository.py b/src/re3data/_resources/repository.py index 5a0a140..6d84173 100644 --- a/src/re3data/_resources/repository.py +++ b/src/re3data/_resources/repository.py @@ -1304,7 +1304,7 @@ class DataUploadLicense: class Meta: global_type = False - data_upload_license_name: None | str = field( + data_upload_license_name: str | None = field( default=None, metadata={ "name": "dataUploadLicenseName", @@ -1313,7 +1313,7 @@ class Meta: "required": True, }, ) - data_upload_license_url: None | str = field( + data_upload_license_url: str | None = field( default=None, metadata={ "name": "dataUploadLicenseURL", @@ -1338,7 +1338,7 @@ class Policy: class Meta: global_type = False - policy_name: None | str = field( + policy_name: str | None = field( default=None, metadata={ "name": "policyName", @@ -1347,7 +1347,7 @@ class Meta: "required": True, }, ) - policy_url: None | str = field( + policy_url: str | None = field( default=None, metadata={ "name": "policyURL", @@ -1377,7 +1377,7 @@ class Meta: # Note: Unfortunately, we had to add `str` type manually due to inconsistencies between the API data and # the XSD schema. This led to numerous `ConverterWarnings`. Ideally, the data would conform to the schema, # but until then, this workaround helps maintain compatibility. - updated: None | XmlPeriod | XmlDate | str = field( + updated: XmlPeriod | XmlDate | str | None = field( default=None, metadata={ "type": "Attribute", @@ -1835,7 +1835,7 @@ class Meta: "required": True, }, ) - language: None | Languages = field( + language: Languages | None = field( default=None, metadata={ "type": "Attribute", @@ -1860,7 +1860,7 @@ class Meta: "required": True, }, ) - api_type: None | ApiTypes = field( + api_type: ApiTypes | None = field( default=None, metadata={ "name": "apiType", @@ -1880,13 +1880,13 @@ class ContentType: class Meta: global_type = False - value: None | ContentTypeText = field( + value: ContentTypeText | None = field( default=None, metadata={ "required": True, }, ) - content_type_scheme: None | ContentTypeScheme = field( + content_type_scheme: ContentTypeScheme | None = field( default=None, metadata={ "name": "contentTypeScheme", @@ -1907,7 +1907,7 @@ class DataAccess: class Meta: global_type = False - data_access_type: None | DataAccessTypes = field( + data_access_type: DataAccessTypes | None = field( default=None, metadata={ "name": "dataAccessType", @@ -1936,7 +1936,7 @@ class DataLicense: class Meta: global_type = False - data_license_name: None | DataLicenseNames = field( + data_license_name: DataLicenseNames | None = field( default=None, metadata={ "name": "dataLicenseName", @@ -1945,7 +1945,7 @@ class Meta: "required": True, }, ) - data_license_url: None | str = field( + data_license_url: str | None = field( default=None, metadata={ "name": "dataLicenseURL", @@ -1967,7 +1967,7 @@ class DataUpload: class Meta: global_type = False - data_upload_type: None | AccessTypes = field( + data_upload_type: AccessTypes | None = field( default=None, metadata={ "name": "dataUploadType", @@ -1997,7 +1997,7 @@ class DatabaseAccess: class Meta: global_type = False - database_access_type: None | AccessTypes = field( + database_access_type: AccessTypes | None = field( default=None, metadata={ "name": "databaseAccessType", @@ -2026,7 +2026,7 @@ class DatabaseLicense: class Meta: global_type = False - database_license_name: None | DatabaseLicenseNames = field( + database_license_name: DatabaseLicenseNames | None = field( default=None, metadata={ "name": "databaseLicenseName", @@ -2035,7 +2035,7 @@ class Meta: "required": True, }, ) - database_license_url: None | str = field( + database_license_url: str | None = field( default=None, metadata={ "name": "databaseLicenseURL", @@ -2063,7 +2063,7 @@ class Meta: "max_length": 1000, }, ) - language: None | Languages = field( + language: Languages | None = field( default=None, metadata={ "type": "Attribute", @@ -2088,7 +2088,7 @@ class Meta: "required": True, }, ) - language: None | Languages = field( + language: Languages | None = field( default=None, metadata={ "type": "Attribute", @@ -2113,7 +2113,7 @@ class Meta: "required": True, }, ) - language: None | Languages = field( + language: Languages | None = field( default=None, metadata={ "type": "Attribute", @@ -2132,13 +2132,13 @@ class MetadataStandardName: class Meta: global_type = False - value: None | MetadataStandardDccnames = field( + value: MetadataStandardDccnames | None = field( default=None, metadata={ "required": True, }, ) - metadata_standard_scheme: None | MetadataStandardScheme = field( + metadata_standard_scheme: MetadataStandardScheme | None = field( default=None, metadata={ "name": "metadataStandardScheme", @@ -2164,7 +2164,7 @@ class Meta: "required": True, }, ) - language: None | Languages = field( + language: Languages | None = field( default=None, metadata={ "type": "Attribute", @@ -2182,7 +2182,7 @@ class Software: class Meta: global_type = False - software_name: None | SoftwareNames = field( + software_name: SoftwareNames | None = field( default=None, metadata={ "name": "softwareName", @@ -2204,13 +2204,13 @@ class Subject: class Meta: global_type = False - value: None | SubjectText = field( + value: SubjectText | None = field( default=None, metadata={ "required": True, }, ) - subject_scheme: None | SubjectScheme = field( + subject_scheme: SubjectScheme | None = field( default=None, metadata={ "name": "subjectScheme", @@ -2236,7 +2236,7 @@ class Meta: "required": True, }, ) - syndication_type: None | SyndicationTypes = field( + syndication_type: SyndicationTypes | None = field( default=None, metadata={ "name": "syndicationType", @@ -2265,7 +2265,7 @@ class Institution: class Meta: global_type = False - institution_name: None | InstitutionName = field( + institution_name: InstitutionName | None = field( default=None, metadata={ "name": "institutionName", @@ -2282,7 +2282,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - institution_country: None | Countries = field( + institution_country: Countries | None = field( default=None, metadata={ "name": "institutionCountry", @@ -2299,7 +2299,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - institution_type: None | InstitutionTypes = field( + institution_type: InstitutionTypes | None = field( default=None, metadata={ "name": "institutionType", @@ -2307,7 +2307,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - institution_url: None | str = field( + institution_url: str | None = field( default=None, metadata={ "name": "institutionURL", @@ -2324,7 +2324,7 @@ class Meta: }, ) # Note: Unfortunately, we had to add `str` type manually. - responsibility_start_date: None | XmlPeriod | XmlDate | str = field( + responsibility_start_date: XmlPeriod | XmlDate | str | None = field( default=None, metadata={ "name": "responsibilityStartDate", @@ -2335,7 +2335,7 @@ class Meta: }, ) # Note: Unfortunately, we had to add `str` type manually. - responsibility_end_date: None | XmlPeriod | XmlDate | str = field( + responsibility_end_date: XmlPeriod | XmlDate | str | None = field( default=None, metadata={ "name": "responsibilityEndDate", @@ -2365,7 +2365,7 @@ class MetadataStandard: class Meta: global_type = False - metadata_standard_name: None | MetadataStandardName = field( + metadata_standard_name: MetadataStandardName | None = field( default=None, metadata={ "name": "metadataStandardName", @@ -2374,7 +2374,7 @@ class Meta: "required": True, }, ) - metadata_standard_url: None | MetadataStandardDccurls = field( + metadata_standard_url: MetadataStandardDccurls | None = field( default=None, metadata={ "name": "metadataStandardURL", @@ -2441,7 +2441,7 @@ class Repository(IdMixin): class Meta: global_type = False - re3data_org_identifier: None | str = field( + re3data_org_identifier: str | None = field( default=None, metadata={ "name": "re3data.orgIdentifier", @@ -2450,7 +2450,7 @@ class Meta: "required": True, }, ) - repository_name: None | RepositoryName = field( + repository_name: RepositoryName | None = field( default=None, metadata={ "name": "repositoryName", @@ -2467,7 +2467,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - repository_url: None | str = field( + repository_url: str | None = field( default=None, metadata={ "name": "repositoryURL", @@ -2484,7 +2484,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - description: None | Description = field( + description: Description | None = field( default=None, metadata={ "type": "Element", @@ -2508,7 +2508,7 @@ class Meta: "min_occurs": 1, }, ) - size: None | Size = field( + size: Size | None = field( default=None, metadata={ "type": "Element", @@ -2516,7 +2516,7 @@ class Meta: }, ) # Note: Unfortunately, we had to add `str` type manually. - start_date: None | XmlPeriod | XmlDate | str = field( + start_date: XmlPeriod | XmlDate | str | None = field( default=None, metadata={ "name": "startDate", @@ -2527,7 +2527,7 @@ class Meta: }, ) # Note: Unfortunately, we had to add `str` type manually. - end_date: None | XmlPeriod | XmlDate | str = field( + end_date: XmlPeriod | XmlDate | str | None = field( default=None, metadata={ "name": "endDate", @@ -2554,7 +2554,7 @@ class Meta: "min_occurs": 1, }, ) - mission_statement_url: None | str = field( + mission_statement_url: str | None = field( default=None, metadata={ "name": "missionStatementURL", @@ -2602,7 +2602,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - database_access: None | DatabaseAccess = field( + database_access: DatabaseAccess | None = field( default=None, metadata={ "name": "databaseAccess", @@ -2661,7 +2661,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - versioning: None | Yesno = field( + versioning: Yesno | None = field( default=None, metadata={ "type": "Element", @@ -2684,7 +2684,7 @@ class Meta: "min_occurs": 1, }, ) - citation_guideline_url: None | str = field( + citation_guideline_url: str | None = field( default=None, metadata={ "name": "citationGuidelineURL", @@ -2700,7 +2700,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - enhanced_publication: None | Yesnoun = field( + enhanced_publication: Yesnoun | None = field( default=None, metadata={ "name": "enhancedPublication", @@ -2708,7 +2708,7 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - quality_management: None | Yesnoun = field( + quality_management: Yesnoun | None = field( default=None, metadata={ "name": "qualityManagement", @@ -2738,14 +2738,14 @@ class Meta: "namespace": "http://www.re3data.org/schema/2-2", }, ) - remarks: None | str = field( + remarks: str | None = field( default=None, metadata={ "type": "Element", "namespace": "http://www.re3data.org/schema/2-2", }, ) - entry_date: None | XmlPeriod | XmlDate = field( + entry_date: XmlPeriod | XmlDate | None = field( default=None, metadata={ "name": "entryDate", @@ -2756,7 +2756,7 @@ class Meta: "max_inclusive": XmlDate(2999, 12, 31), }, ) - last_update: None | XmlPeriod | XmlDate = field( + last_update: XmlPeriod | XmlDate | None = field( default=None, metadata={ "name": "lastUpdate", diff --git a/src/re3data/_resources/repository_list.py b/src/re3data/_resources/repository_list.py index 8d1e4ca..a273840 100644 --- a/src/re3data/_resources/repository_list.py +++ b/src/re3data/_resources/repository_list.py @@ -16,14 +16,14 @@ class Link: class Meta: name = "link" - href: None | str = field( + href: str | None = field( default=None, metadata={ "type": "Attribute", "required": True, }, ) - rel: None | str = field( + rel: str | None = field( default=None, metadata={ "type": "Attribute", @@ -37,28 +37,28 @@ class RepositorySummary(LinkMixin): class Meta: name = "repository" - id: None | str = field( + id: str | None = field( default=None, metadata={ "type": "Element", "required": True, }, ) - doi: None | str = field( + doi: str | None = field( default=None, metadata={ "type": "Element", "required": True, }, ) - name: None | str = field( + name: str | None = field( default=None, metadata={ "type": "Element", "required": True, }, ) - link: None | Link = field( + link: Link | None = field( default=None, metadata={ "type": "Element",