OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Using poetry to install from a private repository with a token

  • Thread starter Thread starter aweeb
  • Start date Start date
A

aweeb

Guest
I have published a package on packagecloud with a token. To install this package, this URL will be used:

  • https://{some-token}:@packagecloud.io/{some-domain}.

How do I configure poetry to download from this URL on top of the normal pypi url?

One solution that I have tried is to set the pyproject.toml manually like this:

Code:
[[tool.poetry.source]]
name = "internal-package"
url = "https://{**some-token**}:@packagecloud.io/{some-domain}"
priority = "supplemental"

This works but is a bad practice since I am exposing the token in the .toml file. Ideally I want to use a bash script that will do the following:

  • read the token from .env file
  • instruct poetry to look from the url

Thanks.
<p>I have published a package on packagecloud with a token. To install this package, this URL will be used:</p>
<ul>
<li>https://{<strong>some-token</strong>}:@packagecloud.io/{some-domain}.</li>
</ul>
<p>How do I configure poetry to download from this URL on top of the normal pypi url?</p>
<p>One solution that I have tried is to set the pyproject.toml manually like this:</p>
<pre><code>[[tool.poetry.source]]
name = "internal-package"
url = "https://{**some-token**}:@packagecloud.io/{some-domain}"
priority = "supplemental"
</code></pre>
<p>This works but is a bad practice since I am exposing the token in the .toml file. Ideally I want to use a bash script that will do the following:</p>
<ul>
<li>read the token from .env file</li>
<li>instruct poetry to look from the url</li>
</ul>
<p>Thanks.</p>
 

Latest posts

Online statistics

Members online
0
Guests online
2
Total visitors
2
Top