Skip to content

Latest commit

 

History

History
84 lines (45 loc) · 2.18 KB

development.adoc

File metadata and controls

84 lines (45 loc) · 2.18 KB

Working with the code

Install dependencies

It’s assumed a Python environment with pip is installed.

Windows

Make sure the swig executable is in your PATH. Add libusb and ykpers DLLs to the root of the repository.

macOS

$ brew install swig ykpers libusb

Linux (Debian-based distributions)

$ sudo apt install swig libykpers-1-1 libu2f-udev pcscd libpcsclite-dev

Install yubikey-manager from source

Clone the repository:

$ git clone https://github.com/Yubico/yubikey-manager.git
$ cd yubikey-manager

Install in editable mode with pip:

$ pip install -e .

Show available commands:

$ ykman --help

Show information about inserted YubiKey:

$ ykman info

Run ykman in DEBUG mode:

$ ykman --log-level DEBUG info

To uninstall, run:

$ pip uninstall yubikey-manager

Code Style & Security

This project uses Flake8 for code style and Bandit for security linting. These are invoked with a pre-commit hook. To use these:

$ pip install pre-commit flake8 bandit
$ pre-commit install

Unit tests

First, install tox if you haven’t already:

$ pip install tox

To run unit tests:

$ tox

To run with multiple Python versions (requires all those interpreters to be installed):

$ tox -e py27,py38

Integration tests

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 numbers (given by ykman list) of the YubiKeys to test with:

$ DESTRUCTIVE_TEST_YUBIKEY_SERIALS=123456,234567 tox -e integration-test

The integration test suite will automatically identify which test cases can be run with the available YubiKeys, and run those test cases for each eligible YubiKey. See integration-tests.adoc for a deep dive into how this works.

Packaging

For third-party packaging, use the source releases and signatures available here.