2014-03-18 15:29:00 +00:00
|
|
|
Getting started
|
2014-02-12 04:36:51 +00:00
|
|
|
===============
|
|
|
|
|
|
2016-04-23 14:28:23 +00:00
|
|
|
Development dependencies
|
|
|
|
|
------------------------
|
2023-01-03 01:47:06 +00:00
|
|
|
|
2014-02-12 04:36:51 +00:00
|
|
|
Working on ``cryptography`` requires the installation of a small number of
|
2014-06-26 18:00:33 +00:00
|
|
|
development dependencies in addition to the dependencies for
|
2023-12-10 17:39:06 +00:00
|
|
|
:doc:`/installation` (including :ref:`Rust<installation:rust>`). These are
|
|
|
|
|
handled by the use of ``nox``, which can be installed with ``pip``.
|
2014-02-12 04:36:51 +00:00
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
2014-02-12 04:46:39 +00:00
|
|
|
$ # Create a virtualenv and activate it
|
2016-09-03 17:10:36 +00:00
|
|
|
$ # Set up your cryptography build environment
|
2023-04-02 07:28:22 +00:00
|
|
|
$ pip install nox
|
2024-01-14 22:43:55 +00:00
|
|
|
$ nox -e local
|
2014-02-12 04:36:51 +00:00
|
|
|
|
2017-03-14 17:50:47 +00:00
|
|
|
OpenSSL on macOS
|
|
|
|
|
~~~~~~~~~~~~~~~~
|
2016-04-23 14:28:23 +00:00
|
|
|
|
2024-09-24 14:21:01 +00:00
|
|
|
You must have installed `OpenSSL`_ (via `Homebrew`_ or `MacPorts`_) before
|
2023-12-09 14:36:46 +00:00
|
|
|
invoking ``nox`` or else pip will fail to compile.
|
2016-04-23 14:28:23 +00:00
|
|
|
|
2014-03-18 15:29:00 +00:00
|
|
|
Running tests
|
2016-04-23 14:28:23 +00:00
|
|
|
-------------
|
2014-02-12 04:36:51 +00:00
|
|
|
|
|
|
|
|
``cryptography`` unit tests are found in the ``tests/`` directory and are
|
2024-01-14 22:43:55 +00:00
|
|
|
designed to be run using `pytest`_. ``nox`` automatically invokes ``pytest``
|
|
|
|
|
and other required checks for ``cryptography``:
|
2014-02-12 04:36:51 +00:00
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
2024-01-14 22:43:55 +00:00
|
|
|
$ nox -e local
|
2014-02-12 04:36:51 +00:00
|
|
|
|
|
|
|
|
|
2023-08-04 16:48:15 +00:00
|
|
|
You can also specify a subset of tests to run as positional arguments:
|
|
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ # run the whole x509 testsuite, plus the fernet tests
|
2024-01-14 22:43:55 +00:00
|
|
|
$ nox -e local -- tests/x509/ tests/test_fernet.py
|
2023-08-04 16:48:15 +00:00
|
|
|
|
2024-07-17 21:07:37 +00:00
|
|
|
Building the docs
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
Building the docs on non-Windows platforms requires manually installing
|
|
|
|
|
the C library ``libenchant`` (`installation instructions`_).
|
|
|
|
|
The docs can be built using ``nox``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ nox -e docs
|
|
|
|
|
|
2014-02-12 04:36:51 +00:00
|
|
|
|
2017-02-18 17:52:50 +00:00
|
|
|
.. _`Homebrew`: https://brew.sh
|
2016-04-23 14:28:23 +00:00
|
|
|
.. _`MacPorts`: https://www.macports.org
|
2016-11-06 09:30:36 +00:00
|
|
|
.. _`OpenSSL`: https://www.openssl.org
|
2018-04-15 23:41:11 +00:00
|
|
|
.. _`pytest`: https://pypi.org/project/pytest/
|
2023-04-02 07:28:22 +00:00
|
|
|
.. _`nox`: https://pypi.org/project/nox/
|
2018-04-15 23:41:11 +00:00
|
|
|
.. _`virtualenv`: https://pypi.org/project/virtualenv/
|
|
|
|
|
.. _`pip`: https://pypi.org/project/pip/
|
2023-08-04 16:48:15 +00:00
|
|
|
.. _`as documented here`: https://docs.rs/openssl/latest/openssl/#automatic
|
2024-09-24 14:21:01 +00:00
|
|
|
.. _`installation instructions`: https://pyenchant.github.io/pyenchant/install.html#installing-the-enchant-c-library
|