Skip to content

Commit

Permalink
Add testenv:dev to create development environment (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhrutledge committed Jun 13, 2021
1 parent 0cf7f88 commit 3163fd0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
35 changes: 17 additions & 18 deletions docs/contributing.rst
Expand Up @@ -11,36 +11,35 @@ mailing list`_, to ask questions or get involved.
Getting started
---------------

We recommend you use a `virtual environment`_, so that twine and its
dependencies do not interfere with other packages installed on your
machine.

Clone the twine repository from GitHub, then make and activate a
virtual environment that uses Python 3.6 or newer as the default
Python. For example:
We use `tox`_ to run tests, check code style, and build the documentation.
To install ``tox``, run:

.. code-block:: console
cd /path/to/your/local/twine
python3.6 -m venv venv
source venv/bin/activate
python3 -m pip install tox
Then, run the following commands:
Clone the twine repository from GitHub, then run:

.. code-block:: console
pip install -U pip
pip install -e .
cd /path/to/your/local/twine
tox -e dev
Now, in your virtual environment, ``twine`` is pointing at your local copy, so
when you make changes, you can easily see their effect.
This creates a `virtual environment`_, so that twine and its
dependencies do not interfere with other packages installed on your
machine. In the virtual environment, ``twine`` is pointing at your
local copy, so when you make changes, you can easily see their effect.

We use `tox`_ to run tests, check code style, and build the documentation.
To install ``tox`` in your active virtual environment, run:
The virtual environment also contains the tools for running tests
and checking code style, so you can run them on single files directly or
in your code editor. However, we still encourage using the ``tox`` commands
below on the whole codebase.

To use the virtual environment, run:

.. code-block:: console
pip install tox
source venv/bin/activate
Building the documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
15 changes: 15 additions & 0 deletions tox.ini
Expand Up @@ -102,6 +102,21 @@ commands =
python -m build
python -m twine upload dist/*

[testenv:dev]
envdir = {posargs:venv}
recreate = True
deps =
{[testenv]deps}
{[testenv:integration]deps}
{[testenv:format]deps}
{[testenv:lint]deps}
{[testenv:types]deps}
download = True
usedevelop = True
commands =
python -c 'import sys; print(sys.executable)'
python --version

[testenv:devpi]
deps =
devpi-server
Expand Down

0 comments on commit 3163fd0

Please sign in to comment.