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

ci: fix lint failure of mypy due to modern typed libraries #305

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

maartenbreddels
Copy link
Contributor

Introduced in traitlets 5.10 due to

The correct way would be to fix the errors, but we don't want CI to fail randomly. This also supports our idea of having lockfiles for CI.

@maartenbreddels maartenbreddels changed the title ci: fix lint failure of mypy due to modern typed traitlets ci: fix lint failure of mypy due to modern typed libraries Sep 27, 2023
@maartenbreddels
Copy link
Contributor Author

Also matplotlib 3.8 seems to introduce typing which makes mypy linting fail.

@EwoutH
Copy link
Contributor

EwoutH commented Oct 31, 2023

This should be tagged as technical debt and, in my opinion, prioritized.

@@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install ".[dev]" mypy==0.991 black==22.12.0 codespell==2.2.4 "click<8.1.4"
pip install ".[dev]" mypy==0.991 black==22.12.0 codespell==2.2.4 "click<8.1.4" "traitlets<5.10.0" "matplotlib<3.8.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Versions are currently pinned in the GitHub workflow, but not in the pyproject.toml (optional) dependencies. Doesn't that mean users can install dependency versions that are not supported or tested by solara?

As far as I know, best practice is to define dependencies in pyproject.toml and use those in testing/CI. If you have dependencies only used in testing or dev, add them to an optional dependency list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that we should fix this soon, but it's not as high a priority as a runtime failure.

However, I disagree we should do version pinning in solara since that can make environments unsolvable. Pinning should only be done by applications (or application-like libraries, or when you know for sure there is a failure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for getting back. I agree that pinning exact versions is bad practice (for exactly the reasons you said),

Also I can't imagine black and mypy should be required dependencies, those should be optional dependencies (in .[dev] or .[ci] for example), and then regular users won't install them. Thus limiting the version range doesn't affect them, since it's purely for internal use.

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