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

BF: Require pydantic >= 1.8.1 #461

Merged
merged 1 commit into from
Mar 12, 2021
Merged

BF: Require pydantic >= 1.8.1 #461

merged 1 commit into from
Mar 12, 2021

Conversation

yarikoptic
Copy link
Member

May be some other release could be fine as well, but with 1.7.3
I do have tests erroring out with

(git)lena:~/proj/dandi/dandi-cli-master[master]git
$> python -m pytest -s -v dandi/tests/test_models.py::test_autogenerated_titles
============================================================================ test session starts ============================================================================
platform linux -- Python 3.9.1, pytest-6.2.2, py-1.9.0, pluggy-0.13.0 -- /home/yoh/proj/dandi/dandi-cli-master/venvs/dev3/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/yoh/proj/dandi/dandi-cli-master/.hypothesis/examples')
rootdir: /home/yoh/proj/dandi/dandi-cli-master, configfile: tox.ini
plugins: mock-3.5.1, pyfakefs-4.1.0, forked-1.3.0, timeout-1.4.1, xdist-1.32.0, hypothesis-5.41.2, xonsh-0.9.24
collected 1 item

dandi/tests/test_models.py::test_autogenerated_titles FAILED

================================================================================= FAILURES ==================================================================================
_________________________________________________________________________ test_autogenerated_titles _________________________________________________________________________
dandi/tests/test_models.py:150: in test_autogenerated_titles
    schema = AssetMeta.schema()
pydantic/main.py:642: in pydantic.main.BaseModel.schema
    ???
pydantic/schema.py:153: in pydantic.schema.model_schema
    ???
pydantic/schema.py:525: in pydantic.schema.model_process_schema
    ???
pydantic/schema.py:566: in pydantic.schema.model_type_schema
    ???
pydantic/schema.py:222: in pydantic.schema.field_schema
    ???
pydantic/schema.py:421: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
    ???
pydantic/schema.py:476: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:657: in pydantic.schema.field_singleton_sub_fields_schema
    ???
pydantic/schema.py:476: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:525: in pydantic.schema.model_process_schema
    ???
pydantic/schema.py:566: in pydantic.schema.model_type_schema
    ???
pydantic/schema.py:222: in pydantic.schema.field_schema
    ???
pydantic/schema.py:421: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
    ???
pydantic/schema.py:476: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:525: in pydantic.schema.model_process_schema
    ???
pydantic/schema.py:566: in pydantic.schema.model_type_schema
    ???
pydantic/schema.py:222: in pydantic.schema.field_schema
    ???
pydantic/schema.py:421: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
    ???
pydantic/schema.py:476: in pydantic.schema.field_type_schema
    ???
pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
    ???
pydantic/schema.py:539: in pydantic.schema.model_process_schema
    ???
dandi/models.py:179: in schema_extra
    if len(value["enum"]) == 1:
E   KeyError: 'enum'

May be some other release could be fine as well, but with 1.7.3
I do have tests erroring out with

    (git)lena:~/proj/dandi/dandi-cli-master[master]git
    $> python -m pytest -s -v dandi/tests/test_models.py::test_autogenerated_titles
    ============================================================================ test session starts ============================================================================
    platform linux -- Python 3.9.1, pytest-6.2.2, py-1.9.0, pluggy-0.13.0 -- /home/yoh/proj/dandi/dandi-cli-master/venvs/dev3/bin/python
    cachedir: .pytest_cache
    hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/yoh/proj/dandi/dandi-cli-master/.hypothesis/examples')
    rootdir: /home/yoh/proj/dandi/dandi-cli-master, configfile: tox.ini
    plugins: mock-3.5.1, pyfakefs-4.1.0, forked-1.3.0, timeout-1.4.1, xdist-1.32.0, hypothesis-5.41.2, xonsh-0.9.24
    collected 1 item

    dandi/tests/test_models.py::test_autogenerated_titles FAILED

    ================================================================================= FAILURES ==================================================================================
    _________________________________________________________________________ test_autogenerated_titles _________________________________________________________________________
    dandi/tests/test_models.py:150: in test_autogenerated_titles
        schema = AssetMeta.schema()
    pydantic/main.py:642: in pydantic.main.BaseModel.schema
        ???
    pydantic/schema.py:153: in pydantic.schema.model_schema
        ???
    pydantic/schema.py:525: in pydantic.schema.model_process_schema
        ???
    pydantic/schema.py:566: in pydantic.schema.model_type_schema
        ???
    pydantic/schema.py:222: in pydantic.schema.field_schema
        ???
    pydantic/schema.py:421: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
        ???
    pydantic/schema.py:476: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:657: in pydantic.schema.field_singleton_sub_fields_schema
        ???
    pydantic/schema.py:476: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:525: in pydantic.schema.model_process_schema
        ???
    pydantic/schema.py:566: in pydantic.schema.model_type_schema
        ???
    pydantic/schema.py:222: in pydantic.schema.field_schema
        ???
    pydantic/schema.py:421: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
        ???
    pydantic/schema.py:476: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:525: in pydantic.schema.model_process_schema
        ???
    pydantic/schema.py:566: in pydantic.schema.model_type_schema
        ???
    pydantic/schema.py:222: in pydantic.schema.field_schema
        ???
    pydantic/schema.py:421: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:751: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:645: in pydantic.schema.field_singleton_sub_fields_schema
        ???
    pydantic/schema.py:476: in pydantic.schema.field_type_schema
        ???
    pydantic/schema.py:805: in pydantic.schema.field_singleton_schema
        ???
    pydantic/schema.py:539: in pydantic.schema.model_process_schema
        ???
    dandi/models.py:179: in schema_extra
        if len(value["enum"]) == 1:
    E   KeyError: 'enum'
@yarikoptic yarikoptic requested a review from satra March 11, 2021 13:38
@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #461 (9c18a7b) into master (bdf3dfb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #461   +/-   ##
=======================================
  Coverage   82.27%   82.27%           
=======================================
  Files          55       55           
  Lines        5750     5750           
=======================================
  Hits         4731     4731           
  Misses       1019     1019           
Flag Coverage Δ
unittests 82.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out 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 bdf3dfb...9c18a7b. Read the comment docs.

@satra
Copy link
Member

satra commented Mar 11, 2021

we should probably also make that if better to see if enum is in value. this is the change in pydantic from const to enum.

@yarikoptic
Copy link
Member Author

@satra : would that make it compatible with earlier pydantic versions, or it is an orthogonal issue and we could proceed with this one?

@satra
Copy link
Member

satra commented Mar 12, 2021

i guess, we can impose whatever minimal version. i think it's ok for us to proceed with this.

@yarikoptic yarikoptic merged commit 8522a13 into master Mar 12, 2021
@yarikoptic yarikoptic deleted the bf-pydantic-version branch March 12, 2021 16:51
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