Hello (again - my previous account <@U03HW7Q1NAE> ...
# general
l
Hello (again - my previous account @quaint-forest-8735 is now defunct since I've switched jobs 😅 )! How can we specify a pypi repository when using
poetry_requirements
, when the same package exists on pypi? For example (snippet of
pyproject.toml
):
Copy code
[tool.poetry.dependencies]
...
fiftyone = {version = "~0.16.0", source = "fiftyone-teams"}
...

[[tool.poetry.source]]
name = "fiftyone-teams"
url = "<https://pypi.fiftyone.ai/simple/>"
priority = "explicit"
I've also added this to our `pants.toml`:
Copy code
[python-repos]
indexes = [
  "<https://pypi.fiftyone.ai/simple/>",
  "<https://pypi.org/simple/>"
]
In this setup,
fiftyone
(which also exists on pypi) is resolved from pypi in the lockfile, vs
<http://pypi.fiftyone.ai|pypi.fiftyone.ai>
It's definitely possible to switch back to
requirements.txt
/
python_requirements
where this can be specified explicitly, but curious if there's something I'm missing from the poetry requirements side Edit - Looks like this is an outstanding FR: https://github.com/pantsbuild/pants/issues/17565 I was able to unblock myself with the following (sub-optimal but works / is legible) - basically setting up a separate
python_requirement
for any deps we need to resolve privately outside of `pyproject.toml`:
Copy code
poetry_requirements(name = "root")

python_requirement(
  requirements=[
    "fiftyone@https://%(env.FIFTYONE_TOKEN)@pypi.fiftyone.ai/packages/fiftyone-<version>-py3-none-any.whl"
  ],
  tags = ["private-deps"],
)