Skip to content

Commit 1432f0b

Browse files
authored
Added PyPi installation instructions & replaced building locally with documentation
1 parent c4ad385 commit 1432f0b

File tree

1 file changed

+28
-48
lines changed

1 file changed

+28
-48
lines changed

README.rst

Lines changed: 28 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
2929
This is easily achieved by downloading
3030
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
3131

32+
Installing from PyPI
33+
====================
34+
35+
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
36+
PyPI <https://pypi.org/project/adafruit-circuitpython-hcsr04/>`_. To install for current user:
37+
38+
.. code-block:: shell
39+
40+
pip3 install adafruit-circuitpython-hcsr04
41+
42+
To install system-wide (this may be required in some cases):
43+
44+
.. code-block:: shell
45+
46+
sudo pip3 install adafruit-circuitpython-hcsr04
47+
48+
To install in a virtual environment in your current project:
49+
50+
.. code-block:: shell
51+
52+
mkdir project-name && cd project-name
53+
python3 -m venv .env
54+
source .env/bin/activate
55+
pip3 install adafruit-circuitpython-hcsr04
56+
3257
Usage Example
3358
=============
3459

@@ -115,52 +140,7 @@ Contributions are welcome! Please read our `Code of Conduct
115140
<https://github.com/adafruit/Adafruit_CircuitPython_HCSR04/blob/master/CODE_OF_CONDUCT.md>`_
116141
before contributing to help this project stay welcoming.
117142

118-
Building locally
119-
================
120-
121-
Zip release files
122-
-----------------
123-
124-
To build this library locally you'll need to install the
125-
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
126-
127-
.. code-block:: shell
128-
129-
python3 -m venv .env
130-
source .env/bin/activate
131-
pip install circuitpython-build-tools
132-
133-
Once installed, make sure you are in the virtual environment:
134-
135-
.. code-block:: shell
136-
137-
source .env/bin/activate
138-
139-
Then run the build:
140-
141-
.. code-block:: shell
142-
143-
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-hcsr04 --library_location .
144-
145-
Sphinx documentation
146-
-----------------------
147-
148-
Sphinx is used to build the documentation based on rST files and comments in the code. First,
149-
install dependencies (feel free to reuse the virtual environment from above):
150-
151-
.. code-block:: shell
152-
153-
python3 -m venv .env
154-
source .env/bin/activate
155-
pip install Sphinx sphinx-rtd-theme
156-
157-
Now, once you have the virtual environment activated:
158-
159-
.. code-block:: shell
160-
161-
cd docs
162-
sphinx-build -E -W -b html . _build/html
143+
Documentation
144+
=============
163145

164-
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
165-
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
166-
locally verify it will pass.
146+
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

0 commit comments

Comments
 (0)