MonkeyCanCode commented on PR #1222:
URL: https://github.com/apache/polaris/pull/1222#issuecomment-2746737895
@eric-maynard / @snazy
Sample workflow below:
setup cli from tag `apache-polaris-0.9.0-incubating`
```
➜ polaris git:(apache-polaris-0.9.0-incubating) ✗ ./polaris
...
First time setup complete.
Traceback (most recent call last):
File
"/Users/yong/Desktop/2/polaris/regtests/client/python/cli/polaris_cli.py", line
28, in <module>
from polaris.management import ApiClient, Configuration
File
"/Users/yong/Desktop/2/polaris/regtests/client/python/polaris/management/__init__.py",
line 38, in <module>
from polaris.management.api.polaris_default_api import PolarisDefaultApi
File
"/Users/yong/Desktop/2/polaris/regtests/client/python/polaris/management/api/__init__.py",
line 22, in <module>
from polaris.management.api.polaris_default_api import PolarisDefaultApi
File
"/Users/yong/Desktop/2/polaris/regtests/client/python/polaris/management/api/polaris_default_api.py",
line 33, in <module>
from pydantic import validate_call, Field, StrictFloat, StrictStr,
StrictInt
ModuleNotFoundError: No module named 'pydantic'
```
switch to main and see if the problem still exists
```
➜ polaris git:(apache-polaris-0.9.0-incubating) ✗ git switch main
Previous HEAD position was 4b18ec06 Use and update DISCLAIMER (instead of
DISCLAIMER_WIP) and cleanup NOTICE (#998)
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
➜ polaris git:(main) ✗ ./polaris
Traceback (most recent call last):
File "/Users/yong/Desktop/2/polaris/client/python/cli/polaris_cli.py",
line 30, in <module>
from polaris.management import ApiClient, Configuration
File
"/Users/yong/Desktop/2/polaris/client/python/polaris/management/__init__.py",
line 38, in <module>
from polaris.management.api.polaris_default_api import PolarisDefaultApi
File
"/Users/yong/Desktop/2/polaris/client/python/polaris/management/api/__init__.py",
line 22, in <module>
from polaris.management.api.polaris_default_api import PolarisDefaultApi
File
"/Users/yong/Desktop/2/polaris/client/python/polaris/management/api/polaris_default_api.py",
line 33, in <module>
from pydantic import validate_call, Field, StrictFloat, StrictStr,
StrictInt
ModuleNotFoundError: No module named 'pydantic'
```
use repair flag to fix the venv
```
➜ polaris git:(main) ✗ ./polaris --repair
Repair dependencies for the Python client...
...
Installing the current project: polaris (1.0.0)
...
Exception: Please provide credentials via either --client-id &
--client-secret or --access-token. Alternatively, you may set the environment
variables CLIENT_ID & CLIENT_SECRET.
```
Now back to what @eric-maynard suggests with prompting the repair option
when user is having issue, we can do that. However to do so, I will need to do
two things if everyone is okay:
1. Current script use "set -e" to exit when non-zero status code raises from
any commands. So to add check, I will need to toggle it off before running the
actual python command and toggle it back on after the python command
2. Currently polaris cli will raise exception even the venv is healthy due
to auth method check (`Exception: Please provide credentials via either
--client-id & --client-secret or --access-token. Alternatively, you may set the
environment variables CLIENT_ID & CLIENT_SECRET`). To distinguish between
actual error from this one, I will either need to capture output of the python
command or set the exit status code from CLI to a different value.
Let me know what you think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]