Skip to content

[pyjks] Fill in jks.bks and other modules, improved constructors#10815

Merged
srittau merged 8 commits intopython:mainfrom
intgr:add-pyjks-bks-types
Oct 6, 2023
Merged

[pyjks] Fill in jks.bks and other modules, improved constructors#10815
srittau merged 8 commits intopython:mainfrom
intgr:add-pyjks-bks-types

Conversation

@intgr
Copy link
Copy Markdown
Contributor

@intgr intgr commented Oct 1, 2023

Additionally:

  • Fixed type of PrivateKeyEntry.__init__(encrypted=) argument
  • Improved type of SecretKeyEntry.__init__(sealed_obj=) argument
  • Removed defaults from constructor args that shouldn't be None (alias, timestamp, etc).
  • Added | None to constructor arguments that may be None
  • Replaced = ... with = None where appropriate
  • Added @overload constructors for encrypted and unencrypted usages
  • Added helpful comments to __init__ constructors

Additionally 1 fix to `jks.PrivateKeyEntry.__init__`
@github-actions

This comment has been minimized.

@intgr intgr marked this pull request as ready for review October 1, 2023 16:28
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@intgr
Copy link
Copy Markdown
Contributor Author

intgr commented Oct 1, 2023

Ah thanks again, I forgot the * in args list.

@AlexWaygood
Copy link
Copy Markdown
Member

We should improve the stubtest error message there — that kind of thing comes up a lot, and stubtest could be clearer about what's gone wrong in this case!

@AlexWaygood
Copy link
Copy Markdown
Member

We should improve the stubtest error message there — that kind of thing comes up a lot, and stubtest could be clearer about what's gone wrong in this case!

Filed python/mypy#16210 to improve this!

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks! Notes below.

Comment thread stubs/pyjks/jks/bks.pyi Outdated
Comment thread stubs/pyjks/jks/bks.pyi Outdated
Comment thread stubs/pyjks/jks/jks.pyi Outdated
@github-actions

This comment has been minimized.

intgr added 2 commits October 6, 2023 00:04
…s, timestamp, etc).

* Added `| None` to constructor arguments that may be None
* Added `@overload` constructors for encrypted and unencrypted usages
* Replaced `= ...` with `= None` where appropriate
* Added helpful comments to `__init__` constructors
@intgr intgr changed the title [pyjks] Fill in jks.bks and remaining modules [pyjks] Fill in jks.bks and other modules, improved constructors Oct 5, 2023
@intgr
Copy link
Copy Markdown
Contributor Author

intgr commented Oct 5, 2023

Pushed lots of changes:

  • Improved type of SecretKeyEntry.__init__(sealed_obj=) argument
  • Removed defaults from constructor args that shouldn't be None (alias, timestamp, etc).
  • Added | None to constructor arguments that may be None
  • Replaced = ... with = None where appropriate
  • Added @overload constructors for encrypted and unencrypted usages

I could split these back out and open separate PR if you'd prefer.

@intgr intgr requested a review from srittau October 5, 2023 21:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 5, 2023

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

Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@srittau srittau merged commit ee6df10 into python:main Oct 6, 2023
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