tlocke / pg8000

A Pure-Python PostgreSQL Driver
BSD 3-Clause "New" or "Revised" License
515 stars 46 forks source link

1.31.0: create temporary directory in source tree trashes pep517 build #151

Open kloczek opened 6 months ago

kloczek commented 6 months ago

Looks like some bits in pyproject.toml are still missing and create some termopary directory before start build trashes pep517 build.

+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting build dependencies for wheel...
error: Multiple top-level packages discovered in a flat-layout: ['pg8000', 'SPECPARTS'].

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

In this case during package using rpm is created SPECPARTS directory.

tlocke commented 6 months ago

Hi @kloczek, I tried to reproduce the problem by downloading the source distribution from https://files.pythonhosted.org/packages/70/0f/b3b82c2ab2eaa1df73ea8070d7cb78f6c24e3490c810a6f7bdd222118c6b/pg8000-1.31.0.tar.gz Then I did the following commands:

tar -xzf pg8000-1.31.0.tar.gz
cd pg8000-1.31.0/
python3 -m venv venv
source venv/bin/activate
pip install build
python -m build 

and this completed successfully, so I think I must have done something different to you?

kloczek commented 6 months ago

Please try:

tar -xzf pg8000-1.31.0.tar.gz
cd pg8000-1.31.0/
mkdir TEMP                                # <<<< HERE
python3 -m venv venv
source venv/bin/activate
pip install build
python -m build 
tlocke commented 6 months ago

Ah, I see now. I've done a new release 1.31.1, which uses a file layout where all the source files are within a src directory, and so building should work now if there are extra top-level directories.

kloczek commented 6 months ago

👍 it would be good to switch from versioningit tohatch-vcs. (which is native for hatchling) as well as versioningit has some issues on building without git metadata. https://github.com/tlocke/pg8000/issues/152