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

6.0.0 fails to build #108

Open
yurivict opened this issue Jan 15, 2024 · 5 comments
Open

6.0.0 fails to build #108

yurivict opened this issue Jan 15, 2024 · 5 comments
Assignees
Labels
bug Something isn't working Packaging pyTooling.Packaging

Comments

@yurivict
Copy link

The PEP517-compliant build project fails:

cd /usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0 && /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/py-pyTooling/work-py39  XDG_CONFIG_HOME=/usr/ports/devel/py-pyTooling/work-py39  XDG_CACHE_HOME=/usr/ports/devel/py-pyTooling/work-py39/.cache  HOME=/usr/ports/devel/py-pyTooling/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/devel/py-pyTooling/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/devel/py-pyTooling/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" /usr/local/bin/python3.9 -m build --no-isolation --wheel 
* Getting build dependencies for wheel...
[pyTooling.Packaging] Could not import from 'pyTooling.*'!
[pyTooling.MetaClasses] Could not import from 'pyTooling.*'!
[pyTooling.MetaClasses] Could not import from 'pyTooling.*'!
[pyTooling.MetaClasses] Could not import from 'Exceptions' or 'Decorators' directly!
[pyTooling.Packaging] Could not import from 'Decorators', 'Exceptions', 'MetaClasses' or 'Licensing' directly!
Traceback (most recent call last):
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/Packaging/__init__.py", line 43, in <module>
    from ..Decorators  import export, readonly
ImportError: attempted relative import beyond top-level package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/MetaClasses/__init__.py", line 45, in <module>
    from ..Exceptions import ToolingException
ImportError: attempted relative import beyond top-level package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/local/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/local/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/usr/local/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
    return self._get_build_requires(
  File "/usr/local/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
    self.run_setup()
  File "/usr/local/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 39, in <module>
    from Packaging  import DescribePythonPackageHostedOnGitHub
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/Packaging/__init__.py", line 57, in <module>
    raise ex
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/Packaging/__init__.py", line 53, in <module>
    from MetaClasses import ExtendedType
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/MetaClasses/__init__.py", line 57, in <module>
    raise ex
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/MetaClasses/__init__.py", line 54, in <module>
    from Attributes import ATTRIBUTES_MEMBER_NAME, AttributeScope
  File "/usr/ports/devel/py-pyTooling/work-py39/pyTooling-6.0.0/pyTooling/Attributes/__init__.py", line 46, in <module>
    from pyTooling.Decorators import export, readonly
ModuleNotFoundError: No module named 'pyTooling'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
*** Error code 1

5.0.0 is building fine in the same environment.

Python-3.9
FreeBSD 14.0

@Paebbels
Copy link
Member

@yurivict I'm sorry I broke it again (I think you reported a similar issue before).

I'm not sure the solution/workaround I currently use is a good solution to the general problem. See https://github.com/pyTooling/pyTooling/blob/main/pyTooling/MetaClasses/__init__.py#L44-L57

The problem in general is introduced due to namespace packages in Python, because the root package is not allowed to have an __init__.py. But this is now the problem when referencing some other packages, it doesn't consider them proper Python modules in a proper package/module hierarchy.

I'm also not able to full recreate your environment. I saw similar problems when building the wheel in GitHub Actions, that why some of the packages have this workaround code.

I can add the workaround everywhere and we try it again, but I'm not sure if it fixes it completely.

Any suggestions where I could setup a (Free)BSD environment?

@yurivict
Copy link
Author

yurivict commented Jan 15, 2024

I have this answer on file:

Is there an easy way to test under FreeBSD?

  1. Install the FreeBSD VM image into VirtualBox.
  2. Boot FreeBSD
  3. Install git: pkg install git
  4. Check out the ports tree: git clone https://git.FreeBSD.org/ports.git /usr/ports
  5. cd /usr/ports/devel/py-pyTooling
  6. Install dependencies: pkg install -A `make missing`
  7. Build: make
  8. Run tests: make test

@Paebbels
Copy link
Member

@yurivict I found this GitHub action: https://github.com/marketplace/actions/freebsd-vm
I'll try it.

@Paebbels Paebbels mentioned this issue Jan 16, 2024
@Paebbels
Copy link
Member

@yurivict can you please try with dev branch if it solves it?

I applied the bootstrap code to all modules, even if the error message shows modules which already had that fix. If this is not enough to fix it, I'll setup the CI job in the next days to test it.

@Paebbels Paebbels added bug Something isn't working Packaging pyTooling.Packaging labels Jan 16, 2024
@Paebbels Paebbels self-assigned this Jan 16, 2024
@Paebbels
Copy link
Member

@yurivict is the problem solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Packaging pyTooling.Packaging
Projects
None yet
Development

No branches or pull requests

2 participants