Skip to content

Commit

Permalink
ensure dask_cuda.__git_commit__ is populated (#1453)
Browse files Browse the repository at this point in the history
Installing `dask-cuda` like this:

```shell
pip install \
  --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ \
  'dask-cuda==25.4.*,>=0.0.0a0'
```

The `__git_commit__` attribute on the main module isn't populated:

```shell
python -c "import dask_cuda; print(dask_cuda.__git_commit__)"
```

The way this *should* work is that `rapids-build-backend` writes a file `dask_cuda/GIT_COMMIT` which is then read by this code: 

https://github.com/rapidsai/dask-cuda/blob/412ef5891f1cca78af48c076e0922874c227b34b/dask_cuda/_version.py#L20-L28

I think that what's happening here is this:

* `rapids-build-backend` *is* writing that file
* the file is not being packaged, because this project uses `setuptools` + a `MANIFEST.in`, and that `MANIFEST.in` does not include that file

This proposes the following:

* add `GIT_COMMIT` to `MANIFEST.in`
* update RAPIDS-specific pre-commit hooks to their latest versions (not related, but might as well, while we're using a CI run anyway)

## Notes for Reviewers

Helpful reference for this... "Controlling files in the distribution" from the `setuptools` docs: https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Mike Sarahan (https://github.com/msarahan)
  - Bradley Dice (https://github.com/bdice)

URL: #1453
  • Loading branch information
jameslamb authored Feb 21, 2025
1 parent 412ef58 commit 30777de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ repos:
args: ["--module=dask_cuda", "--ignore-missing-imports"]
pass_filenames: false
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.4.0
rev: v0.6.0
hooks:
- id: verify-alpha-spec
- id: verify-copyright
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.16.0
rev: v1.17.1
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include dask_cuda/GIT_COMMIT
include dask_cuda/_version.py
include dask_cuda/VERSION

0 comments on commit 30777de

Please sign in to comment.