Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a library from codeartifact with poetry without moving all libraries to be installed from there

My situation I have a specific library in codeartifact.

I have a project (not a library) managing dependencies with poetry consuming this library.

Now I need to install this library in the project but can't find instructions which

  1. Don't change the actual pypi index url for all projects in my computer
  2. Being able to install the specific library from codeartifact without it being proxy for pypi for ALL libraries

Any ideas or clues on how to achieve this?

like image 475
alonisser Avatar asked Oct 20 '25 16:10

alonisser


1 Answers

In order to do that you need to add a source to your pyproject.toml and mark it as secondary:

[[tool.poetry.source]]
name = "my-repo"
url = "your-pypi-url"
secondary = true

And then point your library to this source.

With CLI:

poetry add my-library --source my-repo

Or directly in pyproject.toml

[tool.poetry.dependencies]
…
my-library = {version = "1.0.0", source = "my-repo"}
like image 172
Teivaz Avatar answered Oct 24 '25 19:10

Teivaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!