Skip to content

Conversation

@nickhudkins
Copy link
Contributor

@nickhudkins nickhudkins commented Nov 27, 2025

Added warning about potential authorization issues with Poetry and .netrc file.

I didn't even have this issue, but I sat next to someone who did, for many hours, and it was painful to say the least. Finding that there is an outstanding issue with people suggesting a change to the documentation but then not proposing that change, I figured I'd go ahead and.... do the thing.

Pull Request Check List

Doesn't resolve but until it is, may as well let folks know:
#8443

  • Added tests for changed code.
  • Updated documentation for changed code.

Summary by Sourcery

Documentation:

  • Add a warning about ~/.netrc potentially conflicting with Poetry's configured repository authentication and causing authorization failures.

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 27, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Documents a known issue where a ~/.netrc file can override Poetry’s configured HTTP basic auth credentials and adds a prominent warning to the repositories configuration docs to help users debug authorization failures.

Flow diagram for debugging Poetry authorization failures due to .netrc

flowchart TD
  A[Configure http-basic credentials with poetry config] --> B[Run poetry install or update]
  B --> C{Authorization succeeds?}
  C -->|Yes| D[Continue normal workflow]
  C -->|No| E[Check for presence of ~/.netrc]
  E --> F{Does ~/.netrc exist?}
  F -->|No| G[Investigate other causes of auth failure]
  F -->|Yes| H[Inspect ~/.netrc for entries related to the repository host]
  H --> I{Conflicting credentials found?}
  I -->|No| G
  I -->|Yes| J[Modify or remove conflicting ~/.netrc entries]
  J --> K[Retry poetry command]
  K --> C
Loading

File-Level Changes

Change Details Files
Add a prominent warning in the repositories documentation about ~/.netrc potentially conflicting with Poetry’s configured authentication and causing authorization failures.
  • Insert a Hugo-style warning block immediately after the example of configuring http-basic credentials for a repository.
  • Explain that users experiencing authorization failures should check for the presence of a ~/.netrc file, which can override Poetry’s configured credentials.
  • Place the new warning before the existing warning about credentials appearing in command line history to ensure visibility during credential setup.
docs/repositories.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The warning text and dragon emoji are quite informal compared to the rest of the docs; consider rephrasing to a neutral, descriptive style that matches the existing documentation tone.
  • It might help users if the warning briefly explains how ~/.netrc conflicts with Poetry authentication (e.g., precedence/override behavior) rather than just saying it is “known to conflict.”
  • Clarify whether the ~/.netrc interaction applies to all repository types and authentication methods described on this page, or only certain configurations, so users know when this warning is relevant.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The warning text and dragon emoji are quite informal compared to the rest of the docs; consider rephrasing to a neutral, descriptive style that matches the existing documentation tone.
- It might help users if the warning briefly explains *how* `~/.netrc` conflicts with Poetry authentication (e.g., precedence/override behavior) rather than just saying it is “known to conflict.”
- Clarify whether the `~/.netrc` interaction applies to all repository types and authentication methods described on this page, or only certain configurations, so users know when this warning is relevant.

## Individual Comments

### Comment 1
<location> `docs/repositories.md:44-47` </location>
<code_context>
 ```
+{{% warning %}}
+🐉 HERE LIE DRAGONS 🐉
+If you have completed configuring credentials and are receiving authorization failures, check for the presence of `~/.netrc` which has been known to conflict with poetry's configured authentication.
+{{% /warning %}}

</code_context>

<issue_to_address>
**nitpick (typo):** Consider adding a comma before "which" and capitalizing "Poetry" for consistency.

For example: `...check for the presence of `~/.netrc`, which has been known to conflict with Poetry's configured authentication.`

```suggestion
{{% warning %}}
🐉 HERE LIE DRAGONS 🐉
If you have completed configuring credentials and are receiving authorization failures, check for the presence of `~/.netrc`, which has been known to conflict with Poetry's configured authentication.
{{% /warning %}}
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nickhudkins
Copy link
Contributor Author

nickhudkins commented Nov 27, 2025

Ain't no clanker making docs suggestions to me!

(Written by Claude 🤖)

— proof.

Copy link

@ajchili ajchili left a comment

Choose a reason for hiding this comment

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

I am the someone. While we did not immediately reference docs, having this be explicitly called out will help others.

nickhudkins and others added 2 commits November 30, 2025 15:00
Added warning about potential authorization issues with Poetry and .netrc file.
tbh, good suggestion sourcery-ai.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@radoering radoering added the impact/docs Contains or requires documentation changes label Nov 30, 2025
@github-actions
Copy link

github-actions bot commented Nov 30, 2025

Deploy preview for website ready!

✅ Preview
https://website-2zb60kmej-python-poetry.vercel.app

Built with commit 53ce62f.
This pull request is being automatically deployed with vercel-action

{{% warning %}} should be sufficient.
@radoering radoering changed the title Add warnings for Poetry credential configuration Add warning about ~/.netrc for Poetry credential configuration Nov 30, 2025
@radoering radoering merged commit e7ca74b into python-poetry:main Nov 30, 2025
64 checks passed
@adam-huganir
Copy link

lol @nickhudkins i just spent a day fighting this issue

@nickhudkins
Copy link
Contributor Author

HOLD THE HECK ON RIGHT NOW MISTER HUGANIR! How have you been?! Let's move this to a social networking platform, like phones or something. If I recall properly, we were nearly number neighbors,

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

Labels

impact/docs Contains or requires documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants