8000 Add buil instructions · ada-url/ada-python@81d7dd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81d7dd7

Browse files
bbaylesanonrig
authored andcommitted
Add buil instructions
1 parent ed3e241 commit 81d7dd7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docs/index.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
.. include:: ./_build/README.pprst
22

3+
Building from source
4+
====================
5+
6+
You will need to have Python 3 development files installed.
7+
On macOS, you will have these if you installed Python with ``brew``.
8+
On Linux, you may need to install some packages (e.g., ``python3-dev`` and ``python3-venv``).
9+
10+
You will also need a C++ toolchain.
11+
On macOS, Xcode will provide this for you.
12+
On Linux, you may need to install some more pacakges (e.g. ``build-esential``).
13+
14+
Clone the git repository to a directory for development:
15+
16+
.. code-block:: sh
17+
18+
git clone https://github.com/ada-url/python/ ada_url_python
19+
cd ada_url_python
20+
21+
Create a virtual environment to use for building:
22+
23+
.. code-block:: sh
24+
25+
python3 -m venv env
26+
source ./env/bin/activate
27+
28+
After that, you're ready to build the package:
29+
30+
.. code-block:: sh
31+
32+
python -m pip install -r requirements/development.txt
33+
c++ -c "ada_url/ada.cpp" -fPIC -std="c++17" -O2 -o "ada_url/ada.o"
34+
python -m build --no-isolation
35+
36+
This will create a `.whl` file in the `dist` directory. You can install it in other
37+
virtual environments on the same machine.
38+
39+
To run tests, first build a package. Then:
40+
41+
.. code-block:: sh
42+
43+
python -m pip install -e .
44+
python -m unittest
45+
46+
Leave the virtual environment with the ``deactivate`` comamnd.
47+
348
API Documentation
449
=================
550

0 commit comments

Comments
 (0)
0