Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-package] Workflow to install locally and make contributions #6777

Closed
jackattackyang opened this issue Jan 7, 2025 · 1 comment
Closed

Comments

@jackattackyang
Copy link

Hi, I would like to contribute to #4996 but I can't find good sources on what is the best workflow to install and work on the python package

My steps have been the following:

  • Fork and clone the repo
  • Create new dev folder and activate venv
  • Install python-package using ./build-python.sh install
├── LightGBM/                    
│   ├── python-package/    
│   └── build-python.sh  
│
└── lightgbm-dev/      
    ├── venv/           
    ├── tests/               
    ├── notebooks/          
    └── requirements.txt    

Referring to comments here that editable installs are not supported, does that mean running ./build-python.sh install every time changes are made to the original python-package? Is there a better way?

@jameslamb
Copy link
Collaborator

Thanks for using LightGBM, and taking the time to contribute!

Yes, as of now editable installs are not exactly supported (not with e.g. pip install -e). If you are developing changes that only change Python code, build the C++ library:

# build the C++ library one time
rm -rf ./build
cmake -B build -S .
cmake --build build --target _lightgbm -j4

Then every time you change the Python code, re-install the library using the --precompile flag.

sh build-python.sh install --precompile

That'll be much faster than just build.python.sh install, because it won't re-compile the shared library.


I know we need better documentation on getting started here. In the absence of that, please feel free to keep posting questions here!

But I'm going to close this specific issue... to avoid fragmenting the conversation, can you please ask additional questions on this existing discussion thread about the same topic?

#6350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants