GithubHelp home page GithubHelp logo

Unknown compiler directives about pyimgui HOT 8 CLOSED

stuaxo avatar stuaxo commented on July 22, 2024
Unknown compiler directives

from pyimgui.

Comments (8)

swistakm avatar swistakm commented on July 22, 2024

Oh, I will try to take closer look this week. Could you give list of all package versions in your virtualenv (pip freeze)?

from pyimgui.

stuaxo avatar stuaxo commented on July 22, 2024
$ pip freeze
Cython==0.26
pkg-resources==0.0.0

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

@stuaxo, sorry it took so long. It seems that I have misused the compiler_directives argument of cythonize() function in setup.py. Cython was bit more forgiving in <0.26 but this have changed in the latest release. Thank you for report. It should work now without any problems.

from pyimgui.

stuaxo avatar stuaxo commented on July 22, 2024

Looks like setup.py might need tweaking too (tested in py 2.7 venv):

python setup.py install
Traceback (most recent call last):
  File "setup.py", line 97, in <module>
    ], compiler_directives=compiler_directives, **cythonize_opts),
  File "/mnt/data/home/stu/.virtualenvs/tmp-9176e541bd1cd401/local/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 886, in cythonize
    c_options = CompilationOptions(**options)
  File "/mnt/data/home/stu/.virtualenvs/tmp-9176e541bd1cd401/local/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 561, in __init__
    directives = dict(options['compiler_directives'])  # copy mutable field
TypeError: 'NoneType' object is not iterable

from pyimgui.

swistakm avatar swistakm commented on July 22, 2024

from pyimgui.

connorjak avatar connorjak commented on July 22, 2024

I think I am having similar issues building on Windows. This is the only google result for _CYTHONIZE_WITH_COVERAGE.

(env) PS C:\Users\me\Documents\Github\pyimgui> make build
_CYTHONIZE_WITH_COVERAGE=1 python -m pip install -e . -v
'_CYTHONIZE_WITH_COVERAGE' is not recognized as an internal or external command,
operable program or batch file.
make: *** [build] Error 1
(env) PS C:\Users\me\Documents\Github\pyimgui>

I ran python -m pip install -e . -v, and now the examples run fine. I would like access to the tests though, as I plan to merge in some more C++ imgui widgets.

from pyimgui.

stuaxo avatar stuaxo commented on July 22, 2024

It looks like you are on windows with powershell, I seem to recall environment variables are set differently in powershell:

$env:_CYTHONIZE_WITH_COVERAGE=1
python -m pip install -e . -v

from pyimgui.

connorjak avatar connorjak commented on July 22, 2024

Ok, that seemed to be the right syntax. Here's what I get when I run python ci/completion.py -o README.md with-pxd imgui/cimgui.pxd:

(env) PS C:\Users\conno\Documents\Github\pyimgui> python ci/completion.py -o README.md with-pxd imgui/cimgui.pxd
Traceback (most recent call last):
  File "ci/completion.py", line 108, in <module>
    cli(obj={})
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\conno\Documents\Github\pyimgui\env\lib\site-packages\click\decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "ci/completion.py", line 53, in with_pxd
    output(done_count, all_count, ctx.obj['badge_output'])
  File "ci/completion.py", line 84, in output
    float(done_count)/all_count * 100,
ZeroDivisionError: float division by zero

When I run py.test (after pip installing from the testing requirements):

(env) PS C:\Users\conno\Documents\Github\pyimgui> py.test
====================================================== test session starts =======================================================
platform win32 -- Python 3.8.2, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: C:\Users\conno\Documents\Github\pyimgui, configfile: setup.cfg
collected 0 items / 1 error

============================================================= ERRORS =============================================================
_________________________________________________ ERROR collecting test session __________________________________________________
env\lib\site-packages\pluggy\hooks.py:286: in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
env\lib\site-packages\pluggy\manager.py:93: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
env\lib\site-packages\pluggy\manager.py:84: in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
conftest.py:147: in pytest_collect_file
    return SphinxDoc(path, parent)
env\lib\site-packages\_pytest\nodes.py:95: in __call__
    warnings.warn(NODE_USE_FROM_PARENT.format(name=self.__name__), stacklevel=2)
E   pytest.PytestDeprecationWarning: Direct construction of SphinxDoc has been deprecated, please use SphinxDoc.from_parent.
E   See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
==================================================== short test summary info =====================================================
ERROR  - pytest.PytestDeprecationWarning: Direct construction of SphinxDoc has been deprecated, please use SphinxDoc.from_parent.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================== 1 error in 0.26s ========================================================

By the way, I have been able to develop on the package just fine with python -m pip install -e . -v for rebuilding.

from pyimgui.

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.