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

bdist_nuitka fails for packages containing py_modules only #479

Closed
tommyli3318 opened this issue Aug 3, 2019 · 3 comments
Closed

bdist_nuitka fails for packages containing py_modules only #479

tommyli3318 opened this issue Aug 3, 2019 · 3 comments

Comments

@tommyli3318
Copy link
Member

@tommyli3318 tommyli3318 commented Aug 3, 2019

python setup.py bdist_nuitka fails for all packages containing py_modules only, including PyPI packages such as decorator, ipaddress, and pyparsing.

Platform: Windows
Python 3.7.0 (x32)
Nuitka 0.6.5rc3

I have created a distutils example to reproduce this error.
Steps to reproduce:

  1. git clone -b develop-pypi https://github.com/tommyli3318/Nuitka.git
  2. cd tests/distutils/
  3. python run_all.py only py_modules_only/

Full Traceback:

Traceback (most recent call last):
  File "setup.py", line 34, in <module>
    scripts = ["runner"],
  File "C:\Users\Tommy\Nuitka\tests\distutils\venv_nuitka\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\Tommy\AppData\Local\Programs\Python\Python37-32\Lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Tommy\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Tommy\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Tommy\Nuitka\tests\distutils\venv_nuitka\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
    self.run_command('build')
  File "C:\Users\Tommy\AppData\Local\Programs\Python\Python37-32\Lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Tommy\AppData\Local\Programs\Python\Python37-32\Lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Tommy\Nuitka\tests\distutils\venv_nuitka\lib\site-packages\nuitka-0.6.6rc1-py3.7.egg\nuitka\distutils\bdist_nuitka.py", line 58, in run
    self.main_package = self.compile_packages[0]
TypeError: 'NoneType' object is not subscriptable
@kayhayen
Copy link
Member

@kayhayen kayhayen commented Aug 3, 2019

That's a great start. I suggest you checking what attributes self has right there, maybe py_modules or something will show up, and then you base the main package decision from that or the one failing here.

Make either optional of course, but give a proper error message in case neither is present, as that is something we are expecting, right? Instead of crashing like this, e.g. Nuitka always should have checked its assumption and sys.exit where they are not met. But I didn't do that then, something that makes it hard to those who encounter these limits, like yourself in your testing.

Then there is --include-module and --include-package, and you basically only have to hand out those to the different lists.

Also, main_package is a misnomer then, pick something better.

Loading

@kayhayen
Copy link
Member

@kayhayen kayhayen commented Aug 3, 2019

Once you have I PR, I suggest to include @xennygrimmato as this is something I bet he would love to work with you.

Loading

@kayhayen kayhayen added this to the 0.6.6 milestone Aug 14, 2019
@kayhayen kayhayen added this to To do in Planning via automation Aug 14, 2019
@kayhayen kayhayen moved this from To do to Review in progress in Planning Aug 16, 2019
@tommyli3318
Copy link
Member Author

@tommyli3318 tommyli3318 commented Aug 19, 2019

Fixed with the merge of #483

Loading

Planning automation moved this from Review in progress to Done Aug 19, 2019
@kayhayen kayhayen removed this from Done in Planning Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants