Giter Site home page Giter Site logo

Comments (6)

inducer avatar inducer commented on May 21, 2024

Fixed (I believe) in 2bb0d72 by renaming to ipython_ext. Can you please verify and report back? I'll release 2014.1.1 with the fix once you confirm.

Thx,
Andreas

from pyopencl.

cgohlke avatar cgohlke commented on May 21, 2024

This is a Windows specific issue in lib2to3 that has not been fixed yet (http://bugs.python.org/issue18477).
Rather than deprecating pyopencl.ipython one could try import ipython_ext as ipython in __init__.py or (ugly) monkey patch FixImport.probably_a_local_import in setup.py, e.g.:

    try:
        from distutils.command.build_py import build_py_2to3 as build_py
    except ImportError:
        # 2.x
        from distutils.command.build_py import build_py
    else:
        # Monkey patch FixImport.probably_a_local_import 
        # to work around http://bugs.python.org/issue18477
        from os.path import dirname, join, exists, sep, split, isdir
        from os import listdir

        def probably_a_local_import(self, imp_name):
            if imp_name.startswith("."):
                return False
            imp_name = imp_name.split(".", 1)[0]
            base_path = dirname(self.filename)
            base_path = join(base_path, imp_name)
            if not exists(join(dirname(base_path), "__init__.py")):
                return False
            path, filename = split(base_path)
            if isdir(base_path) and filename in listdir(path):
                return True
            for ext in [".py", sep, ".pyc", ".so", ".sl", ".pyd"]:
                if (filename + ext) in listdir(path):
                    return True
            return False

        from lib2to3.fixes.fix_import import FixImport
        FixImport.probably_a_local_import = probably_a_local_import

from pyopencl.

cgohlke avatar cgohlke commented on May 21, 2024

I see that the renaming to ipython_ext was done already. Never mind the monkey patch then. The monkey patch also breaks building on Python 2.

from pyopencl.

cgohlke avatar cgohlke commented on May 21, 2024

2bb0d72 does not work for me because the ipython.py file is still present.

from pyopencl.

inducer avatar inducer commented on May 21, 2024

Too bad. Deleted in d3f3184. If this works (please let me know), I'll release 2014.1.1 soon so that as few people as possible start relying on pyopencl.ipython.

from pyopencl.

inducer avatar inducer commented on May 21, 2024

The IPython extension has been called ipython_ext for a while now, which should address this. Closing.

from pyopencl.

Related Issues (20)

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.