Skip to content

Commit 3163fd0

Browse files
authored
Add testenv:dev to create development environment (#765)
1 parent 0cf7f88 commit 3163fd0

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

docs/contributing.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,35 @@ mailing list`_, to ask questions or get involved.
1111
Getting started
1212
---------------
1313

14-
We recommend you use a `virtual environment`_, so that twine and its
15-
dependencies do not interfere with other packages installed on your
16-
machine.
17-
18-
Clone the twine repository from GitHub, then make and activate a
19-
virtual environment that uses Python 3.6 or newer as the default
20-
Python. For example:
14+
We use `tox`_ to run tests, check code style, and build the documentation.
15+
To install ``tox``, run:
2116

2217
.. code-block:: console
2318
24-
cd /path/to/your/local/twine
25-
python3.6 -m venv venv
26-
source venv/bin/activate
19+
python3 -m pip install tox
2720
28-
Then, run the following commands:
21+
Clone the twine repository from GitHub, then run:
2922

3023
.. code-block:: console
3124
32-
pip install -U pip
33-
pip install -e .
25+
cd /path/to/your/local/twine
26+
tox -e dev
3427
35-
Now, in your virtual environment, ``twine`` is pointing at your local copy, so
36-
when you make changes, you can easily see their effect.
28+
This creates a `virtual environment`_, so that twine and its
29+
dependencies do not interfere with other packages installed on your
30+
machine. In the virtual environment, ``twine`` is pointing at your
31+
local copy, so when you make changes, you can easily see their effect.
3732

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

4140
.. code-block:: console
4241
43-
pip install tox
42+
source venv/bin/activate
4443
4544
Building the documentation
4645
^^^^^^^^^^^^^^^^^^^^^^^^^^

tox.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ commands =
102102
python -m build
103103
python -m twine upload dist/*
104104

105+
[testenv:dev]
106+
envdir = {posargs:venv}
107+
recreate = True
108+
deps =
109+
{[testenv]deps}
110+
{[testenv:integration]deps}
111+
{[testenv:format]deps}
112+
{[testenv:lint]deps}
113+
{[testenv:types]deps}
114+
download = True
115+
usedevelop = True
116+
commands =
117+
python -c 'import sys; print(sys.executable)'
118+
python --version
119+
105120
[testenv:devpi]
106121
deps =
107122
devpi-server

0 commit comments

Comments
 (0)