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

Add stubs for flask-migrate #8967

Merged
merged 6 commits into from
Nov 22, 2022
Merged

Add stubs for flask-migrate #8967

merged 6 commits into from
Nov 22, 2022

Conversation

kasium
Copy link
Contributor

@kasium kasium commented Oct 22, 2022

As discussed in miguelgrinberg/Flask-Migrate#492 types should be added to typeshed.

@kasium
Copy link
Contributor Author

kasium commented Oct 22, 2022

So stubstest fails since the cli functions are not functions but click.Command or click.Group. click has inline types so we cannot use it here as a dependency right now. Any clue how to solve this?

error: flask_migrate.cli.branches is not a function
Stub: at line [35](https://github.com/python/typeshed/actions/runs/3302880777/jobs/5450175814#step:5:36) in file /home/runner/work/typeshed/typeshed/stubs/Flask-Migrate/flask_migrate/cli.pyi
def (directory: Union[builtins.str, None], verbose: builtins.bool)
Runtime:
<Command branches>

@github-actions

This comment has been minimized.

@kasium
Copy link
Contributor Author

kasium commented Nov 17, 2022

Anybody any idea?

@JelleZijlstra
Copy link
Member

Should we even include the cli functions in the stub? I imagine they're not supposed to be called directly.

@AlexWaygood
Copy link
Member

Should we even include the cli functions in the stub? I imagine they're not supposed to be called directly.

I agree; we can probably just omit that file for now. Add an allowlist entry if stubtest complains.

As discussed in miguelgrinberg/Flask-Migrate#492 types should be added to typeshed.
@github-actions

This comment has been minimized.

@kasium
Copy link
Contributor Author

kasium commented Nov 22, 2022

@JelleZijlstra @AlexWaygood thanks for the support

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Mostly looks good -- a few comments below

stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
stubs/Flask-Migrate/flask_migrate/__init__.pyi Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit ed52f68 into python:main Nov 22, 2022
@kasium kasium deleted the flask-migrate branch November 22, 2022 16:53
hauntsaninja pushed a commit to python/mypy that referenced this pull request Dec 20, 2022
Removals from `stubinfo.py`:
- `atomicwrites` is archived and deprecated at runtime; stubs were
removed from typeshed in python/typeshed#8925
- `attrs` has had inline types for a very long time now
- `chardet` recently cut a release with inline types; typeshed's stubs
were marked obsolete in python/typeshed#9318
- `cryptography` has had inline types for a very long time now; the only
reason why it's still in typeshed is because other typeshed packages
need `types-cryptography` as a dependency, and our testing
infrastructure therefore can't currently cope with it being removed from
typeshed.
- `emoji` recently cut a release bundling stubs with the runtime
package; typeshed's stubs were marked obsolete in
python/typeshed#9051
- `termcolor` recently cut a release with inline types; typeshed's stubs
were marked obsolete in python/typeshed#8746
- `prettytable` recently cut a release with inline types; typeshed's
stubs were marked obsolete in
python/typeshed#9023

Additions:
- Stubs for `Xlib` were added in
python/typeshed#9279
- Stubs for `consolemenu` were added in
python/typeshed#8820
- Stubs for `dockerfile_parse` were added in
python/typeshed#9305
- Stubs for `flask_migrate` were added in
python/typeshed#8967
- Stubs for `paho.mqtt` were added in
python/typeshed#8853
- Stubs for `pycocotools` were added in
python/typeshed#9086
- Stubs for many `pywin32` modules were added in
python/typeshed#8825, and multiple follow-up PRs
- Stubs for `pyscreeze` were added in
python/typeshed#8823
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.

3 participants