Commit Graph

62 Commits

Author SHA1 Message Date
Stephen Morton
0fb3a092c7 Miscellaneous type_check_only annotations (#13058) 2024-11-21 08:41:38 +00:00
Stephen Morton
4f37d8fff8 add _ssl module (#11155)
Really all I needed for fixing the inheritance was _ssl._SSLContext.
But then I needed all the other stuff in _ssl, and if I was doing that
I wanted to do a thorough job of it.

Motivation was originally related to https://github.com/python/typeshed/issues/3968 ,
but we're well beyond that now, really.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-01 20:10:51 -07:00
Eric Traut
17f1c4628a Add precise values for enum members where possible (#11299)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-04-22 15:10:59 +01:00
layday
a9d644b3ff Add get_verified_chain and get_unverified_chain for Python 3.13 (#11724)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-05 19:29:11 +01:00
Shantanu
470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Shantanu
4d8ae17776 Bump mypy to 1.9, add to json.encoder, small fixups (#11549)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-09 14:25:00 -08:00
Sebastian Rittau
53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau
23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Nikita Sobolev
fb994e344b Fix ssl.SSLSocket methods on windows (#10849) 2023-10-07 07:50:52 +01:00
Nikita Sobolev
b23042e854 ssl.OP_ENABLE_KTLS should exist on linux (#10778) 2023-09-26 09:48:00 +02:00
Alex Waygood
4ae6d38f96 Use latest Python for stubtest in CI (#10641) 2023-08-30 18:50:11 +02:00
CoolCat467
607cee5914 SSL wrap_socket and wrap_bio accept bytes as well (#10590) 2023-08-16 11:23:24 +01:00
Nikita Sobolev
9d0ed1571f Update ssl to 3.12 (#10547) 2023-08-09 09:18:33 +02:00
Alex Waygood
230a8f7c6c Fix stubtest for Python 3.12.0rc1 (#10541) 2023-08-07 12:41:31 -07:00
Alex Waygood
03b4bb9cce Stdlib: add many missing __hash__ and __eq__ methods (#10464) 2023-07-17 14:21:02 +02:00
Alex Waygood
257e287fec Stdlib: correct many parameter names (#9815) 2023-03-04 09:53:12 +00:00
Alex Waygood
4d99b33f84 Fix an unnecessary allowlist entry in ssl.pyi (#9776) 2023-02-20 16:35:38 -08:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Alex Waygood
1d7dda7fa1 stdlib: Add defaults for positional-only parameters (#9655) 2023-02-01 21:44:08 +00:00
Alex Waygood
2539649560 Add a default for ssl.SSLContext.__new__ on 3.10+ (#9635) 2023-01-31 17:30:00 -08:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Seth Michael Larson
ebba92c986 Add SSLContext.security_level property for Python 3.10 (#9577) 2023-01-22 19:28:44 +01:00
Alex Waygood
d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Jelle Zijlstra
b43e1db47b ssl, sysconfig: fix issues with defaults (#9507)
- ssl._create_unverified_context allows None since 3.10:
  2875c603b2 (diff-f6439be9c66350dde4c35dbeea0352c96cc970ba12b0478f6ae36f10725bd8c5)
- sysconfig.is_python_build ignores its argument since 3.11:
  067597522a
  (was backported into 3.11)
2023-01-12 10:19:41 -08:00
Nikita Sobolev
bd75ceb0b6 Fix stdlib stubtest failures on main (#9255)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-11-23 10:07:05 +00:00
Jelle Zijlstra
287fce4872 ssl, socket, array: Improve bytes handling (#8997) 2022-10-28 15:35:51 +02:00
Kevin Kirsche
2c7ac0990f Remove ssl.SSLContext.__init__ (#8640)
Fixes: #8632
2022-08-29 13:07:59 +01:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Amy Pircher
8a07787f48 Add precise overloads for SSLContext.get_ca_certs (#7933) 2022-05-23 17:06:09 -07:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
1acc8f3bd6 Use PEP 604 syntax wherever possible, part II (#7514)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-19 14:27:35 +00:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Patrick Rauscher
c987c78077 Remove ClassVar from SSLContext.ssl{object,socket}_class (#7465)
These attributes have class-level defaults, but the docs explicitly state that it's OK to override them on instances.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-09 08:53:18 +00:00
Alex Waygood
a0b41959ec stdlib: fix many attributes which are read-only at runtime but read-write in the stub (#7395) 2022-02-27 16:23:09 -08:00
Alex Waygood
2878050ffc Add @final to several stdlib classes that cannot be subclassed at runtime (#7213) 2022-02-14 14:46:30 -08:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood
33ecb68603 Fix return annotations of several methods that return self at runtime (#7070) 2022-01-28 17:37:49 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Sebastian Rittau
3fb2bcd4c1 Restore stubtest 0.930 (#6663) 2021-12-22 20:18:19 -08:00
Akuli
2b702233c6 tests/check_new_syntax.py: check order of if statements (#6423) 2021-11-28 08:04:46 -08:00
Shantanu
d68a28fb52 ssl: add timeout to get_server_certificate (#6421)
Co-authored-by: hauntsaninja <>
2021-11-28 12:32:12 +02:00
Alex Waygood
593ec01537 ssl: add missing VerifyFlags (#6411)
The documentation assures me that these were both added in 3.10: https://docs.python.org/3/library/ssl.html
2021-11-27 22:48:56 -08:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
wouter bolsterlee
757d962237 Improve ssl module annotations (#5934)
This improves the type annotations for the ‘ssl’ module:

- Various APIs taking file names (e.g. keyfile=, certfile=, cafile=,
  capath=, ...) were annotated as accepting only strings, while actually
  they accept str, bytes, and os.PathLike (such as pathlib.Path).
  CPython's _ssl.c module has always used PyUnicode_FSConverter to
  handle (normalize) these. Change the annotations accordingly using the
  internal _typeshed.StrOrBytesPath alias.

- Tighten the ‘purpose=’ argument in various functions to use the
  already defined ‘Purpose’ enum instead of accepting ‘Any’.
2021-08-18 08:23:31 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00