Hey everyone, Is it possible to set a different p...
# troubleshooting
s
Hey everyone, Is it possible to set a different pip url for plugins between environments? I'm trying to include credentials in a private tap by specifying them in the url, but am facing issues when trying to edit the pip url. Another option would be using a .netrc file, but that creates problems when working locally
u
I know @Will Da Silva (Arch) demoed a feature showing how to do this, but I'm blanking on the exact way. But I would suppose it was using environment variables. Have you tried that?
w
That was for using env vars within a `pip_url`: https://docs.meltano.com/guide/configuration#environment-variable-expansion-within-pip_url You should be able to use credentials within the
pip_url
by using env vars. Alternatively
pip
will source some specific env vars for private index credentials, but I don't remember what those are off the top of my head.
s
Ouh I'll look into that, thank you!
@Will Da Silva (Arch) would you know when this feature would have been included? We are currently running on an older version of meltano 2.5, and I can't seem to be able to include env variable in the pip url - could this be the cause?
u
It was added by https://github.com/meltano/meltano/pull/7019, which was released as part of Meltano v2.11.0
u
Per https://pip.pypa.io/en/stable/topics/configuration/#environment-variables, you should be able to use
$PIP_INDEX_URL
with the username and password (or token) provided within the index URL. This can be done without changing
pip_url
.
s
As in I should be able to do this even on 2.5?
That would be absolutely glorious
u
Yup, since we're just calling
pip
under the hood, and pip's options can be configured via env vars as
$PIP_<option name>
s
As one giant pip url correct?
u
It would be within the
env
section, rather than the
pip_url
. The
pip_url
would only have the package name, and the pip index URL (with credentials) would be specified via env var.
s
Like this?
Copy code
pip_url: git+<https://github.com/stephane/tap-stephane-app.git>
    env:
      PIP_INDEX_URL: git+https://<username>:<password>@github.com/stephane/tap-stephane-app.git
u
Ah, my mistake. I thought you were using a private package index, rather than a private repository
s
No, sadly it is a private repository
u
@edgar_ramirez_mondragon might know better than I what env vars need to be set for that. I'll think more about that and let you know if I come up with anything
s
That would be amazing, thank you so much @Will Da Silva (Arch) @edgar_ramirez_mondragon 😄
u
You could configure your credentials in `.netrc`:
Copy code
echo "machine <http://github.com|github.com> login ... password ..." > ~/.netrc
https://stackoverflow.com/a/39519547/5535114
s
That's our next best idea, just having issues with applying it in docker, but thanks!
Best solution would be upgrading meltano versions 😆