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

Migrate mypy configuration into pyproject.toml #225

Merged
merged 1 commit into from
May 20, 2022

Conversation

robin-nitrokey
Copy link
Member

Since mypy 9.000, the mypy configuration can be specified in
pyproject.toml. This format is much more legible as modules can be
specified as an array instead of concatenating them into one line.
There are also other improvements in the newer mypy versions.
Therefore, this patch bumps the minimum mypy version and moves the mypy
configuration into pyproject.toml. This does not affect the end user as
mypy is development dependency.

Since mypy 9.000, the mypy configuration can be specified in
pyproject.toml.  This format is much more legible as modules can be
specified as an array instead of concatenating them into one line.
There are also other improvements in the newer mypy versions.
Therefore, this patch bumps the minimum mypy version and moves the mypy
configuration into pyproject.toml.  This does not affect the end user as
mypy is development dependency.
Comment on lines +91 to +92
"usb.*",
"usb1.*",
Copy link
Member

Choose a reason for hiding this comment

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

Q: do we use two different USB libraries here (e.g. through dependency)?

Copy link
Member Author

Choose a reason for hiding this comment

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

In pynitrokey itself, we use usb (= pyusb package) for fido2 and start and usb1 (= libusb1 package) for pro and storage. Also, our nkdfu dependency requires usb1 while pyocd/spsdk requires usb.

$ grep "import usb" -r pynitrokey
pynitrokey/fido2/__init__.py:import usb
pynitrokey/fido2/dfu.py:import usb._objfinalizer
pynitrokey/fido2/dfu.py:import usb.core
pynitrokey/fido2/dfu.py:import usb.util
pynitrokey/cli/pro.py:    import usb1
pynitrokey/cli/storage.py:import usb1
pynitrokey/start/usb_strings.py:import usb
pynitrokey/start/gnuk_token.py:import usb
pynitrokey/start/upgrade_by_passwd.py:    import usb
$ grep "from usb" -r pynitrokey
pynitrokey/cli/start.py:from usb.core import USBError
$ pipdeptree --reverse --packages libusb1,pyusb
libusb1==3.0.0
  - nkdfu==0.1 [requires: libusb1>=1.9.3]
    - pynitrokey==0.4.21 [requires: nkdfu]
pyusb==1.2.1
  - pynitrokey==0.4.21 [requires: pyusb]
  - pyocd==0.31.0 [requires: pyusb>=1.2.1,<2.0]
    - spsdk==1.6.3 [requires: pyocd>=0.28.3,<=0.31.0]
      - pynitrokey==0.4.21 [requires: spsdk>=1.6.0,<1.7.0]

@szszszsz szszszsz merged commit 4cf60b3 into Nitrokey:master May 20, 2022
@robin-nitrokey robin-nitrokey deleted the mypy-0.900 branch May 20, 2022 11:48
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.

2 participants