artifactory
artifactory copied to clipboard
ArtifactoryPath is broken.
artifact = ArtifactoryPath( url, auth=auth) changes https://whatever... to https:/whatever... (removing one forward slash) after which the library renders unusable.
Same issue here
EDIT: This is due to an update in pathlib
Running into this as well. My problem comes from https://github.com/Parallels/artifactory/blob/09ddcc4ae15095eec2347d39774c3f8aca6c4654/artifactory.py#L333
which assumes that the base url has the literal string artifactory
in the name, but this is only the case when the server config's "server name" property is set to artifactory
. In all other cases, it will produce the output described by @sngreen
My workaround is to create a ~/.artifactory_python.cfg file with the contents:
[https://whatever.com/myservername]
verify=True
I wasn't able to get the workaround above to work in Python 3.10. It looks like the pathlib
package removed the _init()
method that facilitated being able to use template "accessors" in python 3.10. This means that the artifactory package only ever gets pathlib._NormalAccessor
objects instead of the desired _ArtifactoryAccessor
. The result of this is that, when the user tries to do anything with an ArtifactoryPath
object, it results in a FileNotFoundError
because a _NormallAccessor
is designed to work with the local file system--which is obviously not how one interacts with Artifactory.
If we use Pathlib2, it is working fine for me.
@sfoley-gpqa did you ever get around that error? I'm experiencing a similar issue when trying to upload a file to Artifactory I'm getting:
'_NormalAccessor' object has no atribute 'is_dir'
Do we know of any way to get around this?
@drohm
I won't lie; I'm having trouble remembering the exact details of the problem I was experiencing at the time of my last post. I think I may have reverted to using python 3.9.x to solve the problem.
That said, I am currently using 3.10.13 for my project and am able to successfully upload files to Artifactory using ArtifactoryPath(url, auth=(ssid, api_key))
.
I still see that Python 3.10's pathlib lacks the _init()
method. However, I also see some 3.9 vs 3.10 version comparison logic in the artifactory package. I'm not sure if that is a new addition or not though and do not have time to check right now.
What version of python are you using? I know how this kind of thing can be very frustrating--especially when no one responds--so I'd be happy to help in any way I can.
@sfoley-gpqa sorry for the delay, I ended up just installing Python 3.9 on this machine. I'm using this on Ubuntu 22.04 and the default version is Python 3.10, which was what was giving me the problems. I used the deadsnakes PPA to install Python 3.9 and everything is working.
I'm glad to hear that it's working for you now!