kwvanderlinde / python-cached-requests

Memory-efficient caching for the requests library and Python 3
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Cached

Getting Started with Development

I prefer using pipenv to do my work. Note that, per recommendation, we do not commit Pipfile or Pipfile.lock. Personally I would love to see pipenv support libraries as well as applications, but right now we are required to use setuptools as a library.

To get pipenv ready-to-use:

cd <project_repository>
# your library will bring the dependencies (via install_requires in setup.py)
pipenv install -e .
pipenv install --dev -e .[dev]
# Enter the virtual environment.
pipenv shell

Note that these commands must be run outside of a pipenv virtual environment. It's a mystery to me, but for some reason pipenv cannot handle the . passed to pipenv install when inside the virtual environment.

Running the tests

It's as easy as running this under the pipenv shell:

env PYTHONPATH=. pytest --cov=cached --cov-report html

You can then view the coverage report by opening htmlcov/index.html.