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

prebuild.py call causes "build error" #27

Closed
jeff-dh opened this issue Apr 21, 2023 · 9 comments
Closed

prebuild.py call causes "build error" #27

jeff-dh opened this issue Apr 21, 2023 · 9 comments

Comments

@jeff-dh
Copy link
Owner

jeff-dh commented Apr 21, 2023

script = "prebuild.py"

For some reason this causes this error over here when I call poetry build:

Preparing build environment with build-system requirements poetry-core>=1.0.0
Building solidpython2 (2.0.1)
Traceback (most recent call last):
  File "/[..]/SolidPython/setup.py", line 2, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'

Command '['/tmp/tmpkz3ceeao/.venv/bin/python', '/[..]/SolidPython/setup.py', 'build', '-b', '/[..]/SolidPython/build']' returned non-zero exit status 1.


Note: setuptools is installed

changing the pyproject.toml file like this:

[tool.poetry.build]
generate-setup-file = false
script = "prebuild.py"

makes the call work again, but the build process creates a different file!?! solidpython2-2.0.1-cp310-cp310-manylinux_2_35_x86_64.whl instead of solidpython2-2.0.1-py3-none-any.whl

@ssuchter Any idea what's going on there?

@jeff-dh
Copy link
Owner Author

jeff-dh commented Apr 21, 2023

maybe related:

python-poetry/poetry#5401

@ssuchter
Copy link

ssuchter commented Apr 21, 2023 via email

@jeff-dh
Copy link
Owner Author

jeff-dh commented Apr 21, 2023 via email

@ssuchter
Copy link

ssuchter commented Apr 21, 2023 via email

@jeff-dh
Copy link
Owner Author

jeff-dh commented Apr 22, 2023

Do you have all necessary information?

If you remove the whole [tool.poetry.build] section, it creates a *py3-none-any.whl file (as it used to be). With the prebuild.py call and generate-setup-file = false it produces *cp310-cp310-manylinux_2_35_x86_64.whl which is according to this less compatible.

Does it behave the same on your system?

@ssuchter
Copy link

I'll take a look tonight (California time)

@ssuchter
Copy link

Ok, I've reproduced the issue, looked through poetry code, and found that for some bizarre reason, poetry doesn't support using a build script and producing a pure python wheel. Others complain about the same issue:

python-poetry/poetry#2051

I'm trying a workaround from that issue now.

@ssuchter
Copy link

I think the lack in underlying poetry is hard to work around. I think the right thing to do is to not use the prebuild script. Originally, it was being used to autogenerate stubs, but you changed my mind on that. Now it's just validating that the submodules got initialized, but we can use the tests to validate that now. I'll make a PR for this trivial change.

@ssuchter
Copy link

Here's the PR for you: #28

@jeff-dh jeff-dh closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants