question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to download from Python repository hosted in Artifactory

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Mac OS X 10.14.6 , Mojave
  • Poetry version: 1.0.5
  • Link of a Gist with the contents of your pyproject.toml file: pyproject.toml

Issue

The legacy repositories have versions found in child pages

PYPI Repository:

Please take a look at the Flask package in PyPI repository https://pypi.org/simple/flask/

Package page contains href elements that point to .whl, tar.gz etc. <a href="https://files.pythonhosted.org/packages/d8/94/7350820/Flask-1.0.4-py2.py3-none-any.whl#sha256=1a21ccc" data-requires-python="&gt;=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*">Flask-1.0.4-py2.py3-none-any.whl</a>

Artifactory (Legacy) Repository

However the artifactory doesn’t follow the same convention as the PYPI repository. https://artifactory.repo.com/artifactory/my-repo/py-pkg

The package page simply have links to the child pages. The actual binaries are only found in the child pages.

Versions are provided by following pages

https://artifactory.repo.com/artifactory/my-repo/py-pkg/0.1.0 https://artifactory.repo.com/artifactory/my-repo/py-pkg/0.2.0

For legacy repositories, child pages must be read

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danieleadescommented, Aug 26, 2022

@mikeymop we’re not hardcoding the values, we’re using environment variables to set the auth

0reactions
mikeymopcommented, Sep 11, 2022

I can confirm that Poetry works with our artifactory pypi repository.

The only catch is that we can’t get it to work with the artifactory API token. We’ve only been able to get it to work with username/password, while twine works perfectly with the API token

Hello @danieleades sorry to necro post, but I have been hitting many dead ends with poetry + artifactory. I was wondering if you can expand a bit on what worked for you with poetry + artifactory.

Just recently I managed to get to work by hardcoding my http basic auth url into my pyproject.toml

eg:

[[tool.poetry.source]]
name = "artifactory"
url = "https://mikeymop:AbCd3Fgh1jK1Mn0@artifactory.example.com/artifactory/api/pypi/<python_repo_name>/simple/"
default = true
secondary = false

I noticed that using poetry config http-basic.artifactory like with the docs results in 404 errors when requesting a package. Are you hardcoding your basic auth into the source url? Curious because this would complicate ci.

EDIT:

It turns out my problem was that I didn’t realize the env var name depends on the name under the poetry source. So in this case HTTP_BASIC_ARTIFACTORY_USERNAME and HTTP_BASIC_ARTIFACTORY_PASSWORD were the correct env vars I needed to set.

This allowed me to remove the http basic auth from the repo url eg:

[[tool.poetry.source]]
name = "artifactory"
url = "https://artifactory.example.com/artifactory/api/pypi/<python_repo_name>/simple/"
default = true
secondary = false
Read more comments on GitHub >

github_iconTop Results From Across the Web

ARTIFACTORY: How to resolve the "Could not download file ...
This means that the file resolution failed, and Artifactory is attempting to cache the branch as an archive file. This will be possible...
Read more >
artifactory - Python package is donwloaded but not save
I am trying to d/l "torch" package via jfrog artifactory. It seems that the files are d/l well and are install in my...
Read more >
artifactory - PyPI
Python interface library for Jfrog Artifactory ... This module is intended to serve as a logical descendant of pathlib, a Python 3 module...
Read more >
Repositories | Documentation | Poetry - Python dependency ...
Depending on your system configuration, credentials might be saved in your command line history. Many shells do not save commands to history when...
Read more >
How to Download Python Packages - ActiveState
Clone a Github Repository in Linux. If git is not already installed on your system, then enter: $ sudo apt update $ sudo...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found