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_pyinstaller doesn't support namespace package #17

Open
jaustinpage opened this issue Jun 23, 2022 · 1 comment
Open

bdist_pyinstaller doesn't support namespace package #17

jaustinpage opened this issue Jun 23, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@jaustinpage
Copy link

If a package is a namespace package, bdist_pyinstaller raises a TypeError.

Traceback (most recent call last):
  File "/repo/setup.py", line 13, in <module>
    setup(use_scm_version={"version_scheme": "no-guess-dev"})
  File "/repo/.venv/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/app/vbuild/RHEL7-x86_64/python/3.9.5/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/app/vbuild/RHEL7-x86_64/python/3.9.5/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/app/vbuild/RHEL7-x86_64/python/3.9.5/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/repo/.venv/lib/python3.9/site-packages/bdist_pyinstaller/bdist_pyinstaller.py", line 394, in run
    PACKAGE__ROOT = os.path.join(os.path.dirname(_package_.__file__))
  File "/app/vbuild/RHEL7-x86_64/python/3.9.5/lib/python3.9/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Per Pep420: https://peps.python.org/pep-0420/#differences-between-namespace-packages-and-regular-packages , namespace packages are defined as packages that have a __path__ but do not have a __file__.

@wherka-ama
Copy link
Contributor

@jaustinpage : thank you for raising the issue. Any chance of providing a quick reproducer please? We could use that to enrich the unit tests once the fix is done.

@wherka-ama wherka-ama self-assigned this Jul 30, 2022
@wherka-ama wherka-ama added the question Further information is requested label Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants