Skip to content

[python-package] remove setup.cfg - #6624

Merged
StrikerRUS merged 1 commit into
masterfrom
install-prefix
Aug 27, 2024
Merged

StrikerRUS merged 1 commit into
masterfrom
install-prefix

Conversation

@jameslamb

@jameslamb jameslamb commented Aug 27, 2024 •

Copy link
Copy Markdown
Member

I don't think python-package/setup.cfg serves any purpose in this project any more. This proposes removing it it.

Notes for Reviewers

How I tested this

The configuration in setup.cfg doesn't affect scikit-build-core based builds (see docs here), so I just tested the --precompile option where a setuptools build backend is substituted in:

https://github.com/microsoft/LightGBM/blob/a9df7f113f7e603ed06dcc04baf2bc55f28ba090/build-python.sh#L308-L316

cmake -B build -S .
cmake --build build --target _lightgbm -j4
sh build-python.sh install --precompile

Saw the unit tests pass

pytest tests/python_package_test

And the package contained the expected files:

tar -tf ./dist/*.tar.gz
list of files (click me)
lightgbm-4.5.0.99/
lightgbm-4.5.0.99/LICENSE
lightgbm-4.5.0.99/MANIFEST.in
lightgbm-4.5.0.99/PKG-INFO
lightgbm-4.5.0.99/README.rst
lightgbm-4.5.0.99/lightgbm/
lightgbm-4.5.0.99/lightgbm/__init__.py
lightgbm-4.5.0.99/lightgbm/basic.py
lightgbm-4.5.0.99/lightgbm/callback.py
lightgbm-4.5.0.99/lightgbm/compat.py
lightgbm-4.5.0.99/lightgbm/dask.py
lightgbm-4.5.0.99/lightgbm/engine.py
lightgbm-4.5.0.99/lightgbm/lib/
lightgbm-4.5.0.99/lightgbm/lib/lib_lightgbm.dylib
lightgbm-4.5.0.99/lightgbm/libpath.py
lightgbm-4.5.0.99/lightgbm/plotting.py
lightgbm-4.5.0.99/lightgbm/py.typed
lightgbm-4.5.0.99/lightgbm/sklearn.py
lightgbm-4.5.0.99/lightgbm.egg-info/
lightgbm-4.5.0.99/lightgbm.egg-info/PKG-INFO
lightgbm-4.5.0.99/lightgbm.egg-info/SOURCES.txt
lightgbm-4.5.0.99/lightgbm.egg-info/dependency_links.txt
lightgbm-4.5.0.99/lightgbm.egg-info/requires.txt
lightgbm-4.5.0.99/lightgbm.egg-info/top_level.txt
lightgbm-4.5.0.99/pyproject.toml
lightgbm-4.5.0.99/setup.cfg

@jameslamb
jameslamb marked this pull request as ready for review August 27, 2024 06:04
@jameslamb jameslamb changed the title WIP: [python-package] remove setup.cfg [python-package] remove setup.cfg Aug 27, 2024

@StrikerRUS StrikerRUS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Love such types of PRs! πŸ˜„

Just out of curiosity, did you checked the content of generated setup.cfg?

list of files (click me)
...
lightgbm-4.5.0.99/setup.cfg

@StrikerRUS
StrikerRUS merged commit fde0157 into master Aug 27, 2024
@StrikerRUS
StrikerRUS deleted the install-prefix branch August 27, 2024 08:54
@jameslamb

Copy link
Copy Markdown
Member Author

Just out of curiosity, did you checked the content of generated setup.cfg?

Wow I hadn't even noticed that! Ha ok I was curious, so I checked.

cmake -B build -S .
cmake --build build --target _lightgbm -j4
sh build-python.sh install --precompile

cd ./dist
tar -xvzf *.tar.gz
lightgbm-4.5.0.99/setup.cfg

It just contains this:

[egg_info]
tag_build = 
tag_date = 0

Looks like that comes from somewhere around here in setuptools: https://github.com/pypa/setuptools/blob/738dd480ed123161b34a9ee648a61841f7e9e0ad/setuptools/command/egg_info.py#L208

@StrikerRUS

Copy link
Copy Markdown
Collaborator

Thanks for checking this! Now we know the normal standard behaviour for setup.cfg.

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants