Python pip install `git+https://github.com/.../python/v1.git` not working
mxab opened this issue · comments
Hi,
maybe I'm overlooking something but the pip install
as mentioned in the readme doesn't work me
~/temp/foo via 🐍 v3.9.12 (foovenv)
❯ pip install git+https://github.com/hashicorp/nomad-openapi/clients/python/v1.git
Collecting git+https://github.com/hashicorp/nomad-openapi/clients/python/v1.git
Cloning https://github.com/hashicorp/nomad-openapi/clients/python/v1.git to /private/var/folders/zt/4d___54j41q5xhgw80pcmtyh0000gn/T/pip-req-build-clmb4zx8
Running command git clone --filter=blob:none --quiet https://github.com/hashicorp/nomad-openapi/clients/python/v1.git /private/var/folders/zt/4d___54j41q5xhgw80pcmtyh0000gn/T/pip-req-build-clmb4zx8
remote: Not Found
fatal: Repository 'https://github.com/hashicorp/nomad-openapi/clients/python/v1.git/' not found
error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/hashicorp/nomad-openapi/clients/python/v1.git /private/var/folders/zt/4d___54j41q5xhgw80pcmtyh0000gn/T/pip-req-build-clmb4zx8 did not run successfully.
│ exit code: 128
╰─> See above for output.
Any suggestions?
@mxab Apologies for the clunky experience with the generated python client's README. The installation instructions in the generated README only work if the client is at the root of the repository. For installing the client as it lives in this repo, you will need to clone the repository or fetch a zip of the repo from github. Once you have the source locally, you can use
pip install .
from the nomad-openapi/clients/python/v1
folder and it will install into your python environment.
If you want to install it as the generated directions indicate, you can create a your own git repository that's root contains the entire contents of the v1 folder
Hi,
no worries, thank you for the explanation. I try will to do this for now.
Do you have any plans to publish it to pypi?
Not at this point, the generated clients are currently more of an opportunity to help validate the OpenAPI specification that the tool generates from the Nomad codebase. The generated Go client happens to be used in a higher-level abstraction used in nomad-pack, so it is one of the more proven ones. I did a brief experiment with the python one and ran into an issue fairly quickly, so I would say that it is "experimental quality" at best. That said, I am also not a Python developer, so it's possible the issue was my code rather than the client.
We're happy to hear feedback about which API endpoints are not working or misbehave should you encounter any issues, because that could indicate an issue in the underlying generator. However, any issues that are related to the generated code but not the specification would be beyond the project scope.
I figured out the correct comand for pip, it should work with:
pip install "git+https://github.com/hashicorp/nomad-openapi.git#egg=nomad-client&subdirectory=clients/python/v1"
In case you use poetry to manage your python dependencies you can add it like this to the pyproject.toml
[tool.poetry.dependencies]
python = "^3.8"
nomad-client = { git="https://github.com/hashicorp/nomad-openapi.git", subdirectory="clients/python/v1" }