|
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +.. or more contributor license agreements. See the NOTICE file |
| 3 | +.. distributed with this work for additional information |
| 4 | +.. regarding copyright ownership. The ASF licenses this file |
| 5 | +.. to you under the Apache License, Version 2.0 (the |
| 6 | +.. "License"); you may not use this file except in compliance |
| 7 | +.. with the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | +.. http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +.. Unless required by applicable law or agreed to in writing, |
| 12 | +.. software distributed under the License is distributed on an |
| 13 | +.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +.. KIND, either express or implied. See the License for the |
| 15 | +.. specific language governing permissions and limitations |
| 16 | +.. under the License. |
| 17 | +
|
| 18 | +Introduction |
| 19 | +============ |
| 20 | +We welcome and encourage contributions of all kinds, such as: |
| 21 | + |
| 22 | +1. Tickets with issue reports of feature requests |
| 23 | +2. Documentation improvements |
| 24 | +3. Code, both PR and (especially) PR Review. |
| 25 | + |
| 26 | +In addition to submitting new PRs, we have a healthy tradition of community members reviewing each other’s PRs. |
| 27 | +Doing so is a great way to help the community as well as get more familiar with Rust and the relevant codebases. |
| 28 | + |
| 29 | +How to develop |
| 30 | +-------------- |
| 31 | + |
| 32 | +This assumes that you have rust and cargo installed. We use the workflow recommended by `pyo3 <https://github.com/PyO3/pyo3>`_ and `maturin <https://github.com/PyO3/maturin>`_. |
| 33 | + |
| 34 | +Bootstrap: |
| 35 | + |
| 36 | +.. code-block:: shell |
| 37 | +
|
| 38 | + # fetch this repo |
| 39 | + git clone [email protected]:apache/arrow-datafusion-python.git |
| 40 | + # prepare development environment (used to build wheel / install in development) |
| 41 | + python3 -m venv venv |
| 42 | + # activate the venv |
| 43 | + source venv/bin/activate |
| 44 | + # update pip itself if necessary |
| 45 | + python -m pip install -U pip |
| 46 | + # install dependencies (for Python 3.8+) |
| 47 | + python -m pip install -r requirements-310.txt |
| 48 | +
|
| 49 | +The tests rely on test data in git submodules. |
| 50 | + |
| 51 | +.. code-block:: shell |
| 52 | +
|
| 53 | + git submodule init |
| 54 | + git submodule update |
| 55 | +
|
| 56 | +
|
| 57 | +Whenever rust code changes (your changes or via `git pull`): |
| 58 | + |
| 59 | +.. code-block:: shell |
| 60 | +
|
| 61 | + # make sure you activate the venv using "source venv/bin/activate" first |
| 62 | + maturin develop |
| 63 | + python -m pytest |
| 64 | +
|
| 65 | +
|
| 66 | +Update Dependencies |
| 67 | +------------------- |
| 68 | + |
| 69 | +To change test dependencies, change the `requirements.in` and run |
| 70 | + |
| 71 | +.. code-block:: shell |
| 72 | +
|
| 73 | + # install pip-tools (this can be done only once), also consider running in venv |
| 74 | + python -m pip install pip-tools |
| 75 | + python -m piptools compile --generate-hashes -o requirements-310.txt |
| 76 | +
|
| 77 | +
|
| 78 | +To update dependencies, run with `-U` |
| 79 | + |
| 80 | +.. code-block:: shell |
| 81 | +
|
| 82 | + python -m piptools compile -U --generate-hashes -o requirements-310.txt |
| 83 | +
|
| 84 | +
|
| 85 | +More details about pip-tools `here <https://github.com/jazzband/pip-tools>`_ |
0 commit comments