-
Notifications
You must be signed in to change notification settings - Fork 8
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
move most project metadata into pyproject.toml #126
Conversation
@@ -62,6 +62,9 @@ jobs: | |||
with: | |||
name: legateboost-wheel | |||
path: dist/legateboost*.whl | |||
- name: Install legateboost | |||
run: | | |||
python -m pip install --no-deps dist/*.whl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing build.sh
from ci/build_wheel.sh
ensures that here in CI, we're driving the entire CMake build via Python packaging tools (python -m build
, in this case). That ensures that the shared library is actually copied into the wheel, and that therefore the wheels could be installed on their own.
That's not the case today. Try downloading a recent wheel artifact, e.g. from https://github.com/rapidsai/legate-boost/actions/runs/10111717786
unzip legateboost-wheel.zip
unzip -l
liblegateboost.so
has not been getting packaged.
contents (click me)
Archive: legateboost-0.1-cp312-cp312-linux_x86_64.whl
Length Date Time Name
--------- ---------- ----- ----
604 07-26-2024 13:38 legateboost/__init__.py
5162 07-26-2024 13:38 legateboost/callbacks.py
2682 07-26-2024 13:38 legateboost/input_validation.py
1148 07-26-2024 13:38 legateboost/install_info.py
34517 07-26-2024 13:38 legateboost/legateboost.py
3156 07-26-2024 13:38 legateboost/library.py
10209 07-26-2024 13:38 legateboost/metrics.py
19391 07-26-2024 13:38 legateboost/objectives.py
4635 07-26-2024 13:38 legateboost/shapley.py
2943 07-26-2024 13:38 legateboost/special.py
12535 07-26-2024 13:38 legateboost/utils.py
124 07-26-2024 13:38 legateboost/models/__init__.py
2464 07-26-2024 13:38 legateboost/models/base_model.py
7397 07-26-2024 13:38 legateboost/models/krr.py
4122 07-26-2024 13:38 legateboost/models/linear.py
4882 07-26-2024 13:38 legateboost/models/nn.py
8768 07-26-2024 13:38 legateboost/models/tree.py
0 07-26-2024 13:38 legateboost/test/__init__.py
1848 07-26-2024 13:38 legateboost/test/test_callbacks.py
6744 07-26-2024 13:38 legateboost/test/test_estimator.py
1703 07-26-2024 13:38 legateboost/test/test_examples.py
7510 07-26-2024 13:38 legateboost/test/test_metric.py
3787 07-26-2024 13:38 legateboost/test/test_objective.py
3100 07-26-2024 13:38 legateboost/test/test_shapley.py
3895 07-26-2024 13:38 legateboost/test/test_special.py
1845 07-26-2024 13:38 legateboost/test/test_utils.py
7832 07-26-2024 13:38 legateboost/test/test_with_hypothesis.py
1335 07-26-2024 13:38 legateboost/test/utils.py
0 07-26-2024 13:38 legateboost/test/models/__init__.py
2720 07-26-2024 13:38 legateboost/test/models/test_krr.py
4028 07-26-2024 13:38 legateboost/test/models/test_linear.py
2925 07-26-2024 13:38 legateboost/test/models/test_nn.py
1420 07-26-2024 13:38 legateboost/test/models/test_tree.py
790 07-26-2024 13:38 legateboost/test/models/utils.py
3669 07-26-2024 13:38 legateboost-0.1.data/data/lib/cmake/legateboost_python/legateboost_python-config-version.cmake
5276 07-26-2024 13:38 legateboost-0.1.data/data/lib/cmake/legateboost_python/legateboost_python-config.cmake
1312 07-26-2024 13:38 legateboost-0.1.data/data/lib/cmake/legateboost_python/legateboost_python-dependencies.cmake
4182 07-26-2024 13:38 legateboost-0.1.data/data/lib/cmake/legateboost_python/legateboost_python-targets.cmake
10174 07-26-2024 13:38 legateboost-0.1.dist-info/LICENSE
1063 07-26-2024 13:38 legateboost-0.1.dist-info/METADATA
99 07-26-2024 13:38 legateboost-0.1.dist-info/WHEEL
12 07-26-2024 13:38 legateboost-0.1.dist-info/top_level.txt
3909 07-26-2024 13:38 legateboost-0.1.dist-info/RECORD
--------- -------
205917 43 files
Because of the use of build.sh
, this line was always hit during the build:
Line 17 in 157b427
find_package(legateboost QUIET) |
Which I think led to it not being recompiled in the _skbuild
directory, which I think is why it's not getitng included in wheels.
|
||
function hasArg { | ||
(( NUMARGS != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know some of this looks a little complicated, but it's all standard across most RAPIDS repos. You'll see something similar in raft
, cuml
, cudf
, etc.
example from raft
: https://github.com/rapidsai/raft/blob/branch-24.10/build.sh
I think consistency with all those projects is useful, as it makes it easier for anyone developing on them to also come help out here, and makes it easier to integrate the various RAPIDS build tools into this repo.
This build.sh
file will eventually be the one that drives the build for conda packages.
common: | ||
- output_types: [conda] | ||
packages: | ||
- python-build>=1.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this to its own conda-specific section, so it doesn't end up in the [build-system]
list of requirements. Something like pip install
/ pip wheel
looks in that list to determine what needs to be installed to build a wheel... if you're using pip install
/ pip wheel
to do that, then you don't need build
.
packages: | ||
- cunumeric=24.06.* | ||
- cunumeric==24.06.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip
doesn't recognized =
, just ==
. This change is necessary now that this entry is going to end up in pyproject.toml
too.
pyproject.toml
Outdated
] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Topic :: Database", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked into other items yet, but database seems weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised to see it here too, but wasn't confident enough in my understanding of this project to say that it was wrong. This list of classifiers was exactly copied from what's already in setup.py
:
Lines 70 to 79 in d4edf2d
classifiers=[ | |
"Intended Audience :: Developers", | |
"Topic :: Database", | |
"Topic :: Scientific/Engineering", | |
"License :: OSI Approved :: Apache Software License", | |
"Programming Language :: Python", | |
"Programming Language :: Python :: 3.8", | |
"Programming Language :: Python :: 3.9", | |
"Programming Language :: Python :: 3.10", | |
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Topic :: Database", |
Let's remove it.
Contributes to #115
Proposes moving most project metadata into
pyproject.toml
.Notes for Reviewers
I found this helpful while working on this: https://scikit-build.readthedocs.io/en/latest/usage.html
Benefits of these changes
rapids-dependency-file-generator
(and single-sourced fromdependencies.yaml
)Why can't we completely eliminate
setup.py
?I think it's possible and I'm planning to try it, just trying to do this in small-enough-to-thoughtfully-review chunks.
How I tested this
On a machine with CUDA 12.2 (R535 driver) and 8 V100s, I tried all the different installation and testing paths described in
README.md
andcontributing.md
.I also built a wheel like this
And manually inspected it like this:
(
pydistcheck
(link) is my little side-project for testing the contents of Python package distributions)