Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[IGNORE] Mergeability #2 #1817

Closed
wants to merge 17 commits into from
Closed

Conversation

ml-evs
Copy link
Member

@ml-evs ml-evs commented Oct 15, 2023

Another PR to check mergeability after rebasing all of #1745 into #1815. I will use this PR to test a few more squashes to keep it manageable, then ensure that the overall changes are the same as #1745 before overwriting that branch.

@ml-evs ml-evs force-pushed the ml-evs/pydantic-v2-migration-take3 branch 2 times, most recently from 2fd7a3f to 9d99e07 Compare October 15, 2023 12:52
@ml-evs ml-evs force-pushed the ml-evs/remove-py38 branch from e921de4 to 791b932 Compare October 15, 2023 12:59
@ml-evs ml-evs force-pushed the ml-evs/pydantic-v2-migration-take3 branch 2 times, most recently from 87a07be to 7a19d45 Compare October 15, 2023 13:19
@ml-evs ml-evs force-pushed the ml-evs/remove-py38 branch from 791b932 to 1f0da3e Compare October 15, 2023 13:26
@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Merging #1817 (63e3f7c) into master (8510ffa) will decrease coverage by 0.39%.
The diff coverage is 95.37%.

@@            Coverage Diff             @@
##           master    #1817      +/-   ##
==========================================
- Coverage   90.68%   90.29%   -0.39%     
==========================================
  Files          74       75       +1     
  Lines        4616     4606      -10     
==========================================
- Hits         4186     4159      -27     
- Misses        430      447      +17     
Flag Coverage Δ
project 90.29% <95.37%> (-0.39%) ⬇️
validator 90.18% <95.37%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
optimade/adapters/base.py 96.66% <100.00%> (-0.31%) ⬇️
optimade/adapters/structures/adapter.py 100.00% <100.00%> (ø)
optimade/adapters/structures/ase.py 98.61% <100.00%> (ø)
optimade/adapters/structures/cif.py 84.09% <ø> (ø)
optimade/adapters/structures/proteindatabank.py 89.28% <ø> (ø)
optimade/adapters/structures/pymatgen.py 98.50% <100.00%> (ø)
optimade/adapters/structures/utils.py 80.88% <100.00%> (ø)
optimade/client/cli.py 85.93% <100.00%> (+0.22%) ⬆️
optimade/filtertransformers/base_transformer.py 97.45% <100.00%> (ø)
optimade/filtertransformers/elasticsearch.py 84.57% <100.00%> (ø)
... and 30 more

... and 2 files with indirect coverage changes

Base automatically changed from ml-evs/remove-py38 to master October 15, 2023 14:30
ml-evs and others added 17 commits October 15, 2023 16:30
Use pydantic v1 API wih v2 package

Replace `regex` with `pattern`

Use pydantic v2 API for model dumps

Go use pydantic v2 API again

Bump deps in pyproject and adjust for pydantic_settings

Attempt to migrate some pydantic v2 features

Run bump-pydantic

Update deps in requirements

Post pydantic-bump tweak number 3

Post pydantic-bump tweak number 4

Post pydantic-bump tweak number 5

Reintroduce email-validator dep via pydantic extra

Placating mypy

Use lax annotated type rather than validator

Attempt to simplify some tests for pydantic v2

Bump pydantic version in pre-commit

Bump to pydantic 2.3.0
- Reintroduce `http_client` extra as an alias for `http-client`
Still need to pass in a proper REF_TEMPLATE.
Lot's of changes here - mainly in
optimade.server.schemas:retrieve_queryable_properties().
Using the `model_fields` and FieldInfo instead of the generated JSON
Schema. Mainly due to the changes in the generated schema.

This led to a bit of hacking concerning the type (FieldInfo.annotation).
But otherwise, I think this is a better approach. Also implemented for
EntryCollection.get_attribute_fields().

Otherwise, changes here and there to make tests work as well as doing
some static typing sporadically.
Remove mp-api and emmet-core dependencies

Remove emmet-core from requirements file as well

Update mkdocstrings dependency in requirements file
Use the new Python handler for mkdocstrings - updating the configuration
in all_models.md to include all submodules for optimade.models.
Needed to properly ONLY check if annotation was Union or Optional before
using `get_args()`. Otherwise a type required as a list of strings is
unpacked to `str`, which we do not want.
Use enum `.value` for comparison (check if this should be used elsewhere
in the code for any Enum classes/types).
Disable ignoring warning about pydantic v2 deprecations in order to use
pydantic v2 methods in remaining places.

Consider completely removing the special function used for setting
`nullable=true` in JSON schema for 'SHOULD' OPTIMADE support fields. It
seems `nullable` is no longer a valid field in OpenAPI v3.1.0, but also,
the properties/fields this is added to already support the value being
`null`.
This is no longer part of the OpenAPI spec as of v3.1.

Fixes #1814
Also update some static typing here and there.
- Avoid running mypy on tests folder.

- Remove mypy ignore statements from tests

- Revert to having implicit Optional
- Tidy up changes re: `Datatype`
@ml-evs ml-evs force-pushed the ml-evs/pydantic-v2-migration-take3 branch from 7a19d45 to 63e3f7c Compare October 15, 2023 15:30
@ml-evs ml-evs closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants