Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble using melpazoid on Windows #32

Open
jcs090218 opened this issue Oct 1, 2023 · 3 comments
Open

Trouble using melpazoid on Windows #32

jcs090218 opened this issue Oct 1, 2023 · 3 comments

Comments

@jcs090218
Copy link

I'm integrating melpazoid to Eask, so I'm trying to use this tool through the command line.

$ python melpazoid /path/to/my/openai/

It gives me this error output:

Set a recipe with: [--recipe RECIPE]

Then I tried the options --recipe:

$ python melpazoid /path/to/my/openai/ '(openai :fetcher github :repo "emacs-openai/openai")'

it gives me:

usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument --recipe: '(openai :fetcher github :repo emacs-openai/openai)' must be a valid MELPA recipe

If I tried using batch file:

set LOCAL_REPO=D:/_workspace/_eask/openai
set RECIPE=(openai :fetcher github :repo "jcs090218/openai")

make

it gives me:

Traceback (most recent call last):
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 995, in <module>
    _main()
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 987, in _main
    check_melpa_recipe(os.environ['RECIPE'])
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 672, in check_melpa_recipe
    clone_address = _clone_address(recipe)
                    ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 826, in _clone_address
    (package-recipe--upstream-url {_recipe_struct_elisp(recipe)}))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 842, in _recipe_struct_elisp
    return eval_elisp(
           ^^^^^^^^^^^
  File "D:\_workspace\_eask\melpazoid\melpazoid\melpazoid.py", line 871, in eval_elisp
    raise ChildProcessError(f"Emacs crashed: {result.stderr.decode()}")
ChildProcessError: Emacs crashed: Non-hex character used for Unicode escape: s (115)

make: *** [Makefile:7: run] Error 1

I've tried several packages but they all have the same result. I'm pretty sure the recipe format is a valid MELPA recipe. Does this tool support local package? 🤔

Additional information:

  • Windows python3 will just be python.
  • I'm using Python version 3.11.5.
@riscy
Copy link
Owner

riscy commented Oct 1, 2023

Can you make sure you're showing me the exact same input and output that you're seeing in a terminal?

$ python melpazoid /path/to/my/openai/ '(openai :fetcher github :repo "emacs-openai/openai")'

won't work in most cases (there is no .py extension, and the melpazoid dir does not contain a `main.py file). Also when it's run as a script, melpazoid wants your cwd to be the melpazoid root dir. What I think you are typing and seeing must be closer to:

$ python melpazoid/melpazoid.py /path/to/my/openai/ '(openai :fetcher github :repo "emacs-openai/openai")'
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument target: '/path/to/my/openai/' must be a MELPA PR or local path

Per the above help message, for a local repo you want to use melpazoid.py --recipe RECIPE target

$ python melpazoid/melpazoid.py /path/to/my/openai/ --recipe '(openai :fetcher github :repo "emacs-openai/openai")'

(i.e. add the --recipe flag before the recipe itself)

@jcs090218
Copy link
Author

Here is the full output directly copied from the terminal. I've tried a different kind of input (with or without quotes, change the order, etc.). 🤔

PS D:\_workspace\_eask\melpazoid> python .\melpazoid\melpazoid.py 'D:/_workspace/_eask/openai' '(openai :fetcher github :repo "emacs-openai/openai")'
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: unrecognized arguments: (openai :fetcher github :repo emacs-openai/openai)
PS D:\_workspace\_eask\melpazoid> python .\melpazoid\melpazoid.py 'D:/_workspace/_eask/openai' --recipe '(openai :fetcher github :repo "emacs-openai/openai")'
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument --recipe: '(openai :fetcher github :repo emacs-openai/openai)' must be a valid MELPA recipe
PS D:\_workspace\_eask\melpazoid> python .\melpazoid\melpazoid.py --recipe '(openai :fetcher github :repo "emacs-openai/openai")' 'D:/_workspace/_eask/openai'
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument --recipe: '(openai :fetcher github :repo emacs-openai/openai)' must be a valid MELPA recipe
PS D:\_workspace\_eask\melpazoid> python .\melpazoid\melpazoid.py --recipe '(openai :fetcher github :repo "emacs-openai/openai")' D:\_workspace\_eask\openai\
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument --recipe: '(openai :fetcher github :repo emacs-openai/openai)' must be a valid MELPA recipe
PS D:\_workspace\_eask\melpazoid> python .\melpazoid\melpazoid.py --recipe (openai :fetcher github :repo "emacs-openai/openai") D:\_workspace\_eask\openai\
usage: openai [-h] [-V] [-v] [-b API_BASE] [-k API_KEY] [-p PROXY [PROXY ...]]
              [-o ORGANIZATION]
              {api,tools,wandb} ...
openai: error: argument {api,tools,wandb}: invalid choice: ':fetcher' (choose from 'api', 'tools', 'wandb')
usage: melpazoid.py [-h] [--license] [--recipe RECIPE] [target]
melpazoid.py: error: argument --recipe: 'D:\\_workspace\\_eask\\openai\\' must be a valid MELPA recipe

Also when it's run as a script, melpazoid wants your cwd to be the melpazoid root dir

I'm in the melpazoid root dir.

(there is no .py extension

Sorry for the confusion. I did input .py extension!

, and the melpazoid dir does not contain a `main.py file)

Do you mean setup.py? Where is the main.py file? 🤔

@jcs090218
Copy link
Author

FYI, I've added partial melpazoid support in Eask, see emacs-eask/cli#202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants