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

init when no requirements.txt exist we create one semi-silently #583

Closed
kgartland-rstudio opened this issue Dec 14, 2023 · 2 comments
Closed
Assignees

Comments

@kgartland-rstudio
Copy link
Collaborator

kgartland-rstudio commented Dec 14, 2023

Since we want customers to create their own requirements.txt file to avoid unnecessary deployment delays and bloat on their Connect server, we should proactively tell them when we're creating requirements files for them.

Currently we don't print anything about it when not in -v mode:

> publisher init ./
Created config file "/Users/kgartland/work/publishing-client/test/sample-content/fastapi-simple/.posit/publish/default.toml"

verbose mode:

> publisher init ./
time=2023-12-14T12:14:03.573-05:00 level=INFO msg="Client version" version=0.0.dev5-30-g15f64cd6
time=2023-12-14T12:14:03.573-05:00 level=INFO msg="Development mode" mode=dev
time=2023-12-14T12:14:03.573-05:00 level=INFO msg="Development build" DevelopmentBuild=true
time=2023-12-14T12:14:03.573-05:00 level=INFO msg="Detecting deployment type and entrypoint..."
time=2023-12-14T12:14:03.574-05:00 level=INFO msg="Deployment type" Entrypoint=app.py Type=python-shiny
time=2023-12-14T12:14:03.574-05:00 level=INFO msg="Running Python" python=/Users/kgartland/.pyenv/versions/3.9.15/bin/python
time=2023-12-14T12:14:03.598-05:00 level=INFO msg="Detected Python" version=3.9.15
time=2023-12-14T12:14:03.598-05:00 level=INFO msg="Running Python" python=/Users/kgartland/.pyenv/versions/3.9.15/bin/python
time=2023-12-14T12:14:03.598-05:00 level=INFO msg="Using Python packages" source="/Users/kgartland/.pyenv/versions/3.9.15/bin/python -m pip freeze"
time=2023-12-14T12:14:03.893-05:00 level=INFO msg="Wrote requirements file" path=/Users/kgartland/work/publishing-client/test/sample-content/fastapi-simple/requirements.txt
Created config file "/Users/kgartland/work/publishing-client/test/sample-content/fastapi-simple/.posit/publish/default.toml"

Suggestion:

In non-verbose mode we could tell the customer we're creating the requirements file for them:

> publisher init ./
A requirements.txt file was not found so we're creating one for you with `pip freeze`. Please review before publishing and omit any unnecessary packages or create your own manually.

Created requirements file "/Users/kgartland/work/publishing-client/test/sample-content/fastapi-simple/requirements.txt"
Created config file "/Users/kgartland/work/publishing-client/test/sample-content/fastapi-simple/.posit/publish/default.toml"

Additionally in rsconnect-python we print a comment in the requirements file so we know it was generated by us, which could be a helpful troubleshooting tool.

i.e.

# requirements.txt generated by rsconnect-python on 2023-12-14 17:04:15.470311
@mmarchetti
Copy link
Contributor

Also see posit-dev/rsconnect-python#538

@mmarchetti mmarchetti self-assigned this Feb 8, 2024
@mmarchetti
Copy link
Contributor

Fixed in #958

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

No branches or pull requests

2 participants