posit-dev / publisher

MIT License
3 stars 0 forks source link

Add subdirectory support to package scanning APIs #1919

Closed mmarchetti closed 4 days ago

mmarchetti commented 4 days ago

Intent

This PR adds the dir parameter to the package scanning APIs: POST /api/packages/r/scan and POST /api/packages/python/scan.

Part of #1851

Type of Change

Automated Tests

Added unit tests for the new parameter.

Directions for Reviewers

$(just executable-path) ui -vv --listen=localhost:9001 &
curl -s localhost:9001/api/packages/python/scan?dir=test/sample-content/rmd-static-1 -XPOST
curl -s localhost:9001/api/packages/r/scan?dir=test/sample-content/rmd-static-1 -XPOST

etc.

requirements.txt/renv.lock should be created in the specified subdirectory, and only contain package dependencies discoverable from the code in that subdirectory.