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

[reflex export] backend.zip excludes dirs that look like venv dirs #2009

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

jackie-pc
Copy link
Contributor

@jackie-pc jackie-pc commented Oct 20, 2023

We leave frontend.zip alone, because by design we only zip up generated .web/. Chance of false positive vs. false negative would be higher there (for excluding something that shouldn't).

For backend.zip, we exclude venv looking files (detected by presence of pyvenv.cfg).

As a drive-by we also exclude *.db from backend.zip.

Copy link
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine from here

@@ -59,6 +59,8 @@ def _zip(
component_name: constants.ComponentName,
target: str,
root_dir: str,
exclude_venv_dirs: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add default values for these args?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Default values are usually for convenience:

  • We cannot (or don't want to) update existing call sites.
  • We think it's too burdensome to ask new call sites to be explicit.
    But the drawback is we lose (IMO) a lot of readability.

In this case the trade-off seems quite skewed toward not doing defaults. It's a private function that has two existing call sites.

@picklelo picklelo merged commit b3499e6 into main Oct 23, 2023
37 checks passed
@picklelo picklelo deleted the jackie-venv-detection branch November 1, 2023 19:10
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

Successfully merging this pull request may close these issues.

3 participants