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

TypeError: Argument 'bases' has incorrect type (expected list, got tuple) #288

Closed
mtelka opened this issue Nov 9, 2023 · 6 comments
Closed

Comments

@mtelka
Copy link
Contributor

mtelka commented Nov 9, 2023

I'm packaging maison for OpenIndiana. While running tests for the package I noticed there are six tests failing. All failures are like this one:

_______________ TestValidation.test_one_schema_with_valid_config _______________
    
self = <tests.unit.test_config.TestValidation object at 0x7fffade0ce20>
create_pyproject_toml = <function create_pyproject_toml.<locals>._create_pyproject_toml at 0x7fffabdc1310>
        
    def test_one_schema_with_valid_config(
        self,
        create_pyproject_toml: Callable[..., Path],
    ) -> None:
        """
        Given an instance of `ProjectConfig` with a given schema,
        When the `validate` method is called,
        Then the configuration is validated 
        """
    
>       class Schema(ConfigSchema): 
    
tests/unit/test_config.py:267:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   TypeError: Argument 'bases' has incorrect type (expected list, got tuple)

pydantic/main.py:186: TypeError

Here is a list of failed tests:

=========================== short test summary info ============================
FAILED tests/unit/test_config.py::TestValidation::test_one_schema_with_valid_config
FAILED tests/unit/test_config.py::TestValidation::test_one_schema_injected_at_validation
FAILED tests/unit/test_config.py::TestValidation::test_use_schema_values - Ty...
FAILED tests/unit/test_config.py::TestValidation::test_not_use_schema_values
FAILED tests/unit/test_config.py::TestValidation::test_schema_override - Type...
FAILED tests/unit/test_config.py::TestValidation::test_invalid_configuration
========================= 6 failed, 39 passed in 0.83s =========================
@dbatten5
Copy link
Owner

dbatten5 commented Nov 9, 2023

Hi @mtelka, I'm not able to recreate these test failures either locally or in the CI (here's a CI run from an hour ago https://github.com/dbatten5/maison/actions/runs/6811113148/job/18520779422).

This looks like it might be an issue with pydantic pydantic/pydantic#7689 which may be fixed with an update to version 1.10.13. I've just merged in a change to main with this update so I'll do a patch release now and hopefully with that new version of maison the error should go away.

@mtelka
Copy link
Contributor Author

mtelka commented Nov 9, 2023

I ran my tests with pydantic 1.10.13.

It is possible that some other installed Python package causes this issue, but I've no idea which one it could be. I do have installed many Python packages.

Any suggestion how to debug this?

Thank you.

@mtelka
Copy link
Contributor Author

mtelka commented Nov 9, 2023

FYI, I retested maison 1.4.1 and it still fails. I tested with these versions:

click==8.1.7
poetry-core==1.8.1
pydantic==1.10.13
toml==0.10.2

@mtelka
Copy link
Contributor Author

mtelka commented Nov 9, 2023

After reading pydantic/pydantic#7689 (comment) I should note that I test with Python 3.9.16.

@dbatten5
Copy link
Owner

dbatten5 commented Nov 9, 2023

Hmm I'm using the same versions as you for click, pydantic and toml. Python version 3.9.18. Not really sure what else to suggest here, might be worth raising an issue on the Pydantic repo

@mtelka
Copy link
Contributor Author

mtelka commented Nov 9, 2023

Yes. I added a comment note to pydantic/pydantic#7689 because it really looks the issue is in pydantic, not in maison.

@mtelka mtelka closed this as completed Nov 9, 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

No branches or pull requests

2 participants