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

Add Windows version of 0.5.0 without vega-cli dependencies #7

Closed
wants to merge 4 commits into from
Closed

Add Windows version of 0.5.0 without vega-cli dependencies #7

wants to merge 4 commits into from

Conversation

jamesmyatt
Copy link

@jamesmyatt jamesmyatt commented Dec 5, 2020

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

See: altair-viz/altair_saver#70, altair-viz/altair_saver#121

vega-cli and vega-lite-cli do not have Windows builds on conda-forge. So it is possible to publish a conda package for Windows that doesn't require them?

@jamesmyatt jamesmyatt requested a review from xhochy as a code owner December 5, 2020 20:44
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • noarch packages can't have selectors. If the selectors are necessary, please remove noarch: python.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • Non noarch packages should have python requirement without any version constraints.
  • Non noarch packages should have python requirement without any version constraints.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@xhochy
Copy link
Member

xhochy commented Dec 5, 2020

Would this even work without these requirements? Also: Why not build them for windows? They are node packages and should work there too.

@jamesmyatt
Copy link
Author

@xhochy , I'd love that. Getting vega-lite-cli and vega-cli builds for Windows would certainly be the superior solution.

But see conda-forge/vega-cli-feedstock#4 and conda-forge/vega-cli-feedstock#3

@jamesmyatt
Copy link
Author

@conda-forge-admin, please rerender

@jamesmyatt jamesmyatt changed the title Try Windows version of 0.5.0 Add Windows version of 0.5.0 without vega-cli dependencies Dec 5, 2020
@jamesmyatt
Copy link
Author

jamesmyatt commented Dec 5, 2020

OK so this works, but I don't think this is a good idea. I'd rather have the vega-cli and vega-lite-cli dependencies fixed, or removed from this feedstock, or maybe with one subpackage without the dependencies (e.g. https://docs.conda.io/projects/conda-build/en/latest/resources/variants.html?#referencing-subpackages, https://github.com/conda-forge/dvc-feedstock/blob/master/recipe/meta.yaml)

@xhochy
Copy link
Member

xhochy commented Dec 7, 2020

@jakevdp or any other Altair maintainer: Any suggestions here?

@xhochy
Copy link
Member

xhochy commented Dec 8, 2020

FYI: I'm having some fun over at conda-forge/vega-cli-feedstock#8 and trying to package vega-cli for Windows. I think that would be the preferable solution for all.

@jamesmyatt
Copy link
Author

Thanks @xhochy . That would also be my preference.

@jamesmyatt jamesmyatt marked this pull request as draft December 8, 2020 11:09
@jamesmyatt
Copy link
Author

Thanks @xhochy. When I get the time, I might try changing this to use sub-packages instead.

@xhochy
Copy link
Member

xhochy commented Dec 11, 2020

@jamesmyatt vega-lite-cli should be available for Windows in 30min, can you give them a test then?

@jamesmyatt
Copy link
Author

Thanks @xhochy. It certainly installs now :D

However, I get a JSONDecodeError error now when using alt.renderers.enable('png') but I suspect that's not a feedstock issue. 👍

 ---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
C:\tools\miniconda3\envs\project-dev\lib\site-packages\IPython\core\formatters.py in __call__(self, obj, include, exclude)
    968 
    969             if method is not None:
--> 970                 return method(include=include, exclude=exclude)
    971             return None
    972         else:

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair\vegalite\v4\api.py in _repr_mimebundle_(self, include, exclude)
   1652             return {}
   1653         else:
-> 1654             return renderers.get()(dct)
   1655 
   1656     def display(self, renderer=Undefined, theme=Undefined, actions=Undefined, **kwargs):

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair\vegalite\v4\display.py in png_renderer(spec, **metadata)
     51 
     52 def png_renderer(spec, **metadata):
---> 53     return spec_to_mimebundle(
     54         spec,
     55         format="png",

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair\utils\mimebundle.py in spec_to_mimebundle(spec, format, mode, vega_version, vegaembed_version, vegalite_version, **kwargs)
     58                 "see http://github.com/altair-viz/altair_saver/".format(fmt=format)
     59             )
---> 60         return altair_saver.render(spec, format, mode=mode, **kwargs)
     61     if format == "html":
     62         html = spec_to_html(

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair_saver\_core.py in render(chart, fmts, mode, embed_options, method, **kwargs)
    255         Saver = _select_saver(method, mode=mode, fmt=fmt)
    256         saver = Saver(spec, mode=mode, embed_options=embed_options, **kwargs)
--> 257         mimebundle.update(saver.mimebundle(fmt))
    258 
    259     return mimebundle

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair_saver\savers\_saver.py in mimebundle(self, fmts)
     88                 vegalite_version=self._package_versions["vega-lite"],
     89             )
---> 90             bundle[mimetype] = self._serialize(fmt, "mimebundle")
     91         return bundle
     92 

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair_saver\savers\_node.py in _serialize(self, fmt, content_type)
    112 
    113         if self._mode == "vega-lite":
--> 114             spec = self._vl2vg(spec)
    115 
    116         if fmt == "vega":

C:\tools\miniconda3\envs\project-dev\lib\site-packages\altair_saver\savers\_node.py in _vl2vg(self, spec)
     66             [vl2vg], input=vl_json, stderr_filter=self._stderr_filter
     67         )
---> 68         return json.loads(vg_json)
     69 
     70     def _vg2png(self, spec: JSONDict) -> bytes:

C:\tools\miniconda3\envs\project-dev\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    355             parse_int is None and parse_float is None and
    356             parse_constant is None and object_pairs_hook is None and not kw):
--> 357         return _default_decoder.decode(s)
    358     if cls is None:
    359         cls = JSONDecoder

C:\tools\miniconda3\envs\project-dev\lib\json\decoder.py in decode(self, s, _w)
    335 
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()
    339         if end != len(s):

C:\tools\miniconda3\envs\project-dev\lib\json\decoder.py in raw_decode(self, s, idx)
    353             obj, end = self.scan_once(s, idx)
    354         except StopIteration as err:
--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None
    356         return obj, end

JSONDecodeError: Expecting value: line 2 column 1 (char 2)

@jamesmyatt jamesmyatt closed this Dec 13, 2020
@jamesmyatt jamesmyatt deleted the patch-1 branch December 13, 2020 20:03
@xhochy
Copy link
Member

xhochy commented Dec 13, 2020

Oh, that could also be an execution error from one of the underlying cli scripts. It's hard to tell from the traceback though what went wrong.

@jamesmyatt
Copy link
Author

jamesmyatt commented Dec 13, 2020

Probably best if I open a new issue. Shall I open it here or in the main altair_saver repo?

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

Successfully merging this pull request may close these issues.

3 participants