voila-dashboards / voici

Voici turns any Jupyter Notebook into a static web application
https://voici.readthedocs.io/
Other
156 stars 9 forks source link

0.6.0: pep517 based build fails #111

Closed kloczek closed 5 months ago

kloczek commented 8 months ago

Looks like something is wrong with just re;leased 0.6.0

+ cd voici-0.6.0
+ ASMFLAGS='-m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security'
+ CFLAGS='-m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security'
+ CXXFLAGS='-m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security'
+ FFLAGS='-m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -I/usr/lib64/gfortran/modules'
+ FCFLAGS='-m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -I/usr/lib64/gfortran/modules'
+ LDFLAGS='-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--gc-sections -Wl,--as-needed -Wl,--build-id=sha1 -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,pack-relative-relocs -flto=auto -fuse-linker-plugin'
+ RUSTFLAGS='-C codegen-units=1 -C debuginfo=2 -C opt-level=2 -C link-arg=-Wl,--as-needed -C link-arg=-Wl,--build-id=sha1 -C link-arg=-Wl,-z,now -C link-arg=-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -C link-arg=-Wl,-z,pack-relative-relocs -C link-arg=-Wl,-z,relro -C link-arg=-flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --cap-lints=warn'
+ VALAFLAGS=-g
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/g++
+ FC=/usr/bin/gfortran
+ AR=/usr/bin/gcc-ar
+ NM=/usr/bin/gcc-nm
+ RANLIB=/usr/bin/gcc-ranlib
+ export ASMFLAGS CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS VALAFLAGS CC CXX FC AR NM RANLIB RUSTFLAGS VALAFLAGS
+ PBR_VERSION=0.6.0
+ PDM_BUILD_SCM_VERSION=0.6.0
+ SETUPTOOLS_SCM_PRETEND_VERSION=0.6.0
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
* Building wheel...
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/lib/python3.8/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
  File "/usr/lib/python3.8/site-packages/hatchling/build.py", line 58, in build_wheel
    return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
  File "/usr/lib/python3.8/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
    artifact = version_api[version](directory, **build_data)
  File "/usr/lib/python3.8/site-packages/hatchling/builders/wheel.py", line 411, in build_standard
    for included_file in self.recurse_included_files():
  File "/usr/lib/python3.8/site-packages/hatchling/builders/plugin/interface.py", line 176, in recurse_included_files
    yield from self.recurse_selected_project_files()
  File "/usr/lib/python3.8/site-packages/hatchling/builders/plugin/interface.py", line 180, in recurse_selected_project_files
    if self.config.only_include:
  File "/usr/lib/python3.8/site-packages/hatchling/builders/config.py", line 781, in only_include
    only_include = only_include_config.get('only-include', self.default_only_include()) or self.packages
  File "/usr/lib/python3.8/site-packages/hatchling/builders/wheel.py", line 230, in default_only_include
    return self.default_file_selection_options.only_include
  File "/usr/lib64/python3.8/functools.py", line 967, in __get__
    val = self.func(instance)
  File "/usr/lib/python3.8/site-packages/hatchling/builders/wheel.py", line 218, in default_file_selection_options
    raise ValueError(message)
ValueError: Unable to determine which files to ship inside the wheel using the following heuristics: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: https://hatch.pypa.io/latest/config/build/

As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at the root of your project, you can define the following:

[tool.hatch.build.targets.wheel]
packages = ["src/foo"]

ERROR Backend subprocess exited when trying to invoke build_wheel
trungleduc commented 8 months ago

From 0.6.0, voici is split into voici-core and voici, both packages resident in the python directory. Calling the build tool at the repo's root directory is not the correct way to build the project.

kloczek commented 8 months ago

So why not move those modules into two separated repos and maintain as separated python modules? Current way do not allow cleanly build those modules out of VCS resources.🤔

martinRenou commented 8 months ago

I'm curious, are you having the same problem with the jupyterlite repo?

The jupyterlite repo has the same setup with multiple Python distributions on the same repo. If you're able to build the wheels for jupyterlite then there is something we may be missing in Voici.

kloczek commented 8 months ago

'm curious, are you having the same problem with the jupyterlite repo?

Yes I have the same issue with that module. Thank you for recalling me to open for that ticket. Problem is that in many cases sdist tar ball do not have test suite or documentation included. Other thing is that use VCS quarantines as well to be able apply any patch taken from commits after release.

kloczek commented 6 months ago

From 0.6.0, voici is split into voici-core and voici, both packages resident in the python directory. Calling the build tool at the repo's root directory is not the correct way to build the project.

OK than what is the correct way of building voici? 🤔

kloczek commented 6 months ago

I'm not sure but looks like first needs to be build voici-core than after install this module the same process needs to be repeated for voici. If that is true I think that keeping two modules in the same could be replaced by

Does it make any sense to you? 🤔

Looks lie current docs/ and tests/ is about voici that part can stay where it is now.

kloczek commented 6 months ago

I'm going to prepare two separated rpm build procedures basing on current 0.6.0 content to package separately voici-core and than add it to BuildRequires of voici.

martinRenou commented 5 months ago

OK than what is the correct way of building voici?

You can do the following to build voici-core:

cd python/voici-core
python -m build

Then the following to build voici:

cd python/voici
python -m build

The main repo is a monorepo containing two Python packages, it should be treated as two different distributions.

I'm closing for triaging/as answered but we can continue the discussion if needed :)