intake / xrviz

Interactive visualisation interface for Xarrays
https://xrviz.readthedocs.io
BSD 3-Clause "New" or "Revised" License
105 stars 21 forks source link

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

Open zmoon opened 3 years ago

zmoon commented 3 years ago

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).

martindurant commented 3 years ago

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.)

zmoon commented 3 years ago

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.

martindurant commented 3 years ago

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?

zmoon commented 3 years ago

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?

martindurant commented 3 years ago

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

rsignell-usgs commented 3 years ago

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

ocefpaf commented 3 years ago

@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...