Skip to content

Commit 394fb50

Browse files
authored
fix: include docs and examples in the sdist tarball (#2289)
The sdists generated by setuptools included the `docs` and `examples` directories, and they are needed for building docs and running tests using the sdist. This change includes these directories in the sdist tarball. A `test:sdist` task is also added to `Taskfile.yml` which uses the sdists to run pytest and build docs.
1 parent 5635ed2 commit 394fb50

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Taskfile.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ tasks:
218218
- task: venv:clean
219219
- task: _rimraf
220220
vars: { RIMRAF_TARGET: ".var/devcontainer" }
221+
- task: _rimraf
222+
vars: { RIMRAF_TARGET: "var/test-sdist" }
221223

222224
test:data:fetch:
223225
desc: Fetch test data.
@@ -342,6 +344,21 @@ tasks:
342344
> "${plantuml_file%.*}.svg"
343345
done
344346
347+
test:sdist:
348+
desc: Run tests on the sdist artifact
349+
cmds:
350+
- task: _rimraf
351+
vars: { RIMRAF_TARGET: "dist" }
352+
- task: _rimraf
353+
vars: { RIMRAF_TARGET: "var/test-sdist" }
354+
- poetry build
355+
- python -c 'import tarfile, glob; tarfile.open(glob.glob("dist/*.tar.gz")[0]).extractall("var/test-sdist")'
356+
- |
357+
cd var/test-sdist/rdflib-*
358+
poetry install
359+
poetry run mypy --show-error-context --show-error-codes -p rdflib
360+
poetry run sphinx-build -T -W -b html -d docs/_build/doctree docs docs/_build/html
361+
poetry run pytest
345362
_rimraf:
346363
# This task is a utility task for recursively removing directories, it is
347364
# similar to rm -rf but not identical and it should work wherever there is

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ packages = [
2727
]
2828
include = [
2929
{ path = "test", format = "sdist" },
30+
{ path = "docs", format = "sdist" },
31+
{ path = "examples", format = "sdist" },
3032
]
3133

3234
[tool.poetry.scripts]

0 commit comments

Comments
 (0)