Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit impact of R & Python dependency detection to those content types for which it applies. #2583

Open
sagerb opened this issue Feb 6, 2025 · 0 comments

Comments

@sagerb
Copy link
Collaborator

sagerb commented Feb 6, 2025

Our behavior in a multi-type project directory (in which all of the publisher's project files exist in a single subdirectory hiearchy) can lead to some incorrect dependency detection.

The example here is a combination of a python and static-html project. The inspection done for the static-html file, will detect an inaccurate dependency on python, if the developer has created a requirements.txt file in that subdirectory. It would likewise also incorrectly detect an R dependency if a file named renv.lock was present.

Currently, the inspect functionality does content specific dependency detection, and then falls through a generic check for these two dependency files, adding an R or a Python dependency if they are found. This occurs for all content types, which is incorrect.

To fix this, we need to limit this generic check to only apply to a subset of content types, where R or Python dependencies make sense.


Analysis of issue reported from Tareef:

I had a chance to talk with Tareef and have him show me how he got into the state he did. I now understand it to be a bit different than what was discussed before:

  • He was using a single subdirectory with multiple types of projects within it, similar (but different) to our mixed content test case. Within this subdirectory, he had both a Python project and a Quarto project, which he used to output a single HTML page.
  • He selected to deploy from his generated HTML file.
  • Our inspection correctly created a deployment w/ content type of html, but incorrectly identified an implicit dependency on Python because his multi-type project subdirectory contained a requirements.txt from his python api app.
    Deploying the project ran into issues during the deployment process w/ Connect. I’m not sure what happened there, but I’m pretty confident it can be reproduced.

I believe the workaround for him is to remove the [python] section from the config file, which will remove the Python dependency and redeploy the project to Connect. (He didn’t get a chance to try this because he wants to actually publish the project as a Quarto project, which would be re-run on a schedule. I’ll update the issue as I try to reproduce it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant