Git Product home page Git Product logo

Comments (8)

vinci1it2000 avatar vinci1it2000 commented on June 23, 2024

UNC paths are supported on windows. To solve your issue you can set the module variable as follows:

import schedula.utils.drw as mdl
setattr(mdl, '_UNC', '')

from schedula.

ankostis avatar ankostis commented on June 23, 2024

What if longer than 260 chars is needed?

from schedula.

vinci1it2000 avatar vinci1it2000 commented on June 23, 2024

You have to solve the problem with the CMD.EXE.

from schedula.

ankostis avatar ankostis commented on June 23, 2024

So i guess the answer to my "what if" question is that "without UNC paths, schedula will fail for longer than 260-char paths", correct?
And that is why you suggest to fix the CMD problem. correct?

Now, that CMD.exe, i wouldn't be so assertive it is my problem...

from schedula.

ankostis avatar ankostis commented on June 23, 2024

Please re-open.

The issue is caused by a difference in the way Graphviz suite installs on Windows,

  • when downloading and installing it from the site, or
  • when using conda install graphviz.

TL;DR, in conda, the default executable extension is BAT, not exe, and BAT cannot handle UNC paths as CWD.

Normally there wouldn't be an issue, if schedula were not using UNC-paths.
(problem reported also in respective feedstock conda-forge/graphviz-feedstock#34)

Workaround

The dot.exe in conda's Graphvis in inside graphviz/ dir from where the bat is installed:

def is_conda():
    return os.path.exists(os.path.join(sys.prefix, 'conda-meta'))

if os.name == 'nt' and not os.path.splitext(prg)[1] and is_conda():
    monkeypatch_graphviz()

The monkeypatch_graphviz() must change the lines graphviz/backend.py#L124-L125 from this:

    if PLATFORM == 'windows':
        engine = '%s.bat' % engine

to this:

    if PLATFORM == 'windows':
        engine = 'graphviz\%s.exe' % engine

NOTE: you wont find the "from" lines in the original sources of the graphviz project, or in a non-conda Python - these lines are delivered by a conda-patch.

from schedula.

vinci1it2000 avatar vinci1it2000 commented on June 23, 2024

I'm sorry but your patch is invalid. You have used the wrong graphviz library (conda install -c conda-forge graphviz).

The graphviz requirement in schedula corresponds to conda install -c conda-forge python-graphviz=0.8.4.

from schedula.

ankostis avatar ankostis commented on June 23, 2024

You seem to be confusing:

  • python-graphviz (python) and
  • graphviz the native OS suite.

The former, depends on the later, you can't have one or the other, you need both in conda.

My patch is a temporary fix for schedula's UNC paths to play well there, n particular, with python-graphviz, until they fix this upstream (conda-forge/graphviz-feedstock#34, comment).

from schedula.

ankostis avatar ankostis commented on June 23, 2024

But the old version python-graphviz-8.4 indeed solves the problem 👍
(reported in graphviz-feedstock-34).

I'm not asking to add this version-boundary to scheulas setup.py since is only involves conda environments - not PyPi packages.

from schedula.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.