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 min python to 3.9 #221

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

update min python to 3.9 #221

wants to merge 9 commits into from

Conversation

martenson
Copy link
Member

otherwise this error occurs: Error: The version '3.7' with architecture 'x64' was not found for Ubuntu 24.04.

otherwise this error occurs:  Error: The version '3.7' with architecture 'x64' was not found for Ubuntu 24.04.
@martenson martenson mentioned this pull request Mar 3, 2025
I guess this has changed at some point
@mvdbeek
Copy link
Member

mvdbeek commented Mar 3, 2025

I guess it's time to update the syntax too.

@martenson
Copy link
Member Author

martenson commented Mar 3, 2025

yeah, seems we have some linting debt, I'll update it

@mvdbeek
Copy link
Member

mvdbeek commented Mar 3, 2025

We might have to go to 3.9 for pydantic ... 3.8 is also EOL already

@martenson
Copy link
Member Author

@mvdbeek sounds reasonable, I'll bump it

@@ -10,6 +10,7 @@
from pydantic import (
BaseModel,
Extra,
RootModel,
Copy link
Member

Choose a reason for hiding this comment

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

Then we need to pin pydantic 2. I think the this would work with pydantic 1 if we are able to install a newer pydantic by bumping the python version.

Copy link
Member

Choose a reason for hiding this comment

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

(No strong preference either way)

Copy link
Member Author

Choose a reason for hiding this comment

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

what about both, pydantic2 pin and py39 as minimal?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, let's do it. we've supported 2 for quite some time, just hope there's no other breakage or incompatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot new lint will hop out with ne python 🤣

@martenson martenson changed the title update deploy workflow to python 3.8 update min python to 3.9 Mar 3, 2025
@martenson
Copy link
Member Author

pydantic failing on missing fields, but afaik those two are Optional

=================================== FAILURES ===================================
_____________________________ test_idc_lint_valid ______________________________
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_idc_lint_valid0')
    def test_idc_lint_valid(tmp_path: Path):
        setup_mock_idc_dir(tmp_path)
        output_path = tmp_path / "output.yaml"
>       write_shed_install_conf(tmp_path / "data_managers.yml", output_path)
tests/test_idc_data_managers_to_tools.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
data_manager_conf_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_idc_lint_valid0/data_managers.yml')
output_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_idc_lint_valid0/output.yaml')
    def write_shed_install_conf(data_manager_conf_path: str, output_path: str) -> None:
        tools_yaml = build_shed_install_conf(data_manager_conf_path)
    
        # validate generated dict to ensure we're writing out valid file
>       RepositoryInstallTargets(**tools_yaml)
E       pydantic_core._pydantic_core.ValidationError: 2 validation errors for RepositoryInstallTargets
E       api_key
E         Field required [type=missing, input_value={'tools': [{'name': 'data...olshed.g2.bx.psu.edu'}]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.10/v/missing
E       galaxy_instance
E         Field required [type=missing, input_value={'tools': [{'name': 'data...olshed.g2.bx.psu.edu'}]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.10/v/missing

@mvdbeek
Copy link
Member

mvdbeek commented Mar 3, 2025

that's the difference between pydantic 1 and 2. Optional[thing] means union of thing and None. If you want to allow omitting the value you need to provide a default,i.e Optional[thing] = None. That matches the signature logic of python functions.

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