Skip to content

Commit cdbb318

Browse files
authored
Improve sdist-building process (#675)
* Exclude wheelhouse dir from sdists So that we don't accidentally include a previously generated sdist when creating a new one (i.e., finufft after generating cufinufft and vice versa). * Fix sdist-building scripts Copy instead of move (makes script idempotent) and assume we're executing from the root of the repository, not its parent.
1 parent 29b260e commit cdbb318

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

python/cufinufft/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ sdist.exclude = [".*",
6666
"tutorial",
6767
"python/finufft",
6868
"python/cufinufft/tests",
69-
"src"]
69+
"src",
70+
"wheelhouse"]
7071
sdist.include = ["src/cuda"]
7172

7273
[tool.scikit-build.metadata.version]

python/finufft/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ sdist.exclude = [".*",
6666
"tutorial",
6767
"include/cufinufft*",
6868
"python/cufinufft",
69-
"src/cuda"]
69+
"src/cuda",
70+
"wheelhouse"]
7071

7172
[tool.scikit-build.metadata.version]
7273
# Instead of hardcoding the version here, extract it from the source files.

tools/cufinufft/build-sdist.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
set -e -x
44

55
# Move pyproject.toml to root (otherwise no way to include C++ sources in sdist).
6-
mv finufft/python/cufinufft/pyproject.toml finufft/
6+
cp python/cufinufft/pyproject.toml .
77

88
# Fix paths in pyproject.toml to reflect the new directory structure.
9-
toml set --toml-path finufft/pyproject.toml \
9+
toml set --toml-path pyproject.toml \
1010
tool.scikit-build.cmake.source-dir "."
11-
toml set --toml-path finufft/pyproject.toml \
11+
toml set --toml-path pyproject.toml \
1212
tool.scikit-build.wheel.packages --to-array "[\"python/cufinufft/cufinufft\"]"
13-
toml set --toml-path finufft/pyproject.toml \
13+
toml set --toml-path pyproject.toml \
1414
tool.scikit-build.metadata.version.input "python/cufinufft/cufinufft/__init__.py"
1515

1616
# Package the sdist.
17-
python3 -m build --verbose --sdist --outdir wheelhouse finufft
17+
python3 -m build --verbose --sdist --outdir wheelhouse .

tools/finufft/build-sdist.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
set -e -x
44

55
# Move pyproject.toml to root (otherwise no way to include C++ sources in sdist).
6-
mv finufft/python/finufft/pyproject.toml finufft/
6+
cp python/finufft/pyproject.toml .
77

88
# Fix paths in pyproject.toml to reflect the new directory structure.
9-
toml set --toml-path finufft/pyproject.toml \
9+
toml set --toml-path pyproject.toml \
1010
tool.scikit-build.cmake.source-dir "."
11-
toml set --toml-path finufft/pyproject.toml \
11+
toml set --toml-path pyproject.toml \
1212
tool.scikit-build.wheel.packages --to-array "[\"python/finufft/finufft\"]"
13-
toml set --toml-path finufft/pyproject.toml \
13+
toml set --toml-path pyproject.toml \
1414
tool.scikit-build.metadata.version.input "python/finufft/finufft/__init__.py"
1515

1616
# Package the sdist.
17-
python3 -m build --verbose --sdist --outdir wheelhouse finufft
17+
python3 -m build --verbose --sdist --outdir wheelhouse .

0 commit comments

Comments
 (0)