Release: 2026/09/19 13:02 Reading: 0
Original author:vlogommentary
Original source:https://www.youtube.com/embed/UuZF1defVL4
Learn how to configure a GitHub Personal Access Token (PAT) with Poetry to access private GitHub repositories as dependencies during install. --- This video is based on the question https://stackoverflow.com/q/79283417/ asked by the user 'Sean' ( https://stackoverflow.com/u/7766024/ ) and on the answer https://stackoverflow.com/a/79283648/ provided by the user 'Sean' ( https://stackoverflow.com/u/7766024/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: How to use a GitHub PAT with Poetry? Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/licensing The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license. If anything seems off to you, please feel free to drop me a comment under this video. --- Accessing Private GitHub Repositories in Poetry with a Personal Access Token (PAT) When managing Python projects with Poetry, you might need to include private GitHub repositories as dependencies. However, poetry install often fails when trying to authenticate over HTTPS without proper credentials. The Problem Poetry uses Git under the hood to fetch dependencies. It does not trigger interactive username-password prompts for authentication. Setting a GITHUB_TOKEN environment variable or relying solely on Git Credential Manager often doesn't work seamlessly. This leads to failures when installing dependencies from private repositories. The Solution: Using Git Credential Store with a PAT Configure Git to store credentials globally: [[See Video to Reveal this Text or Code Snippet]] This instructs Git to save your credentials permanently after you enter them once. Trigger an authentication prompt manually: Perform a dummy clone or fetch operation from the private repository URL: [[See Video to Reveal this Text or Code Snippet]] When prompted, enter: Username: your GitHub username Password: your Personal Access Token (PAT) How this helps Poetry: Since Git now has your credentials stored locally, when Poetry invokes Git to fetch dependencies, it will use these saved credentials silently without needing new prompts. Additional Tips Generate a PAT with appropriate scopes: Make sure your token has at least repo scope for private repositories. Avoid hardcoding your token in URLs: Instead, rely on Git credential storage for security. Use poetry config for private repos: Poetry supports authenticating private repositories via poetry config http-basic if you prefer that method. Summary Because Poetry leverages Git but doesn't handle interactive authentication, setting up Git credential storage manually with your GitHub username and PAT enables seamless fetching of private repos during poetry install. This approach is simple, secure, and effective without modifying your project or compromising token security. Happy coding with Poetry and private GitHub dependencies!
KarmaStrike Drama
2026-09-20 22:00
WCW
2026-09-20 22:00
Velvet AI Drama
2026-09-20 22:00
Apocalypse Rewind Comics
2026-09-20 22:00
Théâtre romantique français
2026-09-20 21:57
Godfather Revenge
2026-09-20 21:37
The Cake Corner
2026-09-20 21:37
venicejunkie
2026-09-20 21:15
Coin Bureau
2026-09-20 21:15
Select Currency
US Dollar
USD
Chinese Yuan
CNY
Japanese Yen
JPY
South Korean Won
KRW
New Taiwan Dollar
TWD
Canadian Dollar
CAD
Euro
EUR
Pound Sterling
GBP
Danish Krone
DKK
Hong Kong Dollar
HKD
Australian Dollar
AUD
Brazilian Real
BRL
Swiss Franc
CHF
Chilean Peso
CLP
Czech Koruna KČ
CZK
Singapore Dollar
SGD
Indian Rupee
INR
Saudi Riyal
SAR
Vietnamese Dong
VND
Thai Baht
THB
Select Currency
US Dollar
USD-$
Chinese Yuan
CNY-¥
Japanese Yen
JPY-¥
South Korean Won
KRW -₩
New Taiwan Dollar
TWD-NT$
Canadian Dollar
CAD-$
Euro
EUR - €
Pound Sterling
GBP-£
Danish Krone
DKK-KR
Hong Kong Dollar
HKD- $
Australian Dollar
AUD-$
Brazilian Real
BRL -R$
Swiss Franc
CHF -FR
Chilean Peso
CLP-$
Czech Koruna KČ
CZK -KČ
Singapore Dollar
SGD-S$
Indian Rupee
INR -₹
Saudi Riyal
SAR -SAR
Vietnamese Dong
VND-₫
Thai Baht
THB -฿