Bug 269876 - misc/py-openai: Missing some dependencies
Summary: misc/py-openai: Missing some dependencies
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-28 14:28 UTC by Rainer Hurling
Modified: 2023-03-02 07:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
Patch to add some RUN_DEPENDS (771 bytes, patch)
2023-02-28 14:28 UTC, Rainer Hurling
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling freebsd_committer freebsd_triage 2023-02-28 14:28:11 UTC
Created attachment 240481 [details]
Patch to add some RUN_DEPENDS

Many thanks for this new port! Very appreciated and needed for example for the QGIS plugin QChatGPT :)

Unfortunately using py-openai is broken because of missing depencencies, escpecially py-aiohttp:

# python3
Python 3.9.16 (main, Feb 28 2023, 07:54:21) 
[Clang 15.0.7 (https://github.com/llvm/llvm-project.git llvmorg-15.0.7-0-g8dfdc on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> import openai
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/openai/__init__.py", line 9, in <module>
    from openai.api_resources import (
  File "/usr/local/lib/python3.9/site-packages/openai/api_resources/__init__.py", line 1, in <module>
    from openai.api_resources.completion import Completion  # noqa: F401
  File "/usr/local/lib/python3.9/site-packages/openai/api_resources/completion.py", line 4, in <module>
    from openai.api_resources.abstract import DeletableAPIResource, ListableAPIResource
  File "/usr/local/lib/python3.9/site-packages/openai/api_resources/abstract/__init__.py", line 3, in <module>
    from openai.api_resources.abstract.api_resource import APIResource
  File "/usr/local/lib/python3.9/site-packages/openai/api_resources/abstract/api_resource.py", line 4, in <module>
    from openai import api_requestor, error, util
  File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 21, in <module>
    import aiohttp
ModuleNotFoundError: No module named 'aiohttp'


In misc/py-openai, setup.cfg:l.23-25 contains information about needed dependencies. The attached patch should solve this. The file setup.cfg has some more dependencies, which could be useful for using openai.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2023-03-02 07:35:45 UTC
Committed, thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-03-02 07:36:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=09b448dc3e3212ae2dace7cb690887dbfdf76925

commit 09b448dc3e3212ae2dace7cb690887dbfdf76925
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2023-03-02 07:34:19 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-03-02 07:35:44 +0000

    misc/py-openai: Add missing dependencies

    PR:             269876

 misc/py-openai/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)