Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testenv:dev to create development environment #765

Merged
merged 1 commit into from Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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