Skip to content

docs: document virtualenv cache recovery - #11127

Open
nightcityblade wants to merge 2 commits into
python-poetry:mainfrom
nightcityblade:docs/issue-9644
Open

nightcityblade wants to merge 2 commits into
python-poetry:mainfrom
nightcityblade:docs/issue-9644

Conversation

@nightcityblade

Copy link
Copy Markdown

Pull Request Check List

Resolves: #9644

  • Added tests for changed code. N/A: documentation-only change.
  • Updated documentation for changed code.

Summary

  • Clarify that virtualenv keeps a separate app-data cache.
  • Document how to locate and safely reset corrupted seed data.

Validation

  • pre-commit run --files docs/configuration.md docs/faq.md
  • .venv/bin/python bin/website build --local /tmp/poetry-9644-nightcityblade-2 (run from python-poetry/website)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/faq.md" line_range="196" />
<code_context>
+`pip` in an app-data directory separate from [Poetry's cache]({{< relref "configuration#cache-directory" >}}).
+
+If environment creation fails because this data is corrupt, rerun the command with `-vvv` and find `app_data_dir` in
+the `virtualenv` output. After making sure that no Poetry or `virtualenv` processes are using the directory, delete it.
+`virtualenv` recreates the directory the next time Poetry creates an environment.
+
</code_context>
<issue_to_address>
**Concurrent deletion damages app-data**

When another Poetry or `virtualenv` process starts after the active-process check but before deletion finishes, `EnvManager.build_venv` and `virtualenv` read or write files while the directory is being removed, so environment creation fails or leaves app-data incomplete.

Ensure no Poetry or `virtualenv` process can use the directory from the start of deletion until it finishes.

Also at `docs/faq.md:195`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: docs/faq.md:196


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/faq.md Resolved

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

This branch has not been deployed

No deployments
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.

currupted version of pip/setuptools/virtualenv in cache

1 participant