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

setup.py downloads missing from 1.1.0+ #791

Closed
JaimeHolland opened this issue Jul 5, 2024 · 10 comments
Closed

setup.py downloads missing from 1.1.0+ #791

JaimeHolland opened this issue Jul 5, 2024 · 10 comments

Comments

@JaimeHolland
Copy link

Hi, I ran into a problem when trying to build the amazon_kclpy package

The setup.py file for this library downloads some JARs from Maven (and adds them to the wheel) that are required to get an application running.

In build version "1.0.3" this works. In version "1.1.0" onwards, the JARs are no longer being added to the wheel. I was wondering if this is because of a missing wheels dependency, i.e. #716, but I may be wrong.

Do you have any advice about why this has happened, whether there is a workaround, or if the amazon_kclpy project needs to be brought up to date in some way?

@JamesParrott
Copy link

JamesParrott commented Jul 5, 2024

I think you're wondering on exactly on the right lines. This likely is due to the dependency on wheel being removed in 1.10. Have you tried installing wheel in the build environment you're calling build in?


try:
    from wheel.bdist_wheel import bdist_wheel


...

except ImportError:
    pass

@henryiii
Copy link
Contributor

henryiii commented Jul 6, 2024

The package is missing a pyproject.toml file; it should have one that explicitly mentions the wheel dependency (and setup_requires can be retired). Wheel will be present when building wheels, but not when making the SDist, I assume it's because you are going SDist -> Wheel?

You could try going directly to wheel with pipx run build --wheel (or however you use build), and I think that might still work.

By the way, the next release of setuptools will integrate the bdist_wheel command and wheel will start producing warnings if used. So this is likely about to stop working anyway.

@henryiii
Copy link
Contributor

henryiii commented Jul 6, 2024

have you tried installing wheel in the build environment you're calling build in?

You would also need to use --no-isolation if going this path.

@dimbleby
Copy link

dimbleby commented Jul 6, 2024

@JaimeHolland
Copy link
Author

JaimeHolland commented Jul 8, 2024

have you tried installing wheel in the build environment you're calling build in?

You would also need to use --no-isolation if going this path.

Thank you. Using --no-isolation and installing setuptools and wheel (and also pytest-runner) in the environment did work...

@JaimeHolland
Copy link
Author

The package is missing a pyproject.toml file; it should have one that explicitly mentions the wheel dependency (and setup_requires can be retired). Wheel will be present when building wheels, but not when making the SDist, I assume it's because you are going SDist -> Wheel?

You could try going directly to wheel with pipx run build --wheel (or however you use build), and I think that might still work.

By the way, the next release of setuptools will integrate the bdist_wheel command and wheel will start producing warnings if used. So this is likely about to stop working anyway.

It seems like there's a lot of change happening in this area of Python which is good. If this jar-downloading process is considered hacky and bound to stop working at some point anyway, I'll stop trying to fix the behaviour and do something else instead to make sure the files are there when needed. Thanks.

@jakeberg
Copy link

@JaimeHolland What was your solution to this? It's hard to believe that this has gone unnoticed since 1.1.0. We are planning on pulling some of the code from setup.py to download the files in our Docker container.

@henryiii
Copy link
Contributor

Python 3.11 and earlier tend to pre-install wheel. And due to a mistake that is fixed for 3.13, some 3.12 environments include it too. So it likely wasn't really noticed (especially since there's a fallback if wheel is missing). The (temporary) fix is to provide a pyproject.toml that gives the actual requirements. Long-term, this will likely need to be updated for the upcoming changes in setuptools to integrate wheel.

@JaimeHolland
Copy link
Author

@JaimeHolland What was your solution to this? It's hard to believe that this has gone unnoticed since 1.1.0. We are planning on pulling some of the code from setup.py to download the files in our Docker container.

Yes, this is basically what I did as a hack until I find a cleaner / more up-to-date solution

@henryiii
Copy link
Contributor

Ahh, wheel was removed in 70.1. So I think that's why this suddenly is showing up. 70.1+ won't be installing wheel at all because it's not used.

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

5 participants