tsutsu3 / uc.micro-py

Micro subset of unicode data files for linkify-it-py projects.
Other
2 stars 5 forks source link

1.0.2: create temp directory in source tree trashes build #17

Closed kloczek closed 9 months ago

kloczek commented 9 months ago

Looks like some bits may be still missing on pyproject.toml. Here is test case:

+ cd uc.micro-py-1.0.2
+ mkdir temp
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
No `packages` or `py_modules` configuration, performing automatic discovery.
`flat-layout` detected -- analysing .
discovered packages -- ['uc_micro', 'temp', 'uc_micro.categories', 'uc_micro.properties', 'uc_micro.categories.Cc', 'uc_micro.categories.Cf', 'uc_micro.categories.P', 'uc_micro.categories.Z', 'uc_micro.properties.Any']
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 118, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/usr/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "/usr/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/usr/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 159, in setup
    dist.parse_config_files()
  File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 627, in parse_config_files
    pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 66, in apply_configuration
    config = read_configuration(filepath, True, ignore_option_errors, dist)
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 131, in read_configuration
    return expand_configuration(asdict, root_dir, ignore_option_errors, dist)
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 156, in expand_configuration
    return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand()
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 204, in expand
    self._expand_all_dynamic(dist, package_dir)
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 249, in _expand_all_dynamic
    version=self._obtain_version(dist, package_dir),
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 298, in _obtain_version
    return _expand.version(self._obtain(dist, "version", package_dir))
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 287, in _obtain
    return self._expand_directive(
  File "/usr/lib/python3.8/site-packages/setuptools/config/pyprojecttoml.py", line 281, in _expand_directive
    return _expand.read_attr(directive["attr"], package_dir, root_dir)
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 188, in read_attr
    _parent_path, path, module_name = _find_module(module_name, package_dir, root_dir)
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 229, in _find_module
    if package_dir:
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 459, in __len__
    return len(self._target())
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 452, in _target
    self._value = self._obtain()
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 422, in _get_package_dir
    self()
  File "/usr/lib/python3.8/site-packages/setuptools/config/expand.py", line 412, in __call__
    self._dist.set_defaults(name=False)  # Skip name, we can still be parsing
  File "/usr/lib/python3.8/site-packages/setuptools/discovery.py", line 353, in __call__
    self._analyse_package_layout(ignore_ext_modules)
  File "/usr/lib/python3.8/site-packages/setuptools/discovery.py", line 387, in _analyse_package_layout
    or self._analyse_flat_layout()
  File "/usr/lib/python3.8/site-packages/setuptools/discovery.py", line 444, in _analyse_flat_layout
    return self._analyse_flat_packages() or self._analyse_flat_modules()
  File "/usr/lib/python3.8/site-packages/setuptools/discovery.py", line 450, in _analyse_flat_packages
    self._ensure_no_accidental_inclusion(top_level, "packages")
  File "/usr/lib/python3.8/site-packages/setuptools/discovery.py", line 480, in _ensure_no_accidental_inclusion
    raise PackageDiscoveryError(cleandoc(msg))
setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['uc_micro', 'temp'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
tsutsu3 commented 9 months ago

Thanks. Will fix soon.

kloczek commented 9 months ago

tested and it works now. Thank you 👍

kloczek commented 9 months ago

Just tested edb11d00 and looks like something is wrong now because build packages only metadata and uc_micro/init.py

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
WARNING setuptools_scm._integration.setuptools pyproject.toml does not contain a tool.setuptools_scm section
running egg_info
creating uc_micro_py.egg-info
writing uc_micro_py.egg-info/PKG-INFO
writing dependency_links to uc_micro_py.egg-info/dependency_links.txt
writing requirements to uc_micro_py.egg-info/requires.txt
writing top-level names to uc_micro_py.egg-info/top_level.txt
writing manifest file 'uc_micro_py.egg-info/SOURCES.txt'
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
reading manifest file 'uc_micro_py.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'uc_micro_py.egg-info/SOURCES.txt'
* Building wheel...
WARNING setuptools_scm._integration.setuptools pyproject.toml does not contain a tool.setuptools_scm section
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/uc_micro
copying uc_micro/__init__.py -> build/lib/uc_micro
running egg_info
writing uc_micro_py.egg-info/PKG-INFO
writing dependency_links to uc_micro_py.egg-info/dependency_links.txt
writing requirements to uc_micro_py.egg-info/requires.txt
writing top-level names to uc_micro_py.egg-info/top_level.txt
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
reading manifest file 'uc_micro_py.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'uc_micro_py.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/uc_micro
copying build/lib/uc_micro/__init__.py -> build/bdist.linux-x86_64/wheel/uc_micro
running install_egg_info
Copying uc_micro_py.egg-info to build/bdist.linux-x86_64/wheel/uc_micro_py-1.0.2-py3.8.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/uc_micro_py-1.0.2.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/uc.micro-py-1.0.2/dist/.tmp-3nqlht8q/uc_micro_py-1.0.2-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'uc_micro/__init__.py'
adding 'uc_micro_py-1.0.2.dist-info/LICENSE'
adding 'uc_micro_py-1.0.2.dist-info/METADATA'
adding 'uc_micro_py-1.0.2.dist-info/WHEEL'
adding 'uc_micro_py-1.0.2.dist-info/top_level.txt'
adding 'uc_micro_py-1.0.2.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built uc_micro_py-1.0.2-py3-none-any.whl