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

Support using env vars in pip requirements.txt files (for GitHub PATs for private repositories) #262

Open
2 tasks done
samuel-poon opened this issue Feb 2, 2024 · 1 comment

Comments

@samuel-poon
Copy link

Required Terms

What service(s) is this request for?

No response

Tell us about what you're trying to solve. What challenges are you facing?

Heroku doesn't seem to support personal access tokens for private GitHub repositories in requirements.txt for Python. I tried setting my GitHub PAT as a config var but got hit with "fatal: could not read Password for 'https://${GITHUB_PAT}@github.com': No such device or address" in the build log.

In the docs, Heroku suggests using HTTP Basic Authentication through the user:password format. However, this method has been deprecated on GitHub since 2021.

Is there any reason why Heroku can't do this natively? Any help would be appreciated.

@edmorley
Copy link
Member

edmorley commented Nov 25, 2024

@samuel-poon Hi! Sorry for the delayed reply. This looks to be related to the feature request here:
heroku/heroku-buildpack-python#1451

App config vars are not currently exposed to pip since some apps have broken env vars set that would cause pip to fail to run. I would like to see if we can change that in the future - however, it would require a careful rollout along with working out which env vars we need to filter out etc.

As an alternative in the meantime, I would recommend using the heroku-buildpack-github-netrc buildpack to set credentials - see:
heroku/heroku-buildpack-python#1451 (comment)

@edmorley edmorley changed the title Support GitHub PATs for private repositories Support using env vars in pip requirements.txt files (for GitHub PATs for private repositories) Nov 25, 2024
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

3 participants