xrviz icon indicating copy to clipboard operation
xrviz copied to clipboard

CLI doesn't work in Windows when installed with `conda`

Open zmoon opened this issue 4 years ago • 7 comments

Invoking xrviz gives this:

#!/bin/sh
'''exec' C:/Users/zmoon/.conda/envs/xrviz/bin/python "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
import sys
from xrviz.cli import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

I installed from conda-forge.

With a pip install it is fine (xrviz is a .exe).

zmoon avatar Oct 28 '21 20:10 zmoon

Agree, there should probably not be any launch script specific to conda beyond whatever pip does. What is it exactly that goes wrong with your invocation?

(Note that xrviz was mainly conceived as callable code or for in the jupyter notebook.)

martindurant avatar Oct 28 '21 21:10 martindurant

It seems like with the Conda install, we get an xrviz script that would work in a UNIX-like. What I posted above is the contents of the xrviz file. Invoking xrviz, Windows asks what you want to do with the file. Choosing a text editor I see the file contents that I posted.

Installing with Pip instead, it builds the proper "script" during the Setuptools process, which on Windows is a binary xrviz.exe.

(Note that xrviz was mainly conceived as callable code or for in the jupyter notebook.)

Noted, was just trying it out for fun.

zmoon avatar Oct 28 '21 21:10 zmoon

I don't see anything in https://github.com/conda-forge/xrviz-feedstock/blob/master/recipe/meta.yaml that would cause this - it just calls pip and that's all. https://github.com/intake/xrviz/blob/master/setup.py#L27 also looks standard. Maybe raise this at the feedstock and ping a conda-forge admin?

martindurant avatar Oct 28 '21 21:10 martindurant

I notice some other projects specify the entry points in the meta.yaml (in addition to the Setuptools), e.g., https://github.com/conda-forge/tqdm-feedstock/blob/master/recipe/meta.yaml

Maybe that would fix this?

zmoon avatar Oct 28 '21 21:10 zmoon

I honestly don't know. It could be a change since when this package was last released, nearly two years ago.

martindurant avatar Oct 28 '21 21:10 martindurant

@ocefpaf, what do you think about blowing away the feedstock and starting over with a grayskull created one?

rsignell-usgs avatar Oct 28 '21 21:10 rsignell-usgs

@ocefpaf, what do you think about blowing away the feedstock and starting over with a grayskull created one?

No need to start a new one. Just update the current one with the entry_point. Doing it now...

ocefpaf avatar Oct 29 '21 15:10 ocefpaf