Skip to content

Commit

Permalink
update the contribution guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Alleria1809 committed Jul 11, 2024
1 parent 85d859e commit 1911ee2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
31 changes: 20 additions & 11 deletions docs/source/contributor/contribute_to_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ To set up ``poetry`` and contribute, please check the following steps:
3. **Install Dependencies:**

Use Poetry to install the dependencies and set up the virtual environment:
The ``./lightrag/pyproject.toml`` controls the dependencies for the ``LightRAG`` package.
Use Poetry to install the dependencies and set up the virtual environment:

.. code-block:: bash
cd lightrag
poetry install
poetry shell
Codebase Structure
^^^^^^^^^^^^^^^^^^^
It is recommended to check our `LightRAG codebase structure <https://lightrag.sylph.ai/developer_notes/index.html>`_ and current `API references <https://lightrag.sylph.ai/apis/index.html>`_ to familiarize yourself with the directories and paths before contributing.


Code Examples
^^^^^^^^^^^^^^^^^^^
We want to support you with our best. We have included code samples in the `tutorial <https://lightrag.sylph.ai/developer_notes/index.html>`_ for you to refer to.
Expand All @@ -61,22 +61,31 @@ Code Tips

Dependencies
^^^^^^^^^^^^^^^^^^^
If you are adding any new dependencies to the package, please make sure you have include them in your PR description to inform us.
If you want to add any new dependencies to the package, please include them in your PR description to inform us.
Since we have already set up the testing automatic workflow in GitHub, please also set your new dependencies in
``./lightrag/pyproject.toml`` file ``[tool.poetry.group.test.dependencies]`` section to avoid dependency errors in our CI/CD workflow.

In order to correctly add the dependency using ``poetry``, please run

.. code-block:: bash
poetry add --group test <package-name>
Testing
^^^^^^^^^^^^^^^^^^^
Please make sure your code is well-tested before making a pull request.
After you update the code, please make sure your code is well tested before making a pull request.
There is a ``./lightrag/tests`` folder in the project directory to host your unit testing cases.

You might need to install the testing packages using ``pip install``:
You might need to install the testing packages using ``poetry``:

Example packages:
For example:

.. code-block:: bash
::
poetry add --group test unittest
poetry add --group test pytest
poetry add --group test mypy
unittest
pytest
mypy - type check
All the test scripts should start with ``test_``. For example, run the individual test for ``components`` with:

Expand Down
9 changes: 9 additions & 0 deletions docs/source/contributor/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ Contribution Process
You are always welcomed to contribute even if you've never participated in open source project before.
Here is the basic contribution process:

Environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When contributing, please note:
LightRAG separates the source code environment and documentation environment.

* To activate the code environment, you should run ``poetry install`` and ``poetry shell`` under ``./lightrag``. The ``./lightrag/pyproject.toml`` contains the dependencies for the ``LightRAG`` package.

* To activate the documentation environment, you can run ``poetry install`` and ``poetry shell`` under ``.``. The ``./pyproject.toml`` controls documentation dependencies.

Find a direction to work on
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The team builds ``LightRAG`` based on latest researches and product cases. But you might have your own task to apply ``LightRAG``.
Expand Down

0 comments on commit 1911ee2

Please sign in to comment.