8000 No module named 'packaging' · Issue #11 · comfuture/function-schema · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

No module named 'packaging' #11

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

Closed
Harsh-br0 opened this issue Sep 26, 2024 · 4 comments
Closed

No module named 'packaging' #11

Harsh-br0 opened this issue Sep 26, 2024 · 4 comments

Comments

@Harsh-br0
Copy link
Contributor

Traceback

Traceback (most recent call last):
  File "C:\Users\Harsh\Desktop\test\k.py", line 1, in <module>
    import function_schema
  File "C:\Users\Harsh\Desktop\test\avenv\lib\site-packages\function_schema\__init__.py", line 4, in <module>
    from .core import get_function_schema, guess_type, Doc, Annotated
  File "C:\Users\Harsh\Desktop\test\avenv\lib\site-packages\function_schema\core.py", line 4, in <module>
    import packaging.version
ModuleNotFoundError: No module named 'packaging'

Steps to Reproduce

  • Install the package with pip install function-schema .
  • Run the following
import function_schema

I think this is very trivial problem and probably will submit a PR too.

This was referenced Sep 26, 2024
@Harsh-br0
Copy link
Contributor Author

Made 2 PRs with 2 different solutions to this, need to pick only one of them.

  • Add packaging to pyproject.toml #12

    Straightforward solution, just fixes the imports and makes the packaging available for future use.

  • ditch packaging #13

    This actually brings separate file utils.py with a func capable of same thing packaging doing previously, and makes this a zero-dependency solution.

personally i prefer #13 and that is why i made 2 PRs.

@comfuture
Copy link
Owner

@Harsh-br0
Thank you for identifying the issue and submitting a PR. It appears that the original packaging module relies on the distutils module to add dependencies, but this may not always be the case depending on the environment. I will strengthen the test environment.

Among the two solutions you proposed, I am considering to choose writing a custom utility because I prefer not to have external dependencies. Additionally, I will review if it is possible to achieve the goal by comparing features instead of version numbers.

@Harsh-br0
Copy link
Contributor Author

Thank you for your quick response and for this amazing utility.

I will review if it is possible to achieve the goal by comparing features instead of version numbers.

That is nice but seems like the feature itself is version dependent (Special Union Type syntax was introduced after py3.10), so it's just makes sense to check on version number but i totally agreed with this idea to have feature specific checks.

At the end, i wanted to say that don't lose motivation real quick on this tool cuz i would like to use it on production too. 🫡
If there's anything possible from my side, i would love to contribute as well.

@comfuture
Copy link
Owner

Thank you for your valuable feedback and kind words about the utility!

I agree that resolving the issue using version number comparison is the right direction for now. However, we will consider implementing feature-specific checks in the future if feasible.

Your encouragement means a lot, and I am committed to continuing development to make this tool production-ready.

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
0