Skip to content

Commit 9bf7790

Browse files
authored
Merge pull request adafruit#3622 from sw23/main
Fixing remaining stub mypy issues + run check-stubs to CI
2 parents 73582c9 + 88fcf4e commit 9bf7790

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
sudo apt-get install -y eatmydata
3939
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
40-
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli
40+
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
4141
- name: Versions
4242
run: |
4343
gcc --version
@@ -67,8 +67,8 @@ jobs:
6767
- name: mpy Tests
6868
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
6969
working-directory: tests
70-
- name: Stubs
71-
run: make stubs -j2
70+
- name: Build and Validate Stubs
71+
run: make check-stubs -j2
7272
- uses: actions/upload-artifact@v2
7373
with:
7474
name: stubs

shared-bindings/ipaddress/IPv4Address.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const mp_obj_property_t ipaddress_ipv4address_version_obj = {
126126
(mp_obj_t)&mp_const_none_obj},
127127
};
128128

129-
//| def __eq__(self, other: IPv4Address) -> bool:
129+
//| def __eq__(self, other: object) -> bool:
130130
//| """Two Address objects are equal if their addresses and address types are equal."""
131131
//| ...
132132
//|

shared-bindings/socket/__init__.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,21 @@ STATIC const mp_obj_type_t socket_type;
4949

5050
//| class socket:
5151
//|
52-
//| def __init__(self, family: int, type: int, proto: int) -> None:
52+
//| AF_INET: int
53+
//| AF_INET6: int
54+
//| SOCK_STREAM: int
55+
//| SOCK_DGRAM: int
56+
//| SOCK_RAW: int
57+
//| IPPROTO_TCP: int
58+
//|
59+
//| def __init__(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
5360
//| """Create a new socket
5461
//|
5562
//| :param int family: AF_INET or AF_INET6
5663
//| :param int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW
5764
//| :param int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
5865
//| ...
5966
//|
60-
//| AF_INET: int
61-
//| AF_INET6: int
62-
//| SOCK_STREAM: int
63-
//| SOCK_DGRAM: int
64-
//| SOCK_RAW: int
65-
//|
6667

6768
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) {
6869
mp_arg_check_num(n_args, kw_args, 0, 4, false);

shared-bindings/socketpool/SocketPool.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,22 @@ STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t
5757
return MP_OBJ_FROM_PTR(s);
5858
}
5959

60-
61-
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> None:
60+
//| AF_INET: int
61+
//| AF_INET6: int
62+
//| SOCK_STREAM: int
63+
//| SOCK_DGRAM: int
64+
//| SOCK_RAW: int
65+
//| IPPROTO_TCP: int
66+
//|
67+
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM, proto: int = IPPROTO_TCP) -> socketpool.Socket:
6268
//| """Create a new socket
6369
//|
6470
//| :param ~int family: AF_INET or AF_INET6
6571
//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW
6672
//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)"""
6773
//| ...
6874
//|
75+
6976
STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
7077
mp_arg_check_num(n_args, kw_args, 0, 5, false);
7178

0 commit comments

Comments
 (0)