rsconnect-python icon indicating copy to clipboard operation
rsconnect-python copied to clipboard

support following symlinks

Open edavidaja opened this issue 2 years ago • 1 comments

In my case, the app.py is a symlink to a file in the parent directory (long story, but there is a good reason for this). When rsconnect deploys an app, does it follow local symlinks so that the content is deployed to the server? The reason I have symlinks is because I have many apps in the same directory (named app_basic.py, app_recipes.py, etc.) and I want to deploy the apps individually, but I think rsconnect wants them to be named app.py. So I made a directory for each with symlinks from foo/app.py to the original file, like app_basic.py. Why are they all in the same directory? Because they share common submodules, like utils.py, chat/init.py, and so on.

When constructing the list of files to bundle we currently rely on os.path.isfile so symlinks are not followed.

edavidaja avatar Apr 25 '23 17:04 edavidaja

For the user's original problem, the --entrypoint argument can be used to deploy specific app files (--entrypoint app_basic:app).

We have another reason for wanting the bundler to follow symlinks, which is having a data/ directory that's a sibling to an app directory (so the app has to do ../data/foo.csv or whatever). If symlinks were followed, then the app directory could contain a symlink to ../data and have it bundled correctly.

jcheng5 avatar Feb 22 '24 19:02 jcheng5