diff --git a/.gitignore b/.gitignore index 399b28c..ae1bb3f 100644 --- a/.gitignore +++ b/.gitignore @@ -153,4 +153,6 @@ lite/jupyterlite-icortex/style/icortex.png lite/jupyterlite-icortex/LICENSE node_modules/ *.tsbuildinfo -*_backup \ No newline at end of file +*_backup +misc/ +/icortex.toml \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5c14347 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + # It is recommended to specify the latest version of Python + # supported by your project here, or alternatively use + # pre-commit's default_language_version, see + # https://pre-commit.com/#top_level-default_language_version + language_version: python3.10 \ No newline at end of file diff --git a/icortex/context.py b/icortex/context.py index 6d8bf73..1aa17c7 100644 --- a/icortex/context.py +++ b/icortex/context.py @@ -284,11 +284,14 @@ def from_file(path: str, scope: t.Dict[str, t.Any] = None): raise FileNotFoundError(f"File {path} does not exist") with open(path, "r") as f: - dict_ = json.load(f) + context_dict = json.load(f) + return ICortexContext.from_dict(context_dict, scope) + + def from_dict(context_dict: t.Dict[str, t.Any], scope: t.Dict[str, t.Any] = None): ret = ICortexContext(scope=scope) - for cell_dict in dict_["cells"]: + for cell_dict in context_dict["cells"]: if cell_dict["metadata"]["source_type"] == "code": cell = CodeCell.from_dict(cell_dict) elif cell_dict["metadata"]["source_type"] == "var": @@ -301,7 +304,7 @@ def from_file(path: str, scope: t.Dict[str, t.Any] = None): ) ret._cells.append(cell) - ret._vars = [Var.from_dict(v) for v in dict_["metadata"]["variables"]] + ret._vars = [Var.from_dict(v) for v in context_dict["metadata"]["variables"]] return ret @@ -333,24 +336,20 @@ def run(self, notebook_args: t.List[str]): # Execute the returned code exec(code, scope) - def bake(self, dest_path: str, format=True): - """Bake the notebook to a Python script""" + def get_code(self, argparsify=False): + """Aggregates the code for the notebook""" - # Warn if the extension is not .py - if not dest_path.endswith(".py"): - print( - f"Warning: {dest_path} does not have the .py extension. " - "It is recommended that you use the .py extension for " - "frozen files." - ) + output = "" + if argparsify: + # scope = locals() + vars = self.vars - vars = self.vars - scope = locals() - - output = "import argparse\n\nparser = argparse.ArgumentParser()\n" - for var in vars: - output += f"parser.add_argument({var.arg!r}, type={var._type.__name__})\n" - output += "args = parser.parse_args()\n\n" + output += "import argparse\n\nparser = argparse.ArgumentParser()\n" + for var in vars: + output += ( + f"parser.add_argument({var.arg!r}, type={var._type.__name__})\n" + ) + output += "args = parser.parse_args()\n\n" for cell in self.iter_cells(): if cell.success: @@ -358,8 +357,11 @@ def bake(self, dest_path: str, format=True): var = cell.var # Change the value to that of the parsed argument # var.value = var._type(getattr(parsed_args, var.arg)) - code = f"{var.name} = args.{var.arg}\n\n" - # code = var.get_code() + if argparsify: + code = f"{var.name} = args.{var.arg}\n\n" + else: + code = var.get_code() + elif isinstance(cell, CodeCell): if not is_magic(cell.get_code()): code = cell.get_code().rstrip() + "\n\n" @@ -371,9 +373,25 @@ def bake(self, dest_path: str, format=True): # Execute the returned code output += code + return output + + def bake(self, dest_path: str, format=True): + """Bake the notebook to a Python script""" + + # Warn if the extension is not .py + if not dest_path.endswith(".py"): + print( + f"Warning: {dest_path} does not have the .py extension. " + "It is recommended that you use the .py extension for " + "frozen files." + ) + + output = self.get_code(argparsify=True) + # Run black over output if format: import black + try: output = black.format_str(output, mode=black.FileMode()) except: diff --git a/icortex/init.py b/icortex/init.py index 64b309d..d5073b7 100644 --- a/icortex/init.py +++ b/icortex/init.py @@ -12,4 +12,4 @@ ICortexShell._init_icortex_shell(__main__.get_ipython()) # load_ipython_extension(get_ipython()) else: - raise Exception("IPython is not available, cannot initialize ICortex.") \ No newline at end of file + raise Exception("IPython is not available, cannot initialize ICortex.") diff --git a/icortex/services/echo.py b/icortex/services/echo.py index 1b1aef3..e430920 100644 --- a/icortex/services/echo.py +++ b/icortex/services/echo.py @@ -5,6 +5,7 @@ from icortex.helper import escape_quotes from icortex.services.generation_result import GenerationResult + class EchoService(ServiceBase): name = "echo" description = "Service used for testing" diff --git a/icortex/services/service_base.py b/icortex/services/service_base.py index c00636c..c6d98eb 100644 --- a/icortex/services/service_base.py +++ b/icortex/services/service_base.py @@ -17,6 +17,7 @@ from icortex.services.service_interaction import ServiceInteraction from icortex.parser import lex_prompt + def is_str_repr(s: str): quotes = ["'", '"'] return len(s) >= 2 and s[0] in quotes and s[-1] in quotes @@ -159,9 +160,7 @@ def __init__(self, **kwargs: t.Dict[str, t.Any]): required=DEFAULT_AUTO_INSTALL_PACKAGES, help="Auto-install packages that are imported in the generated code but missing in the active Python environment.", ) - self.prompt_parser.usage = ( - "%%prompt your prompt goes here [-e] [-r] [-p] ..." - ) + self.prompt_parser.usage = "%%prompt your prompt goes here [-e] [-r] [-p] ..." self.prompt_parser.description = self.description diff --git a/icortex/services/textcortex.py b/icortex/services/textcortex.py index 8100246..d4ad3d9 100644 --- a/icortex/services/textcortex.py +++ b/icortex/services/textcortex.py @@ -26,9 +26,9 @@ # Load alternative URI from the environment try: - from dotenv import load_dotenv + from dotenv import load_dotenv, find_dotenv - load_dotenv() + load_dotenv(find_dotenv(usecwd=True)) ICORTEX_ENDPOINT_URI = os.environ.get("ICORTEX_ENDPOINT_URI", ICORTEX_ENDPOINT_URI) except: pass diff --git a/icortex/var.py b/icortex/var.py index 599bc94..4c8bfee 100644 --- a/icortex/var.py +++ b/icortex/var.py @@ -16,6 +16,7 @@ # "set": set, } + class Var: def __init__(self, arg, name, value, type, description=None): self.arg = arg diff --git a/poetry.lock b/poetry.lock index 4e7fa5e..d247892 100644 --- a/poetry.lock +++ b/poetry.lock @@ -104,13 +104,21 @@ python-versions = "*" [package.dependencies] pycparser = "*" +[[package]] +name = "cfgv" +version = "3.3.1" +description = "Validate configuration and produce human readable error messages." +category = "dev" +optional = false +python-versions = ">=3.6.1" + [[package]] name = "charset-normalizer" -version = "2.0.12" +version = "2.1.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false -python-versions = ">=3.5.0" +python-versions = ">=3.6.0" [package.extras] unicode_backport = ["unicodedata2"] @@ -165,6 +173,14 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "distlib" +version = "0.3.6" +description = "Distribution utilities" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "docutils" version = "0.19" @@ -205,7 +221,7 @@ name = "filelock" version = "3.8.0" description = "A platform independent file lock." category = "main" -optional = true +optional = false python-versions = ">=3.7" [package.extras] @@ -236,7 +252,7 @@ sphinx-basic-ng = "*" [[package]] name = "huggingface-hub" -version = "0.10.1" +version = "0.11.0" description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" category = "main" optional = true @@ -252,14 +268,15 @@ tqdm = "*" typing-extensions = ">=3.7.4.3" [package.extras] -all = ["InquirerPy (==0.3.4)", "Jinja2", "black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "jedi", "mypy", "pytest", "pytest-cov", "soundfile"] +all = ["InquirerPy (==0.3.4)", "Jinja2", "black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "jedi", "mypy (==0.982)", "pytest", "pytest-cov", "pytest-env", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3"] cli = ["InquirerPy (==0.3.4)"] -dev = ["InquirerPy (==0.3.4)", "Jinja2", "black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "jedi", "mypy", "pytest", "pytest-cov", "soundfile"] +dev = ["InquirerPy (==0.3.4)", "Jinja2", "black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "jedi", "mypy (==0.982)", "pytest", "pytest-cov", "pytest-env", "soundfile", "types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3"] fastai = ["fastai (>=2.4)", "fastcore (>=1.3.27)", "toml"] -quality = ["black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "mypy"] +quality = ["black (==22.3)", "flake8 (>=3.8.3)", "flake8-bugbear", "isort (>=5.5.4)", "mypy (==0.982)"] tensorflow = ["graphviz", "pydot", "tensorflow"] -testing = ["InquirerPy (==0.3.4)", "Jinja2", "isort (>=5.5.4)", "jedi", "pytest", "pytest-cov", "soundfile"] +testing = ["InquirerPy (==0.3.4)", "Jinja2", "isort (>=5.5.4)", "jedi", "pytest", "pytest-cov", "pytest-env", "soundfile"] torch = ["torch"] +typing = ["types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3"] [[package]] name = "humanfriendly" @@ -273,6 +290,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" pyreadline = {version = "*", markers = "sys_platform == \"win32\" and python_version < \"3.8\""} pyreadline3 = {version = "*", markers = "sys_platform == \"win32\" and python_version >= \"3.8\""} +[[package]] +name = "identify" +version = "2.5.9" +description = "File identification library for Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +license = ["ukkonen"] + [[package]] name = "idna" version = "3.4" @@ -406,7 +434,7 @@ test = ["jsonschema", "pytest (>=3.6.0)", "pytest-cov", "pytz"] [[package]] name = "jedi" -version = "0.18.1" +version = "0.18.2" description = "An autocompletion tool for Python that can be used for text editors." category = "main" optional = false @@ -416,8 +444,9 @@ python-versions = ">=3.6" parso = ">=0.8.0,<0.9.0" [package.extras] +docs = ["Jinja2 (==2.11.3)", "MarkupSafe (==1.1.1)", "Pygments (==2.8.1)", "alabaster (==0.7.12)", "babel (==2.9.1)", "chardet (==4.0.0)", "commonmark (==0.8.1)", "docutils (==0.17.1)", "future (==0.18.2)", "idna (==2.10)", "imagesize (==1.2.0)", "mock (==1.0.1)", "packaging (==20.9)", "pyparsing (==2.4.7)", "pytz (==2021.1)", "readthedocs-sphinx-ext (==2.1.4)", "recommonmark (==0.5.0)", "requests (==2.25.1)", "six (==1.15.0)", "snowballstemmer (==2.1.0)", "sphinx (==1.8.5)", "sphinx-rtd-theme (==0.4.3)", "sphinxcontrib-serializinghtml (==1.1.4)", "sphinxcontrib-websupport (==1.2.4)", "urllib3 (==1.26.4)"] qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] -testing = ["Django (<3.1)", "colorama", "docopt", "pytest (<7.0.0)"] +testing = ["Django (<3.1)", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "Jinja2" @@ -435,7 +464,7 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "jupyter-client" -version = "7.4.6" +version = "7.4.7" description = "Jupyter protocol implementation and client libraries" category = "main" optional = false @@ -542,6 +571,17 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "nodeenv" +version = "1.7.0" +description = "Node.js virtual environment builder" +category = "dev" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" + +[package.dependencies] +setuptools = "*" + [[package]] name = "numpy" version = "1.21.1" @@ -665,7 +705,7 @@ et-xmlfile = "*" [[package]] name = "optimum" -version = "1.4.1" +version = "1.5.0" description = "Optimum Library is an extension of the Hugging Face Transformers library, providing a framework to integrate third-party libraries from Hardware Partners and interface with their specific functionality." category = "main" optional = true @@ -673,7 +713,7 @@ python-versions = ">=3.7.0" [package.dependencies] coloredlogs = "*" -huggingface_hub = ">=0.8.0" +huggingface-hub = ">=0.8.0" numpy = "*" packaging = "*" sympy = "*" @@ -683,6 +723,8 @@ transformers = {version = ">=4.20.1", extras = ["sentencepiece"]} [package.extras] benchmark = ["evaluate (>=0.2.0)", "optuna", "seqeval", "sklearn", "torchvision", "tqdm"] dev = ["Pillow", "black (>=22.0,<23.0)", "flake8 (>=3.8.3)", "isort (>=5.5.4)", "parameterized", "pytest", "pytest-xdist", "requests"] +exporters = ["onnx", "onnxruntime", "timm"] +exporters-tf = ["onnx", "onnxruntime", "tensorflow", "tf2onnx", "timm"] graphcore = ["optimum-graphcore"] habana = ["optimum-habana"] intel = ["optimum-intel"] @@ -811,9 +853,26 @@ importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pre-commit" +version = "2.20.0" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +toml = "*" +virtualenv = ">=20.0.8" + [[package]] name = "prompt-toolkit" -version = "3.0.32" +version = "3.0.33" description = "Library for building powerful interactive command lines in Python" category = "main" optional = false @@ -967,7 +1026,7 @@ name = "PyYAML" version = "6.0" description = "YAML parser and emitter for Python" category = "main" -optional = true +optional = false python-versions = ">=3.6" [[package]] @@ -1018,7 +1077,7 @@ python-versions = "*" [[package]] name = "setuptools" -version = "65.5.1" +version = "65.6.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false @@ -1384,6 +1443,24 @@ brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +[[package]] +name = "virtualenv" +version = "20.16.7" +description = "Virtual Python Environment builder" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +distlib = ">=0.3.6,<1" +filelock = ">=3.4.1,<4" +importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} +platformdirs = ">=2.4,<3" + +[package.extras] +docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"] +testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"] + [[package]] name = "wcwidth" version = "0.2.5" @@ -1430,7 +1507,7 @@ openai = ["openai"] [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<4" -content-hash = "d36f2f609f262fa1aeb4c62453d07634b4741451b9efbbbbd8f69da4968c1a14" +content-hash = "8fbac6a28f8175ec8acb80ed96bf55dd23004872dc24db3fa0fde5d5baa8e3f9" [metadata.files] alabaster = [ @@ -1550,9 +1627,13 @@ cffi = [ {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, ] +cfgv = [ + {file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"}, + {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, +] charset-normalizer = [ - {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, - {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, + {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, + {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, ] click = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, @@ -1590,6 +1671,10 @@ decorator = [ {file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"}, {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, ] +distlib = [ + {file = "distlib-0.3.6-py2.py3-none-any.whl", hash = "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e"}, + {file = "distlib-0.3.6.tar.gz", hash = "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46"}, +] docutils = [ {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, @@ -1619,13 +1704,17 @@ furo = [ {file = "furo-2022.9.29.tar.gz", hash = "sha256:d4238145629c623609c2deb5384f8d036e2a1ee2a101d64b67b4348112470dbd"}, ] huggingface-hub = [ - {file = "huggingface_hub-0.10.1-py3-none-any.whl", hash = "sha256:dc3b0e9a663fe6cad6a8522055c02a9d8673dbd527223288e2442bc028c253db"}, - {file = "huggingface_hub-0.10.1.tar.gz", hash = "sha256:5c188d5b16bec4b78449f8681f9975ff9d321c16046cc29bcf0d7e464ff29276"}, + {file = "huggingface_hub-0.11.0-py3-none-any.whl", hash = "sha256:1f540c6d57cb1684d3578d7bf2d35041a5145b17e8af932505db7f4fbcc7640d"}, + {file = "huggingface_hub-0.11.0.tar.gz", hash = "sha256:b48860d791502c2b8a0e6c841214df19c67999198a75d1417512b45752508ac6"}, ] humanfriendly = [ {file = "humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477"}, {file = "humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc"}, ] +identify = [ + {file = "identify-2.5.9-py2.py3-none-any.whl", hash = "sha256:a390fb696e164dbddb047a0db26e57972ae52fbd037ae68797e5ae2f4492485d"}, + {file = "identify-2.5.9.tar.gz", hash = "sha256:906036344ca769539610436e40a684e170c3648b552194980bb7b617a8daeb9f"}, +] idna = [ {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, @@ -1658,16 +1747,16 @@ ipywidgets = [ {file = "ipywidgets-8.0.2.tar.gz", hash = "sha256:08cb75c6e0a96836147cbfdc55580ae04d13e05d26ffbc377b4e1c68baa28b1f"}, ] jedi = [ - {file = "jedi-0.18.1-py2.py3-none-any.whl", hash = "sha256:637c9635fcf47945ceb91cd7f320234a7be540ded6f3e99a50cb6febdfd1ba8d"}, - {file = "jedi-0.18.1.tar.gz", hash = "sha256:74137626a64a99c8eb6ae5832d99b3bdd7d29a3850fe2aa80a4126b2a7d949ab"}, + {file = "jedi-0.18.2-py2.py3-none-any.whl", hash = "sha256:203c1fd9d969ab8f2119ec0a3342e0b49910045abe6af0a3ae83a5764d54639e"}, + {file = "jedi-0.18.2.tar.gz", hash = "sha256:bae794c30d07f6d910d32a7048af09b5a39ed740918da923c6b780790ebac612"}, ] Jinja2 = [ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, ] jupyter-client = [ - {file = "jupyter_client-7.4.6-py3-none-any.whl", hash = "sha256:540b6a5c9c2dc481c5dd54fd5acb260f03dfaaa7c5325b2ffb1f676710f8c7c4"}, - {file = "jupyter_client-7.4.6.tar.gz", hash = "sha256:f7f9a9dc3a0ecd223ed6a5a00cf4140a5c252ec72e52d6de370748ed0aa083dd"}, + {file = "jupyter_client-7.4.7-py3-none-any.whl", hash = "sha256:df56ae23b8e1da1b66f89dee1368e948b24a7f780fa822c5735187589fc4c157"}, + {file = "jupyter_client-7.4.7.tar.gz", hash = "sha256:330f6b627e0b4bf2f54a3a0dd9e4a22d2b649c8518168afedce2c96a1ceb2860"}, ] jupyter-console = [ {file = "jupyter_console-6.4.4-py3-none-any.whl", hash = "sha256:756df7f4f60c986e7bc0172e4493d3830a7e6e75c08750bbe59c0a5403ad6dee"}, @@ -1739,6 +1828,10 @@ nest-asyncio = [ {file = "nest_asyncio-1.5.6-py3-none-any.whl", hash = "sha256:b9a953fb40dceaa587d109609098db21900182b16440652454a146cffb06e8b8"}, {file = "nest_asyncio-1.5.6.tar.gz", hash = "sha256:d267cc1ff794403f7df692964d1d2a3fa9418ffea2a3f6859a439ff482fef290"}, ] +nodeenv = [ + {file = "nodeenv-1.7.0-py2.py3-none-any.whl", hash = "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e"}, + {file = "nodeenv-1.7.0.tar.gz", hash = "sha256:e0e7f7dfb85fc5394c6fe1e8fa98131a2473e04311a45afb6508f7cf1836fa2b"}, +] numpy = [ {file = "numpy-1.21.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38e8648f9449a549a7dfe8d8755a5979b45b3538520d1e735637ef28e8c2dc50"}, {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fd7d7409fa643a91d0a05c7554dd68aa9c9bb16e186f6ccfe40d6e003156e33a"}, @@ -1846,7 +1939,8 @@ openpyxl = [ {file = "openpyxl-3.0.10.tar.gz", hash = "sha256:e47805627aebcf860edb4edf7987b1309c1b3632f3750538ed962bbcc3bd7449"}, ] optimum = [ - {file = "optimum-1.4.1.tar.gz", hash = "sha256:f10fdc4e1a9045a375ec78ffd66aad006458d96dbd378e8a5fe0ee997ee10903"}, + {file = "optimum-1.5.0-py3-none-any.whl", hash = "sha256:de642ec67cfa462f7acd7dfc8aa012e904ffff0ccfb6b5c2d0e9abf1e5a12665"}, + {file = "optimum-1.5.0.tar.gz", hash = "sha256:5b660fa64c33e44e7d9e3f670a9c7b04889f679ea780a7a6368079f847db5919"}, ] packaging = [ {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, @@ -1911,9 +2005,13 @@ pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, ] +pre-commit = [ + {file = "pre_commit-2.20.0-py2.py3-none-any.whl", hash = "sha256:51a5ba7c480ae8072ecdb6933df22d2f812dc897d5fe848778116129a681aac7"}, + {file = "pre_commit-2.20.0.tar.gz", hash = "sha256:a978dac7bc9ec0bcee55c18a277d553b0f419d259dadb4b9418ff2d00eb43959"}, +] prompt-toolkit = [ - {file = "prompt_toolkit-3.0.32-py3-none-any.whl", hash = "sha256:24becda58d49ceac4dc26232eb179ef2b21f133fecda7eed6018d341766ed76e"}, - {file = "prompt_toolkit-3.0.32.tar.gz", hash = "sha256:e7f2129cba4ff3b3656bbdda0e74ee00d2f874a8bcdb9dd16f5fec7b3e173cae"}, + {file = "prompt_toolkit-3.0.33-py3-none-any.whl", hash = "sha256:ced598b222f6f4029c0800cefaa6a17373fb580cd093223003475ce32805c35b"}, + {file = "prompt_toolkit-3.0.33.tar.gz", hash = "sha256:535c29c31216c77302877d5120aef6c94ff573748a5b5ca5b1b1f76f5e700c73"}, ] protobuf = [ {file = "protobuf-3.20.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3cc797c9d15d7689ed507b165cd05913acb992d78b379f6014e013f9ecb20996"}, @@ -2268,8 +2366,8 @@ sentencepiece = [ {file = "sentencepiece-0.1.97.tar.gz", hash = "sha256:c901305e0a710bbcd296f66d79e96f744e6e175b29812bd5178318437d4e1f6c"}, ] setuptools = [ - {file = "setuptools-65.5.1-py3-none-any.whl", hash = "sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31"}, - {file = "setuptools-65.5.1.tar.gz", hash = "sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f"}, + {file = "setuptools-65.6.1-py3-none-any.whl", hash = "sha256:9b1b1b4129877c74b0f77de72b64a1084a57ccb106e7252f5fb70f192b3d9055"}, + {file = "setuptools-65.6.1.tar.gz", hash = "sha256:1da770a0ee69681e4d2a8196d0b30c16f25d1c8b3d3e755baaedc90f8db04963"}, ] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, @@ -2455,6 +2553,10 @@ urllib3 = [ {file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"}, {file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"}, ] +virtualenv = [ + {file = "virtualenv-20.16.7-py3-none-any.whl", hash = "sha256:efd66b00386fdb7dbe4822d172303f40cd05e50e01740b19ea42425cbe653e29"}, + {file = "virtualenv-20.16.7.tar.gz", hash = "sha256:8691e3ff9387f743e00f6bb20f70121f5e4f596cae754531f2b3b3a1b1ac696e"}, +] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, diff --git a/pyproject.toml b/pyproject.toml index cc4e931..9064bbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "icortex" -version = "0.1.3" +version = "0.1.4" description = "Jupyter kernel that can generate Python code from natural language prompts" authors = ["TextCortex Team "] license = "Apache" @@ -48,8 +48,8 @@ python = ">=3.7.1,<4" toml = "^0.10.2" importlib-metadata = ">=4.0.0" # ipykernel = "^5.5.5" -requests = "^2.28.1" -urllib3 = "^1.26.12" +requests = "^2.0" +urllib3 = "^1.0" ipykernel = "^6.16.0" ipython = ">=7.0.0" entrypoints = "^0.4" @@ -65,7 +65,7 @@ onnx = { version = "^1.12.0", optional = true } optimum = { version = "^1.4.0", optional = true } transformers = { version = "^4.23.1", optional = true } torch = { version = "^1.12.1", optional = true } -black = "^22.10.0" +black = "^22.1" [tool.poetry.extras] openai = ["openai"] @@ -79,6 +79,7 @@ furo = "^2022.9.29" pytest = "^7.1.3" python-dotenv = "^0.21.0" ipdb = "^0.13.9" +pre-commit = "^2.20.0" [build-system] requires = ["poetry-core"]