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

Limit setup.py for python version #5899

Closed
wants to merge 4 commits into from
Closed

Conversation

Burhan-Q
Copy link
Member

@Burhan-Q Burhan-Q commented Oct 23, 2023

Restrict setup.py for installs on any python 3.12 environments. Since PyTorch does not yet support python 3.12, adding upper bound !=3.12.* to prevent users from attempting installation when using python 3.12. Observed multiple users reporting issues in Discord related to attempted installation using python 3.12.

Example of error shown during python 3.12 install

image

🤖 Generated by Copilot at 8fe8c03

Summary

⬆️🚫📝

Updated package metadata and documentation to reflect current status and requirements. Restricted python_requires in setup.py to exclude future Python 3.12 version.

python_requires
No future version for now
Autumn leaves falling

Walkthrough

  • Exclude Python 3.12 from the supported versions (link) to avoid potential compatibility issues with future releases

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Upping the Python version compatibility for Ultralytics package.

📊 Key Changes

  • The Python version requirement for the ultralytics package has been updated to support versions between 3.8 and before 3.12.

🎯 Purpose & Impact

  • Ensure Compatibility: This change ensures that the Ultralytics package is compatible with a wider but specific range of Python versions, preventing potential issues with newer, yet unsupported Python versions.
  • Future-Proofing: Helps in maintaining the library's functionality across various Python environments, ensuring users have a smooth experience without running into compatibility issues.
  • Impact to Users: Users must now be mindful of the Python version they are using when installing the ultralytics package. It provides clarity on which versions are officially supported, reducing the chances of encountering unexpected bugs due to version incompatibilities. 🐍✨

Restrict setup.py for installs on any python 3.12 environments.
@Burhan-Q
Copy link
Member Author

User claimed they were on python 3.11.5 when sharing screenshot, but scipy wheel gave away they were using 3.12. A minor update/change, but trying to follow the principle of poka yoke with this PR.

Reformat to use single string
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #5899 (7bb1eee) into main (77fc5cc) will decrease coverage by 4.96%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #5899      +/-   ##
==========================================
- Coverage   87.08%   82.13%   -4.96%     
==========================================
  Files         103      103              
  Lines       12485    12485              
==========================================
- Hits        10873    10254     -619     
- Misses       1612     2231     +619     
Flag Coverage Δ
Benchmarks 39.11% <ø> (ø)
GPU 17.73% <ø> (-28.62%) ⬇️
Tests 79.03% <ø> (-2.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 28 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@glenn-jocher
Copy link
Member

@Burhan-Q yeah this is a good idea to avoid confusion. I don't see any 3.12 usage from our analytics, but I have seen this strange plot from https://pypistats.org/packages/ultralytics

Screenshot 2023-10-24 at 10 50 25

@Burhan-Q
Copy link
Member Author

@glenn-jocher a few thoughts on where the python 3.12 numbers could come from (no clue on the 3.13)

  1. CI/CD runners where there constraint is only >=3.8 could now include 3.12 since it's a stable release

  2. User installs where they install Ultralytics in a python 3.12 environment, but never attempt to run it

  3. Apparently PyTorch does support 3.12 if you compile it manually, but not all modules are functional according to Pytorch for Python 3.12 not available pytorch/pytorch#110436 so maybe some users/developers are working on this?

I wanted to add this because the error thrown is so vague and if I hadn't noticed the other libraries, it would have been time consuming to troubleshoot. I'm only proposing this as a short-term fix until PyTorch (and any other libraries) have stable python 3.12 compatibility.

@glenn-jocher
Copy link
Member

@Burhan-Q oh yeah, that's a good point, we need to support locally built torch releases, which may include 3.12, so we can't limit the pip install to only <3.12 environments.

It's likely we do support 3.12 as long as torch does. I haven't had time to try to build from source and check though.

@Burhan-Q
Copy link
Member Author

That's understandable. I don't know enough of the ins and outs for setuptools to know if this would be difficult, but I wonder if it would be possible to allow for different python versions under [dev] installs versus "vanilla" installs? Anyhow, I understand and will be on the lookout out for common python 3.12 errors in the meantime.

@Burhan-Q
Copy link
Member Author

@glenn-jocher sorry for the ping, but it looks like PyTorch is getting close-ish to a Python 3.12 release pytorch/pytorch#112882 I'm going to track this PR and once there are wheels built, I may try downloading one and test with Ultralytics.

@glenn-jocher
Copy link
Member

@Burhan-Q yeah sounds good :)

@Burhan-Q
Copy link
Member Author

@Burhan-Q

@Burhan-Q Burhan-Q mentioned this pull request Dec 6, 2023
8 tasks
@Burhan-Q Burhan-Q closed this Apr 9, 2024
@Burhan-Q Burhan-Q deleted the patch-6 branch May 24, 2024 00:13
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

Successfully merging this pull request may close these issues.

None yet

2 participants