It’s assumed a Python 3 environment with pip is installed. Additionally, the project uses poetry as its build tool; install that as well.
Make sure the swig executable is in your PATH.
Clone the repository:
$ git clone https://github.com/Yubico/yubikey-manager.git $ cd yubikey-manager
Install via poetry:
$ poetry install
Show available commands:
$ poetry run ykman --help
Show information about inserted YubiKey:
$ poetry run ykman info
Run ykman in DEBUG mode:
$ poetry run ykman --log-level DEBUG info
This project uses Black and Flake8 for code style, mypy for static type checking, and Bandit for security linting. These are invoked with a pre-commit hook.
To use these:
$ pip install pre-commit $ pre-commit install
Warning
|
ONLY run these on dedicated developer keys, as it will permanently delete data on the device(s)! |
To run integration tests, indicate the serial number (given by ykman list
) of
the YubiKey to test with. Make sure no other YubiKey is connected when running
the test!
$ poetry run pytest --device 123456
To run the tests over NFC, place the YubiKey to test on an NFC reader, and indicate both the reader and the serial number of the YubiKey:
$ poetry run pytest --reader HID --device 123456
The integration test suite will automatically identify which test cases can be run with the attached YubiKey.
For third-party packaging, use the source releases and signatures available here.