Skip to content

Commit

Permalink
moving to uv
Browse files Browse the repository at this point in the history
SermetPekin committed Sep 11, 2024
1 parent 025e5bd commit 054816e
Showing 10 changed files with 556 additions and 43 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import traceback

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -53,8 +54,8 @@
# html_extra_path= ["extras"]
try:
os.makedirs(html_static_path[0])
except:
pass
except Exception:
traceback.print_exc()

source_suffix = {
".rst": "restructuredtext",
@@ -63,7 +64,6 @@
}


from sphinx.util import logging

logger = logging.getLogger(__name__)

6 changes: 5 additions & 1 deletion evdschat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from evdschat.core.chat import chat , chat_console
from evdschat.core.chat import chat, chat_console

__all__ = [
chat, chat_console
]
6 changes: 2 additions & 4 deletions evdschat/core/builder.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import traceback
from dataclasses import dataclass, field

from ..model.chatters import ModelAbstract, OpenAI
@@ -21,11 +20,10 @@

@dataclass
class Builder:
retriever = field(default_factory=ModelAbstract)
api_key = field(default_factory=ApiKey)
retriever: ModelAbstract = field(default_factory=ModelAbstract)
api_key: ApiKey = field(default_factory=ApiKey)


def build_openai():

builder = Builder(OpenAI(), OpenaiApiKey(get_openai_key()))
return builder
2 changes: 1 addition & 1 deletion evdschat/core/chat.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
from evdschat.model.chatters import ModelAbstract, OpenAI
from ..common.github_actions import PytestTesting
from typing import TypeVar, Tuple, Union
from .result import ResultChat, Status
from .result import ResultChat

# Result = TypeVar("Result")
Notes = TypeVar("Notes")
8 changes: 3 additions & 5 deletions evdschat/model/chatters.py
Original file line number Diff line number Diff line change
@@ -17,19 +17,17 @@
from typing import Callable, Any, Tuple, Union
from abc import ABC
import requests
from evdspy import get_series_exp, get_series
from evdspy import get_series_exp
from evdschat.common.akeys import get_openai_key
from dataclasses import dataclass, field
from dataclasses import dataclass
from evdschat.common.globals import global_mock
from ..common.bridge import c_caller_main
from evdschat.common.akeys import ApiKey

import os
from pathlib import Path

import pandas as pd

from evdschat.core.result import Result, ResultChat, create_result
from evdschat.core.result import ResultChat, create_result
from evdschat.core.result import Status


39 changes: 20 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
[tool.poetry]
[project]
name = "evdschat"
version = "0.1.6"
version = "0.1.7"
description = "evdschat is an open-source Python package designed to enhance the evdspy package by allowing users to interact with the evdschat Application. This Node.js project aims to provide the most specific and accurate data users request during conversations, based on arguments such as start date, end date, and aggregation type, as described in the evdspy."
authors = ["sermet.pekin <Sermet.Pekin@gmail.com>"]
license = "CC BY-NC 4.0"
authors = [
{ name = "Sermet Pekin", email = "Sermet.Pekin@gmail.com" }
]
license = { file = "LICENSE" }
readme = "README.md"
repository = "https://github.com/SermetPekin/evdschat" # Add this line
keywords = ["evdspy", "evdschat", "chatbot", "data-aggregation", "open-source", "Node.js", "Python", "API", "TCMB", "CBRT", "Generative AI"]


[tool.poetry.dependencies]
python = "^3.9"
evdspy = ">=1.1.40"
rich = ">=13.7.1"
requests = ">=2.32.3"
python-dotenv = ">=1.0.1"
requires-python = ">=3.10"
dependencies = [
"evdspy>=1.1.40",
"rich>=13.8.1",
]
[project.urls]
repository = "https://github.com/SermetPekin/evdschat"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.2"
ruff = "^0.5.6"
tox = "^4.16.0"

[tool.poetry.scripts]
[scripts]
evdschat = "evdschat:chat_console"

[build-system]
requires = ["poetry-core>=1.0.0", "setuptools>=42.0.0"]
build-backend = "setuptools.build_meta"
[tool.uv]
dev-dependencies = [
"pytest>=8.3.3",
"ruff>=0.6.4",
"tox>=4.18.1",
]
29 changes: 29 additions & 0 deletions pyprojectPoetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tool.poetry]
name = "evdschat"
version = "0.1.6"
description = "evdschat is an open-source Python package designed to enhance the evdspy package by allowing users to interact with the evdschat Application. This Node.js project aims to provide the most specific and accurate data users request during conversations, based on arguments such as start date, end date, and aggregation type, as described in the evdspy."
authors = ["sermet.pekin <Sermet.Pekin@gmail.com>"]
license = "CC BY-NC 4.0"
readme = "README.md"
repository = "https://github.com/SermetPekin/evdschat" # Add this line
keywords = ["evdspy", "evdschat", "chatbot", "data-aggregation", "open-source", "Node.js", "Python", "API", "TCMB", "CBRT", "Generative AI"]


[tool.poetry.dependencies]
python = "^3.9"
evdspy = ">=1.1.40"
rich = ">=13.7.1"
requests = ">=2.32.3"
python-dotenv = ">=1.0.1"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.2"
ruff = "^0.5.6"
tox = "^4.16.0"

[tool.poetry.scripts]
evdschat = "evdschat:chat_console"

[build-system]
requires = ["poetry-core>=1.0.0", "setuptools>=42.0.0"]
build-backend = "setuptools.build_meta"
16 changes: 6 additions & 10 deletions tests/test_req.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import json
import pytest
import ctypes
import os
import platform
from pathlib import Path
from importlib import resources
from typing import Union
import platform

from evdschat.model.chatters import get_myapi_url, get_openai_key
from evdschat.model.chatters import TestAI, get_myapi_url
from evdschat.model.chatters import (
get_openai_key,
TestAI,
get_myapi_url
)


def get_exec_file(test=False) -> Path:

executable_name = "libpost_request.so"
if platform.system() == "Windows":
executable_name = "libpost_request.dll"
@@ -45,7 +43,6 @@ def test_post_c():


def get_c_fnc():

class PostParams(ctypes.Structure):
_fields_ = [
("url", ctypes.c_char_p),
@@ -54,7 +51,7 @@ class PostParams(ctypes.Structure):
("proxy_url", ctypes.c_char_p),
]

lib_path = get_exec_file() # check_c_executable()
lib_path = get_exec_file() # check_c_executable()
if lib_path.exists():
lib = ctypes.CDLL(lib_path)

@@ -83,5 +80,4 @@ def c_caller_main(prompt, api_key, url, proxy=None):

return c_caller_main


# test_post_c()
486 changes: 486 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 054816e

Please sign in to comment.