Skip to content

Commit

Permalink
add development setup guide (#29)
Browse files Browse the repository at this point in the history
* add dev setup guide

* add inline comment
  • Loading branch information
chjinche authored Nov 24, 2023
1 parent a3f15f9 commit 49fa0d1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
69 changes: 69 additions & 0 deletions docs/Development-Setup-Guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Development Setup Guide for LightGBM Transform
==========================================

This guide provides instructions for setting up the development environment for LightGBM Transform on a Linux machine.

Prerequisites
-------------

* Linux operating system
* Internet connection for downloading necessary files

Setup Steps
-----------

1. **Install Docker**

- Install Docker on your Linux machine by following the `instructions <https://docs.docker.com/engine/installation/linux/ubuntulinux/>`_. Ensure Docker is properly installed and running.

2. **Pull Docker Image**

- Download the required Docker image using the command:
::
# Below image is generated by following `Installation-Guide.rst`
docker pull krystal1130/lightgbm_transform_dependencies:20211109.v1

3. **Clone the Repository**

- Clone the LightGBM Transform repository from GitHub:
::
git clone --recursive https://github.com/microsoft/lightgbm-transform.git

4. **Mount the Repository to Docker Container**

- Mount the cloned repository to the Docker container. Replace ``<path_to_repo>`` with your local repository path:
::
docker run -it -v <path_to_repo>:/lightgbm-transform krystal1130/lightgbm_transform_dependencies:20211109.v1

5. **Access the Docker Container**

- Navigate to the LightGBM Transform directory inside the Docker container:
::
cd /lightgbm-transform

6. **Package the LightGBM Transform Python Package**

- Compile the package and place it in the ``./compile/dist`` directory using:
::
sh ./scripts/publish_python_package.sh

7. **Test the Package**

- Install and test the package. Replace ``<version>`` with the actual version number:
::
pip install --force-reinstall ./compile/dist/lightgbm_transform-<version>-py3-none-any.whl
pip install pytest numpy scipy pandas scikit-learn
cd ./tests
pytest

8. **PyPI Package Publishing**

- To request the publishing of the package to PyPI, please create an issue on `GitHub <https://github.com/microsoft/lightgbm-transform/issues>`_. Ensure that you have completed and verified all the local setup steps as outlined above before proceeding with the request.

.. Note::
This guide assumes a basic understanding of Linux, Docker, and Git. For any issues, refer to the respective tool's documentation or community support.
4 changes: 2 additions & 2 deletions scripts/publish_python_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ cp ./scripts/setup.py ./compile/ && cp ./scripts/README.rst ./compile && cp VERS
# pack wheel package.
cd compile && python setup.py bdist_wheel --precompile && cd ../ || exit -1
# upload package to your pypi, use testpypi as an example.
twine upload --repository pypi compile/dist/* || exit -1
# twine upload --repository pypi compile/dist/* || exit -1
# revert changes.
rm -rf ${lgb_python_pkg_dir}/lightgbm/*.so build compile || exit -1
# rm -rf ${lgb_python_pkg_dir}/lightgbm/*.so build compile || exit -1

0 comments on commit 49fa0d1

Please sign in to comment.