Merge pull request #3622 from sw23/main

Fixing remaining stub mypy issues + run check-stubs to CI
This commit is contained in:
Scott Shawcroft 2020-11-02 18:16:32 -08:00 committed by GitHub
commit 9bf77905e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 13 deletions

View File

@ -37,7 +37,7 @@ jobs:
run: |
sudo apt-get install -y eatmydata
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy
- name: Versions
run: |
gcc --version
@ -67,8 +67,8 @@ jobs:
- name: mpy Tests
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
working-directory: tests
- name: Stubs
run: make stubs -j2
- name: Build and Validate Stubs
run: make check-stubs -j2
- uses: actions/upload-artifact@v2
with:
name: stubs

View File

@ -126,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = {
(mp_obj_t)&mp_const_none_obj},
};
//| def __eq__(self, other: IPv4Address) -> bool:
//| def __eq__(self, other: object) -> bool:
//| """Two Address objects are equal if their addresses and address types are equal."""
//| ...
//|

View File

@ -49,7 +49,14 @@ STATIC const mp_obj_type_t socket_type;
//| class socket:
//|
//| def __init__(self, family: int, type: int, proto: int) -> None:
//| AF_INET: int
//| AF_INET6: int
//| SOCK_STREAM: int
//| SOCK_DGRAM: int
//| SOCK_RAW: int
//| IPPROTO_TCP: int
//|
//| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
//| """Create a new socket
//|
//| :param int family: AF_INET or AF_INET6
@ -57,12 +64,6 @@ STATIC const mp_obj_type_t socket_type;
//| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
//| ...
//|
//| AF_INET: int
//| AF_INET6: int
//| SOCK_STREAM: int
//| SOCK_DGRAM: int
//| SOCK_RAW: int
//|
STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 4, false);

View File

@ -57,8 +57,14 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t
return MP_OBJ_FROM_PTR(s);
}
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
//| AF_INET: int
//| AF_INET6: int
//| SOCK_STREAM: int
//| SOCK_DGRAM: int
//| SOCK_RAW: int
//| IPPROTO_TCP: int
//|
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket:
//| """Create a new socket
//|
//| :param ~int family: AF_INET or AF_INET6
@ -66,6 +72,7 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t
//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
//| ...
//|
STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 5, false);