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

Replace setup.py with pyproject.toml #9021

Merged
merged 61 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
18dfb02
Initial setup of pyproject.toml
hcho3 Apr 11, 2023
2469e98
Fix path in sdist
hcho3 Apr 11, 2023
7037c80
Full support for sdist
hcho3 Apr 11, 2023
662ab40
Remove setup.py
hcho3 Apr 11, 2023
b3490db
Fix
hcho3 Apr 11, 2023
bae6d9b
Use hatchling backend to reduce boilerplate
hcho3 Apr 13, 2023
e3585ff
Use proper logger
hcho3 Apr 13, 2023
0018b66
Don't include hatch_build.py in sdist
hcho3 Apr 13, 2023
95ad176
Rename to make it less verbose
hcho3 Apr 13, 2023
359f1e4
Support 'pip install .'
hcho3 Apr 14, 2023
a08ed15
Update build-time requirements
hcho3 Apr 14, 2023
8505ea9
Support editable installation
hcho3 Apr 14, 2023
ca05770
Fix lint
hcho3 Apr 14, 2023
9997b7b
Add type annotation
hcho3 Apr 14, 2023
9dab333
Fix type annotation
hcho3 Apr 14, 2023
7c06956
More fix
hcho3 Apr 14, 2023
823f8f1
Fix formatting
hcho3 Apr 14, 2023
d2e5a65
Support CMake args
hcho3 Apr 14, 2023
c5460be
More formatting fix
hcho3 Apr 14, 2023
9b11778
Add URL for build doc
hcho3 Apr 14, 2023
9260613
Install hatchling when linting
hcho3 Apr 14, 2023
d7799c8
Remove setup.py sdist from CI
hcho3 Apr 14, 2023
2c73f75
Support building libxgboost in Windows
hcho3 Apr 14, 2023
10482b9
Remove all uses of setup.py from CI
hcho3 Apr 14, 2023
da2e8bb
Support Apple Silicon + cibuildwheel
hcho3 Apr 14, 2023
3eec9f7
Fallback if OpenMP isn't available
hcho3 Apr 14, 2023
7ee3ff8
Check libxgboost if editable
hcho3 Apr 14, 2023
63d88dc
On Conda, it's python-build
hcho3 Apr 14, 2023
cea6899
Update change_version.py script to update pyproject.toml
hcho3 Apr 14, 2023
9d002fc
Remove setup.py from dev script
hcho3 Apr 14, 2023
c0b4999
Update docs
hcho3 Apr 14, 2023
3bf0357
Integrate insert_vcomp140 into build backend
hcho3 Apr 14, 2023
702e4ea
Ensure that vcomp140.dll exists
hcho3 Apr 14, 2023
25856c1
Add optional flag bundle_vcomp140_dll
hcho3 Apr 14, 2023
58b2dc2
Better doc
hcho3 Apr 14, 2023
a38d26c
Add doc for Python packaging
hcho3 Apr 14, 2023
e3d4cf1
Fix mypy check
hcho3 Apr 14, 2023
37aeac8
Clean up build instructions
hcho3 Apr 14, 2023
886802a
Fix pip wheel
hcho3 Apr 14, 2023
8ffcc20
Upgrade to Pip 23+ on Windows
hcho3 Apr 14, 2023
5d58da0
Add Pip version requirement in doc
hcho3 Apr 14, 2023
d15d623
Filter bundle_vcomp140_dll from CMake args
hcho3 Apr 14, 2023
d2fd761
Update build-win64-gpu.ps1
hcho3 Apr 14, 2023
9f43ad7
Update build-win64-gpu.ps1
hcho3 Apr 14, 2023
bca703a
Last fix
hcho3 Apr 15, 2023
31cec82
Don't bundle vcomp140.dll
hcho3 Apr 15, 2023
3374512
Document that redist is required
hcho3 Apr 15, 2023
3d5c126
Update install.rst
hcho3 Apr 15, 2023
7d5e422
Remove unused import
hcho3 Apr 15, 2023
ae7c03c
Document that pip 21.3+ is required
hcho3 Apr 15, 2023
65ac71f
Use Pip 21.3+
hcho3 Apr 15, 2023
346472f
Simplify lint_python.py
hcho3 Apr 15, 2023
143d7ef
Revise python_packaging.rst
hcho3 Apr 19, 2023
73e3c77
Address reviewer's comment
hcho3 Apr 19, 2023
953c9bd
Insert missing 'the'
hcho3 Apr 19, 2023
fd7f1eb
Fix typo
hcho3 Apr 19, 2023
889b60c
Fix formatting
hcho3 Apr 19, 2023
c62e2d0
Fix build
hcho3 Apr 19, 2023
dbd9590
Fix formatting
hcho3 Apr 19, 2023
77df443
Fix formatting
hcho3 Apr 19, 2023
a85657b
Address reviewer's feedback
hcho3 Apr 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ option(USE_NVTX "Build with cuda profiling annotations. Developers only." OFF)
set(NVTX_HEADER_DIR "" CACHE PATH "Path to the stand-alone nvtx header")
option(RABIT_MOCK "Build rabit with mock" OFF)
option(HIDE_CXX_SYMBOLS "Build shared library and hide all C++ symbols" OFF)
option(KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR "Output build artifacts in CMake binary dir" OFF)
## CUDA
option(USE_CUDA "Build with GPU acceleration" OFF)
option(USE_NCCL "Build with NCCL to enable distributed GPU support." OFF)
Expand Down Expand Up @@ -268,8 +269,13 @@ if (JVM_BINDINGS)
xgboost_target_defs(xgboost4j)
endif (JVM_BINDINGS)

set_output_directory(runxgboost ${xgboost_SOURCE_DIR})
set_output_directory(xgboost ${xgboost_SOURCE_DIR}/lib)
if (KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
set_output_directory(runxgboost ${xgboost_BINARY_DIR})
set_output_directory(xgboost ${xgboost_BINARY_DIR}/lib)
else ()
set_output_directory(runxgboost ${xgboost_SOURCE_DIR})
set_output_directory(xgboost ${xgboost_SOURCE_DIR}/lib)
hcho3 marked this conversation as resolved.
Show resolved Hide resolved
endif ()
# Ensure these two targets do not build simultaneously, as they produce outputs with conflicting names
add_dependencies(xgboost runxgboost)

Expand Down
38 changes: 38 additions & 0 deletions python-package/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[build-system]
requires = ["packaging"]
backend-path = ["xgboost"]
build-backend = "packager.pep517"

[project]
name = "xgboost"
version = "2.0.0-dev0"
authors = [
{name = "Hyunsu Cho", email = "[email protected]"},
{name = "Jiaming Yuan", email = "[email protected]"}
]
description = "XGBoost Python Package"
readme = {file = "README.rst", content-type = "text/x-rst"}
requires-python = ">=3.8"
license = {text = "Apache-2.0"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
]
dependencies = [
"numpy",
"scipy"
]

[project.optional-dependencies]
pandas = ["pandas"]
scikit-learn = ["scikit-learn"]
dask = ["dask", "pandas", "distributed"]
datatable = ["datatable"]
plotting = ["graphviz", "matplotlib"]
pyspark = ["pyspark", "scikit-learn", "cloudpickle"]
Loading