diff options
author | Iwan Aucamp <aucampia@gmail.com> | 2023-03-19 15:50:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 15:50:11 +0100 |
commit | 394fb50d73ddca7b4891e43ba0ad2172de0b107d (patch) | |
tree | 1b93b98daf3b8c42503c01a730373fb086138331 | |
parent | 5635ed295dcafb09de84f0ab04dcbb7f5b7e7c9b (diff) | |
download | rdflib-394fb50d73ddca7b4891e43ba0ad2172de0b107d.tar.gz |
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.
-rw-r--r-- | Taskfile.yml | 17 | ||||
-rw-r--r-- | pyproject.toml | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Taskfile.yml b/Taskfile.yml index ec50b23b..feb7624c 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -218,6 +218,8 @@ tasks: - task: venv:clean - task: _rimraf vars: { RIMRAF_TARGET: ".var/devcontainer" } + - task: _rimraf + vars: { RIMRAF_TARGET: "var/test-sdist" } test:data:fetch: desc: Fetch test data. @@ -342,6 +344,21 @@ tasks: > "${plantuml_file%.*}.svg" done + test:sdist: + desc: Run tests on the sdist artifact + cmds: + - task: _rimraf + vars: { RIMRAF_TARGET: "dist" } + - task: _rimraf + vars: { RIMRAF_TARGET: "var/test-sdist" } + - poetry build + - python -c 'import tarfile, glob; tarfile.open(glob.glob("dist/*.tar.gz")[0]).extractall("var/test-sdist")' + - | + cd var/test-sdist/rdflib-* + poetry install + poetry run mypy --show-error-context --show-error-codes -p rdflib + poetry run sphinx-build -T -W -b html -d docs/_build/doctree docs docs/_build/html + poetry run pytest _rimraf: # This task is a utility task for recursively removing directories, it is # similar to rm -rf but not identical and it should work wherever there is diff --git a/pyproject.toml b/pyproject.toml index aa53bdac..47bfa094 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,8 @@ packages = [ ] include = [ { path = "test", format = "sdist" }, + { path = "docs", format = "sdist" }, + { path = "examples", format = "sdist" }, ] [tool.poetry.scripts] |