Skip to content

Commit

Permalink
Fixing RTD build
Browse files Browse the repository at this point in the history
After removing the `-e .` from requirements-dev.in, RTD can't build
because trio-websocket isn't installed. I configured RTD to install
from setup.py and then requirements-dev.txt, but then it fails because
setup.py picks packages that conflict with requirements-dev.txt. So
I'm abandoning pip tools in this commit and just using a hand-written
requirements-dev.txt.
  • Loading branch information
mehaase committed Nov 9, 2018
1 parent e5360ae commit ce4adf3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 119 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# product:
.PHONY: docs

export PYTHONPATH = .

coverage:
coveralls -v

Expand Down
45 changes: 3 additions & 42 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,14 @@ environment, and install the developer dependencies::
$ cd trio-websocket
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -e .
(venv) $ pip install -r requirements-dev.txt

This example uses Python's built-in ``venv`` package, but you can of course use
other virtual environment tools such as ``virtualenvwrapper``.

The instructions above *do not install the ``trio-websocket`` package itself*.
Instead, you should add the project directory to ``$PYTHONPATH``. For example,
add ``export PYTHONPATH=$(dirname $VIRTUAL_ENV)`` to the end of your
``venv/bin/activate`` script.

Development Dependencies
------------------------

You may have noticed in the developer installation instructions that the project
is installed from ``requirements-dev.txt`` and not from ``setup.py``. This
requirements file contains extra dependencies only needed for development, such
as PyTest, Sphinx, etc. The requirements file is generated from
``requirements-dev.in`` using `pip-tools
<https://pypi.org/project/pip-tools/>`__, which pins each dependency to an exact
version. This helps developers make reproducible builds across all environments,
including Travis CI.

If you need to modify the library's dependencies or modify the dev dependencies,
you will need to regenerate the requirements file::

$ pip-compile --output-file requirements-dev.txt setup.py requirements-dev.in

The ``pip-compile`` tool can also upgrade packages, which may be useful if you
want to update pinned versions without changing the declared dependencies in
``setup.py`` or ``requirements-dev.in``. The following command upgrades only the
named packages::

$ pip-compile -P package1 -P package2 requirements-dev.txt

Or you can upgrade all packages::

$ pip-compile --upgrade requirements-dev.txt


After making changes to dependencies, you should check in the file you changed
(e.g. ``setup.py`` or ``requirements-dev.txt``) as well as the generated
``requirements-dev.txt``.

In the future, when you checkout new branches or update existing branches, you
should use ``pip-sync`` to synchronize dependencies. This command will add,
upgrade, and even *remove* packages in order to make your environment match the
expected development environment.
The ``requirements-dev.txt`` file contains extra dependencies only needed for
development, such as PyTest, Sphinx, etc.

Unit Tests
----------
Expand Down
12 changes: 0 additions & 12 deletions requirements-dev.in

This file was deleted.

72 changes: 9 additions & 63 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,9 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements-dev.txt setup.py requirements-dev.in
#
alabaster==0.7.12 # via sphinx
asn1crypto==0.24.0 # via cryptography
async-generator==1.10
atomicwrites==1.2.1 # via pytest
attrs==18.2.0 # via outcome, pytest, trio
babel==2.6.0 # via sphinx
bleach==3.0.2 # via readme-renderer
certifi==2018.10.15 # via requests
cffi==1.11.5 # via cryptography
chardet==3.0.4 # via requests
click==7.0 # via pip-tools
coverage==4.5.1 # via coveralls, pytest-cov
coveralls==1.5.1
cryptography==2.3.1 # via trustme
docopt==0.6.2 # via coveralls
docutils==0.14 # via readme-renderer, sphinx
h11==0.8.1 # via wsproto
idna==2.7 # via cryptography, requests, trio, trustme, yarl
imagesize==1.1.0 # via sphinx
ipaddress==1.0.22
jinja2==2.10 # via sphinx
markupsafe==1.1.0 # via jinja2
more-itertools==4.3.0 # via pytest
multidict==4.4.2 # via yarl
outcome==1.0.0 # via trio
packaging==18.0 # via sphinx
pip-tools==3.1.0
pkginfo==1.4.2 # via twine
pluggy==0.8.0 # via pytest
py==1.7.0 # via pytest
pycparser==2.19 # via cffi
pygments==2.2.0 # via readme-renderer, sphinx
pyparsing==2.3.0 # via packaging
pytest-cov==2.6.0
pytest-trio==0.5.1
pytest==3.10.0
pytz==2018.7 # via babel
readme-renderer==24.0 # via twine
requests-toolbelt==0.8.0 # via twine
requests==2.20.1 # via coveralls, requests-toolbelt, sphinx, twine
six==1.11.0 # via bleach, cryptography, more-itertools, packaging, pip-tools, pytest, readme-renderer, sphinx
sniffio==1.0.0 # via trio
snowballstemmer==1.2.1 # via sphinx
sortedcontainers==2.0.5 # via trio
sphinx-rtd-theme==0.4.2
sphinx==1.8.1
sphinxcontrib-trio==1.0.1
sphinxcontrib-websupport==1.1.0 # via sphinx
tqdm==4.28.1 # via twine
trio==0.9.0
trustme==0.4.0
twine==1.12.1
urllib3==1.24.1 # via requests
webencodings==0.5.1 # via bleach
wsaccel==0.6.2
wsproto==0.12.0
yarl==1.2.6
coveralls
pytest
pytest-cov
pytest-trio
sphinx
sphinxcontrib-trio
sphinx_rtd_theme
trustme
twine

0 comments on commit ce4adf3

Please sign in to comment.