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

Update dependencies and pre-commit #477

Merged
merged 9 commits into from
Aug 31, 2020
Merged

Update dependencies and pre-commit #477

merged 9 commits into from
Aug 31, 2020

Conversation

CasperWA
Copy link
Member

Updating dependencies according to @dependabot PRs.
Update setup.py accordingly.

Also, run pre-commit autoupdate to update the versions of the pre-commit tasks and subsequenctly run pre-commit for all files, resulting in the updated black version removing some white space in function doc-strings, which in turn updated the descriptions in the OpenAPI JSON.

I also took the liberty to fix some doc-string Returns:, removing the written type, making sure it was instead defined in the function definition using ... -> return_type:.

dependabot bot and others added 7 commits August 31, 2020 06:28
Bumps [black](https://github.com/psf/black) from 19.10b0 to 20.8b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.61.0 to 0.61.1.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](fastapi/fastapi@0.61.0...0.61.1)

Signed-off-by: dependabot[bot] <support@github.com>
…0.61.1', 'origin/dependabot/pip/master/mkdocs-material-5.5.11', 'origin/dependabot/pip/master/aiida-core-1.3.1' and 'origin/dependabot/pip/master/black-20.8b1' into update_deps
New black version removes white space in function docs strings.
This updated the descriptions in the OpenAPI.
@CasperWA CasperWA added OpenAPI OpenAPI / Swagger related issue dependency_updates Issues pertaining to updates to our dependencies that are breaking the eager build labels Aug 31, 2020
@CasperWA CasperWA requested review from ml-evs and shyamd August 31, 2020 08:55
@codecov
Copy link

codecov bot commented Aug 31, 2020

Codecov Report

Merging #477 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #477   +/-   ##
=======================================
  Coverage   91.65%   91.65%           
=======================================
  Files          60       60           
  Lines        2828     2828           
=======================================
  Hits         2592     2592           
  Misses        236      236           
Flag Coverage Δ
#unittests 91.65% <100.00%> (ø)

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

Impacted Files Coverage Δ
optimade/adapters/structures/aiida.py 100.00% <ø> (ø)
optimade/adapters/structures/ase.py 100.00% <ø> (ø)
optimade/adapters/structures/cif.py 100.00% <ø> (ø)
optimade/adapters/structures/jarvis.py 100.00% <ø> (ø)
optimade/adapters/structures/proteindatabank.py 100.00% <ø> (ø)
optimade/adapters/structures/pymatgen.py 100.00% <ø> (ø)
optimade/filtertransformers/elasticsearch.py 87.82% <ø> (ø)
optimade/filtertransformers/mongo.py 97.15% <ø> (ø)
optimade/models/optimade_json.py 96.51% <ø> (ø)
optimade/models/references.py 97.67% <ø> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90d7d90...13d03d4. Read the comment docs.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @CasperWA, I tidied up a few docstrings on the way through my review too. I like the new features in black, it sounds like they're getting close to stable release now.

I notice that we still don't validate properly according to swagger (see recent issue on the spec repo)...

https://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/a6926f53263fcabc91523e974c4d4b5bbe5bc9f1/openapi/openapi.json

optimade/adapters/structures/pymatgen.py Outdated Show resolved Hide resolved
optimade/filtertransformers/elasticsearch.py Outdated Show resolved Hide resolved
optimade/filtertransformers/elasticsearch.py Outdated Show resolved Hide resolved
optimade/filtertransformers/mongo.py Outdated Show resolved Hide resolved
optimade/filtertransformers/mongo.py Outdated Show resolved Hide resolved
optimade/validator/validator.py Outdated Show resolved Hide resolved
Further updates to doc strings.

Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>
@CasperWA
Copy link
Member Author

I notice that we still don't validate properly according to swagger (see recent issue on the spec repo)...

https://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/a6926f53263fcabc91523e974c4d4b5bbe5bc9f1/openapi/openapi.json

Hmm. Yeah that is a bit weird still. I am not completely sure about what to do about it?

@CasperWA
Copy link
Member Author

CasperWA commented Aug 31, 2020

I notice that we still don't validate properly according to swagger (see recent issue on the spec repo)...
https://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/a6926f53263fcabc91523e974c4d4b5bbe5bc9f1/openapi/openapi.json

Hmm. Yeah that is a bit weird still. I am not completely sure about what to do about it?

Okay, I think I may have found the issue here.
According to the OpenAPI specification the items property of a Schema Object MUST be an object. But for dimension_types, it's an array.

Furthermore, I found that type is not listed as "required" for a StructureResource. Also, the constant value of "structures" is not provided in the specification. We could force this through the pattern property, e.g.? I even think this should be contributed upstream to FastAPI.

Edit: The issue is also mentioned in pydantic's documentation here (see in the table for Tuple).

@ml-evs
Copy link
Member

ml-evs commented Aug 31, 2020

I notice that we still don't validate properly according to swagger (see recent issue on the spec repo)...
https://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/Materials-Consortia/optimade-python-tools/a6926f53263fcabc91523e974c4d4b5bbe5bc9f1/openapi/openapi.json

Hmm. Yeah that is a bit weird still. I am not completely sure about what to do about it?

Okay, I think I may have found the issue here.
According to the OpenAPI specification the items property of a Schema Object MUST be an object. But for dimension_types, it's an array.

Furthermore, I found that type is not listed as "required" for a StructureResource. Also, the constant value of "structures" is not provided in the specification. We could force this through the pattern property, e.g.? I even think this should be contributed upstream to FastAPI.

Edit: The issue is also mentioned in pydantic's documentation here (see in the table for Tuple).

Ah nice one, I got nowhere when I was trying to figure this out. Do you want to add a comment over at the spec issue and we can work on fixing it? I'm happy to raise the issue for the changes we need to make, unless you want to do so (will do it in 10 mins if I don't see one from you)

ml-evs
ml-evs previously approved these changes Aug 31, 2020
Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one more docstring tweak, but will accept here. Either force merge as an admin after committing it, or ping me to re-review and I can do it asap.

optimade/filtertransformers/mongo.py Outdated Show resolved Hide resolved
Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>
Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CasperWA!

@CasperWA CasperWA merged commit 878d932 into master Aug 31, 2020
@CasperWA CasperWA deleted the update_deps branch August 31, 2020 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency_updates Issues pertaining to updates to our dependencies that are breaking the eager build OpenAPI OpenAPI / Swagger related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants