toolslm 0.3.26__tar.gz → 0.3.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {toolslm-0.3.26/toolslm.egg-info → toolslm-0.3.28}/PKG-INFO +10 -23
- toolslm-0.3.28/pyproject.toml +41 -0
- toolslm-0.3.28/toolslm/__init__.py +1 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/_modidx.py +2 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/funccall.py +29 -10
- {toolslm-0.3.26 → toolslm-0.3.28/toolslm.egg-info}/PKG-INFO +10 -23
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm.egg-info/SOURCES.txt +0 -3
- toolslm-0.3.26/pyproject.toml +0 -11
- toolslm-0.3.26/settings.ini +0 -43
- toolslm-0.3.26/setup.py +0 -57
- toolslm-0.3.26/toolslm/__init__.py +0 -1
- toolslm-0.3.26/toolslm.egg-info/not-zip-safe +0 -1
- {toolslm-0.3.26 → toolslm-0.3.28}/LICENSE +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/MANIFEST.in +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/README.md +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/setup.cfg +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/download.py +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/inspecttools.py +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/md_hier.py +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/shell.py +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm/xml.py +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm.egg-info/dependency_links.txt +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm.egg-info/entry_points.txt +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm.egg-info/requires.txt +0 -0
- {toolslm-0.3.26 → toolslm-0.3.28}/toolslm.egg-info/top_level.txt +0 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toolslm
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.28
|
|
4
4
|
Summary: Tools to make language models a bit easier to use
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Keywords: nbdev
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
5
|
+
Author-email: Jeremy Howard <j@fast.ai>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/AnswerDotAI/toolslm
|
|
8
|
+
Project-URL: Documentation, https://AnswerDotAI.github.io/toolslm
|
|
9
|
+
Keywords: nbdev,jupyter,notebook,python
|
|
12
10
|
Classifier: Natural Language :: English
|
|
13
|
-
Classifier:
|
|
14
|
-
Classifier:
|
|
15
|
-
Classifier:
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
15
|
Requires-Python: >=3.9
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
18
17
|
License-File: LICENSE
|
|
@@ -22,19 +21,7 @@ Requires-Dist: ghapi
|
|
|
22
21
|
Requires-Dist: codesigs
|
|
23
22
|
Provides-Extra: dev
|
|
24
23
|
Requires-Dist: ipython; extra == "dev"
|
|
25
|
-
Dynamic: author
|
|
26
|
-
Dynamic: author-email
|
|
27
|
-
Dynamic: classifier
|
|
28
|
-
Dynamic: description
|
|
29
|
-
Dynamic: description-content-type
|
|
30
|
-
Dynamic: home-page
|
|
31
|
-
Dynamic: keywords
|
|
32
|
-
Dynamic: license
|
|
33
24
|
Dynamic: license-file
|
|
34
|
-
Dynamic: provides-extra
|
|
35
|
-
Dynamic: requires-dist
|
|
36
|
-
Dynamic: requires-python
|
|
37
|
-
Dynamic: summary
|
|
38
25
|
|
|
39
26
|
# toolslm
|
|
40
27
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "toolslm"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Tools to make language models a bit easier to use"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "Apache-2.0"}
|
|
12
|
+
authors = [{name = "Jeremy Howard", email = "j@fast.ai"}]
|
|
13
|
+
keywords = ['nbdev', 'jupyter', 'notebook', 'python']
|
|
14
|
+
classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
|
|
15
|
+
dependencies = ['fastcore>=1.12.4', 'httpx', 'ghapi', 'codesigs']
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Repository = "https://github.com/AnswerDotAI/toolslm"
|
|
19
|
+
Documentation = "https://AnswerDotAI.github.io/toolslm"
|
|
20
|
+
|
|
21
|
+
[project.entry-points.nbdev]
|
|
22
|
+
toolslm = "toolslm._modidx:d"
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
dev = ['ipython']
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
folder2ctx = "toolslm.xml:folder2ctx_cli"
|
|
30
|
+
repo2ctx = "toolslm.xml:repo2ctx_cli"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.dynamic]
|
|
33
|
+
version = {attr = "toolslm.__version__"}
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
include = ["toolslm"]
|
|
37
|
+
|
|
38
|
+
[tool.nbdev]
|
|
39
|
+
nbs_path = '.'
|
|
40
|
+
jupyter_hooks = true
|
|
41
|
+
custom_sidebar = false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.28"
|
|
@@ -28,10 +28,12 @@ d = { 'settings': { 'branch': 'main',
|
|
|
28
28
|
'toolslm.funccall.call_func': ('funccall.html#call_func', 'toolslm/funccall.py'),
|
|
29
29
|
'toolslm.funccall.call_func_async': ('funccall.html#call_func_async', 'toolslm/funccall.py'),
|
|
30
30
|
'toolslm.funccall.get_schema': ('funccall.html#get_schema', 'toolslm/funccall.py'),
|
|
31
|
+
'toolslm.funccall.get_schema_nm': ('funccall.html#get_schema_nm', 'toolslm/funccall.py'),
|
|
31
32
|
'toolslm.funccall.mk_ns': ('funccall.html#mk_ns', 'toolslm/funccall.py'),
|
|
32
33
|
'toolslm.funccall.mk_param': ('funccall.html#mk_param', 'toolslm/funccall.py'),
|
|
33
34
|
'toolslm.funccall.mk_tool': ('funccall.html#mk_tool', 'toolslm/funccall.py'),
|
|
34
35
|
'toolslm.funccall.python': ('funccall.html#python', 'toolslm/funccall.py'),
|
|
36
|
+
'toolslm.funccall.resolve_nm': ('funccall.html#resolve_nm', 'toolslm/funccall.py'),
|
|
35
37
|
'toolslm.funccall.schema2sig': ('funccall.html#schema2sig', 'toolslm/funccall.py')},
|
|
36
38
|
'toolslm.inspecttools': { 'toolslm.inspecttools.SymbolNotFound': ( 'inspecttools.html#symbolnotfound',
|
|
37
39
|
'toolslm/inspecttools.py'),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../01_funccall.ipynb.
|
|
2
2
|
|
|
3
3
|
# %% auto #0
|
|
4
|
-
__all__ = ['empty', 'custom_types', 'get_schema', 'python', 'mk_ns', '
|
|
5
|
-
'mk_tool']
|
|
4
|
+
__all__ = ['empty', 'custom_types', 'get_schema', 'python', 'mk_ns', 'resolve_nm', 'get_schema_nm', 'call_func',
|
|
5
|
+
'call_func_async', 'mk_param', 'schema2sig', 'mk_tool']
|
|
6
6
|
|
|
7
7
|
# %% ../01_funccall.ipynb #e5ad6b86
|
|
8
8
|
import inspect, json, ast
|
|
@@ -15,6 +15,7 @@ from typing import get_type_hints
|
|
|
15
15
|
from inspect import Parameter, Signature
|
|
16
16
|
from decimal import Decimal
|
|
17
17
|
from uuid import UUID
|
|
18
|
+
from functools import reduce
|
|
18
19
|
|
|
19
20
|
# %% ../01_funccall.ipynb #a9f43047
|
|
20
21
|
empty = inspect.Parameter.empty
|
|
@@ -25,7 +26,7 @@ def _types(t:type)->tuple[str,Optional[str]]:
|
|
|
25
26
|
if t is empty: raise TypeError('Missing type')
|
|
26
27
|
tmap = {int:"integer", float:"number", str:"string", bool:"boolean", list:"array", dict:"object"}
|
|
27
28
|
tmap.update({k.__name__: v for k, v in tmap.items()})
|
|
28
|
-
if getattr(t, '__origin__', None) in (list,tuple):
|
|
29
|
+
if getattr(t, '__origin__', None) in (list,tuple,set):
|
|
29
30
|
args = getattr(t, '__args__', None)
|
|
30
31
|
item_type = "object" if not args else tmap.get(t.__args__[0].__name__, "object")
|
|
31
32
|
return "array", item_type
|
|
@@ -58,9 +59,11 @@ custom_types = {Path, bytes, Decimal, UUID}
|
|
|
58
59
|
|
|
59
60
|
def _handle_type(t, defs):
|
|
60
61
|
"Handle a single type, creating nested schemas if necessary"
|
|
62
|
+
ot = ifnone(get_origin(t), t)
|
|
61
63
|
if t is NoneType: return {'type': 'null'}
|
|
62
64
|
if t in custom_types: return {'type':'string', 'format':t.__name__}
|
|
63
|
-
if
|
|
65
|
+
if ot is dict: return {'type': _types(t)[0]}
|
|
66
|
+
if ot in (list, tuple, set): return {'type': _types(t)[0], 'items':{}}
|
|
64
67
|
if isinstance(t, type) and not issubclass(t, (int, float, str, bool)) or inspect.isfunction(t):
|
|
65
68
|
defs[t.__name__] = _get_nested_schema(t)
|
|
66
69
|
return {'$ref': f'#/$defs/{t.__name__}'}
|
|
@@ -132,12 +135,17 @@ def get_schema(
|
|
|
132
135
|
f:Union[callable,dict], # Function to get schema for
|
|
133
136
|
pname='input_schema', # Key name for parameters
|
|
134
137
|
evalable=False, # stringify defaults that can't be literal_eval'd?
|
|
135
|
-
skip_hidden=False # skip parameters starting with '_'?
|
|
138
|
+
skip_hidden=False, # skip parameters starting with '_'?
|
|
139
|
+
name=None # Override function name (useful for dotted paths like 'obj.method')
|
|
136
140
|
)->dict: # {'name':..., 'description':..., pname:...}
|
|
137
141
|
"Generate JSON schema for a class, function, or method"
|
|
138
142
|
if isinstance(f, dict): return f
|
|
143
|
+
if hasattr(f, '__call__') and not isinstance(f, type) and not inspect.isfunction(f) and not inspect.ismethod(f):
|
|
144
|
+
orig_doc = f.__doc__
|
|
145
|
+
f = f.__call__
|
|
146
|
+
else: orig_doc = None
|
|
139
147
|
schema = _get_nested_schema(f, evalable=evalable, skip_hidden=skip_hidden)
|
|
140
|
-
desc = f.__doc__
|
|
148
|
+
desc = f.__doc__ or orig_doc
|
|
141
149
|
assert desc, "Docstring missing!"
|
|
142
150
|
d = docments(f, full=True)
|
|
143
151
|
ret = d.pop('return')
|
|
@@ -147,7 +155,7 @@ def get_schema(
|
|
|
147
155
|
type_str = f'type: {_types(ret.anno)[0]}' if has_type else None
|
|
148
156
|
ret_str = f'{ret.docment} ({type_str})' if has_type and has_doc else (type_str if has_type else ret.docment)
|
|
149
157
|
desc += f'\n\nReturns:\n- {ret_str}'
|
|
150
|
-
return {"name": f.__name__, "description": desc, pname: schema}
|
|
158
|
+
return {"name": name or f.__name__, "description": desc, pname: schema}
|
|
151
159
|
|
|
152
160
|
# %% ../01_funccall.ipynb #873000d7
|
|
153
161
|
import ast, time, signal, traceback
|
|
@@ -223,11 +231,22 @@ def _coerce_inputs(func, inputs):
|
|
|
223
231
|
else: res[k] = v
|
|
224
232
|
return res
|
|
225
233
|
|
|
226
|
-
# %% ../01_funccall.ipynb #
|
|
234
|
+
# %% ../01_funccall.ipynb #925f462b
|
|
235
|
+
def resolve_nm(nm, ns):
|
|
236
|
+
st,*rest = nm.split('.')
|
|
237
|
+
return reduce(getattr, rest, ns[st])
|
|
238
|
+
|
|
239
|
+
# %% ../01_funccall.ipynb #6f6b5bfa
|
|
240
|
+
def get_schema_nm(nm:str, ns, dot2dash=False, **kwargs):
|
|
241
|
+
"Get schema for symbol `nm` in namespace `ns`, preserving the full dotted name"
|
|
242
|
+
name = nm.replace('.', '-') if dot2dash else nm
|
|
243
|
+
return get_schema(resolve_nm(nm, ns), name=name, **kwargs)
|
|
244
|
+
|
|
245
|
+
# %% ../01_funccall.ipynb #47b49644
|
|
227
246
|
def call_func(fc_name, fc_inputs, ns, raise_on_err=True):
|
|
228
247
|
"Call the function `fc_name` with the given `fc_inputs` using namespace `ns`."
|
|
229
248
|
if not isinstance(ns, abc.Mapping): ns = mk_ns(ns)
|
|
230
|
-
func = ns
|
|
249
|
+
func = resolve_nm(fc_name, ns)
|
|
231
250
|
inps = {re.sub(r'\W', '', k):v for k,v in fc_inputs.items()}
|
|
232
251
|
inps = _coerce_inputs(func, inps)
|
|
233
252
|
try: return func(**inps)
|
|
@@ -235,7 +254,7 @@ def call_func(fc_name, fc_inputs, ns, raise_on_err=True):
|
|
|
235
254
|
if raise_on_err: raise e from None
|
|
236
255
|
else: return traceback.format_exc()
|
|
237
256
|
|
|
238
|
-
# %% ../01_funccall.ipynb #
|
|
257
|
+
# %% ../01_funccall.ipynb #73bca085
|
|
239
258
|
async def call_func_async(fc_name, fc_inputs, ns, raise_on_err=True):
|
|
240
259
|
"Awaits the function `fc_name` with the given `fc_inputs` using namespace `ns`."
|
|
241
260
|
res = call_func(fc_name, fc_inputs, ns, raise_on_err=raise_on_err)
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: toolslm
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.28
|
|
4
4
|
Summary: Tools to make language models a bit easier to use
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Keywords: nbdev
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
5
|
+
Author-email: Jeremy Howard <j@fast.ai>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/AnswerDotAI/toolslm
|
|
8
|
+
Project-URL: Documentation, https://AnswerDotAI.github.io/toolslm
|
|
9
|
+
Keywords: nbdev,jupyter,notebook,python
|
|
12
10
|
Classifier: Natural Language :: English
|
|
13
|
-
Classifier:
|
|
14
|
-
Classifier:
|
|
15
|
-
Classifier:
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
15
|
Requires-Python: >=3.9
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
18
17
|
License-File: LICENSE
|
|
@@ -22,19 +21,7 @@ Requires-Dist: ghapi
|
|
|
22
21
|
Requires-Dist: codesigs
|
|
23
22
|
Provides-Extra: dev
|
|
24
23
|
Requires-Dist: ipython; extra == "dev"
|
|
25
|
-
Dynamic: author
|
|
26
|
-
Dynamic: author-email
|
|
27
|
-
Dynamic: classifier
|
|
28
|
-
Dynamic: description
|
|
29
|
-
Dynamic: description-content-type
|
|
30
|
-
Dynamic: home-page
|
|
31
|
-
Dynamic: keywords
|
|
32
|
-
Dynamic: license
|
|
33
24
|
Dynamic: license-file
|
|
34
|
-
Dynamic: provides-extra
|
|
35
|
-
Dynamic: requires-dist
|
|
36
|
-
Dynamic: requires-python
|
|
37
|
-
Dynamic: summary
|
|
38
25
|
|
|
39
26
|
# toolslm
|
|
40
27
|
|
|
@@ -2,8 +2,6 @@ LICENSE
|
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
4
|
pyproject.toml
|
|
5
|
-
settings.ini
|
|
6
|
-
setup.py
|
|
7
5
|
toolslm/__init__.py
|
|
8
6
|
toolslm/_modidx.py
|
|
9
7
|
toolslm/download.py
|
|
@@ -16,6 +14,5 @@ toolslm.egg-info/PKG-INFO
|
|
|
16
14
|
toolslm.egg-info/SOURCES.txt
|
|
17
15
|
toolslm.egg-info/dependency_links.txt
|
|
18
16
|
toolslm.egg-info/entry_points.txt
|
|
19
|
-
toolslm.egg-info/not-zip-safe
|
|
20
17
|
toolslm.egg-info/requires.txt
|
|
21
18
|
toolslm.egg-info/top_level.txt
|
toolslm-0.3.26/pyproject.toml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=64.0"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name="toolslm"
|
|
7
|
-
requires-python=">=3.9"
|
|
8
|
-
dynamic = [ "keywords", "description", "version", "dependencies", "optional-dependencies", "readme", "license", "authors", "classifiers", "entry-points", "scripts", "urls"]
|
|
9
|
-
|
|
10
|
-
[tool.uv]
|
|
11
|
-
cache-keys = [{ file = "pyproject.toml" }, { file = "settings.ini" }, { file = "setup.py" }]
|
toolslm-0.3.26/settings.ini
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
[DEFAULT]
|
|
2
|
-
repo = toolslm
|
|
3
|
-
lib_name = toolslm
|
|
4
|
-
version = 0.3.26
|
|
5
|
-
min_python = 3.9
|
|
6
|
-
license = apache2
|
|
7
|
-
black_formatting = False
|
|
8
|
-
requirements = fastcore>=1.12.4 httpx ghapi codesigs
|
|
9
|
-
dev_requirements = ipython
|
|
10
|
-
doc_path = _docs
|
|
11
|
-
lib_path = toolslm
|
|
12
|
-
nbs_path = .
|
|
13
|
-
recursive = True
|
|
14
|
-
tst_flags = notest
|
|
15
|
-
put_version_in_init = True
|
|
16
|
-
branch = main
|
|
17
|
-
custom_sidebar = False
|
|
18
|
-
doc_host = https://AnswerDotAI.github.io
|
|
19
|
-
doc_baseurl = /toolslm
|
|
20
|
-
git_url = https://github.com/AnswerDotAI/toolslm
|
|
21
|
-
title = toolslm
|
|
22
|
-
audience = Developers
|
|
23
|
-
author = Jeremy Howard
|
|
24
|
-
author_email = j@fast.ai
|
|
25
|
-
copyright = 2024 onwards, Jeremy Howard
|
|
26
|
-
description = Tools to make language models a bit easier to use
|
|
27
|
-
keywords = nbdev jupyter notebook python
|
|
28
|
-
language = English
|
|
29
|
-
status = 3
|
|
30
|
-
user = AnswerDotAI
|
|
31
|
-
readme_nb = index.ipynb
|
|
32
|
-
allowed_metadata_keys =
|
|
33
|
-
allowed_cell_metadata_keys =
|
|
34
|
-
jupyter_hooks = True
|
|
35
|
-
clear_all = False
|
|
36
|
-
conda_user = fastai
|
|
37
|
-
console_scripts = folder2ctx=toolslm.xml:folder2ctx_cli
|
|
38
|
-
repo2ctx=toolslm.xml:repo2ctx_cli
|
|
39
|
-
cell_number = False
|
|
40
|
-
skip_procs =
|
|
41
|
-
update_pyproject = True
|
|
42
|
-
clean_ids = True
|
|
43
|
-
|
toolslm-0.3.26/setup.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from pkg_resources import parse_version
|
|
2
|
-
from configparser import ConfigParser
|
|
3
|
-
import setuptools, shlex
|
|
4
|
-
assert parse_version(setuptools.__version__)>=parse_version('36.2')
|
|
5
|
-
|
|
6
|
-
# note: all settings are in settings.ini; edit there, not here
|
|
7
|
-
config = ConfigParser(delimiters=['='])
|
|
8
|
-
config.read('settings.ini', encoding='utf-8')
|
|
9
|
-
cfg = config['DEFAULT']
|
|
10
|
-
|
|
11
|
-
cfg_keys = 'version description keywords author author_email'.split()
|
|
12
|
-
expected = cfg_keys + "lib_name user branch license status min_python audience language".split()
|
|
13
|
-
for o in expected: assert o in cfg, "missing expected setting: {}".format(o)
|
|
14
|
-
setup_cfg = {o:cfg[o] for o in cfg_keys}
|
|
15
|
-
|
|
16
|
-
licenses = {
|
|
17
|
-
'apache2': ('Apache Software License 2.0','OSI Approved :: Apache Software License'),
|
|
18
|
-
'mit': ('MIT License', 'OSI Approved :: MIT License'),
|
|
19
|
-
'gpl2': ('GNU General Public License v2', 'OSI Approved :: GNU General Public License v2 (GPLv2)'),
|
|
20
|
-
'gpl3': ('GNU General Public License v3', 'OSI Approved :: GNU General Public License v3 (GPLv3)'),
|
|
21
|
-
'bsd3': ('BSD License', 'OSI Approved :: BSD License'),
|
|
22
|
-
}
|
|
23
|
-
statuses = [ '1 - Planning', '2 - Pre-Alpha', '3 - Alpha',
|
|
24
|
-
'4 - Beta', '5 - Production/Stable', '6 - Mature', '7 - Inactive' ]
|
|
25
|
-
py_versions = '3.6 3.7 3.8 3.9 3.10'.split()
|
|
26
|
-
|
|
27
|
-
requirements = shlex.split(cfg.get('requirements', ''))
|
|
28
|
-
if cfg.get('pip_requirements'): requirements += shlex.split(cfg.get('pip_requirements', ''))
|
|
29
|
-
min_python = cfg['min_python']
|
|
30
|
-
lic = licenses.get(cfg['license'].lower(), (cfg['license'], None))
|
|
31
|
-
dev_requirements = (cfg.get('dev_requirements') or '').split()
|
|
32
|
-
|
|
33
|
-
setuptools.setup(
|
|
34
|
-
name = cfg['lib_name'],
|
|
35
|
-
license = lic[0],
|
|
36
|
-
classifiers = [
|
|
37
|
-
'Development Status :: ' + statuses[int(cfg['status'])],
|
|
38
|
-
'Intended Audience :: ' + cfg['audience'].title(),
|
|
39
|
-
'Natural Language :: ' + cfg['language'].title(),
|
|
40
|
-
] + ['Programming Language :: Python :: '+o for o in py_versions[py_versions.index(min_python):]] + (['License :: ' + lic[1] ] if lic[1] else []),
|
|
41
|
-
url = cfg['git_url'],
|
|
42
|
-
packages = setuptools.find_packages(),
|
|
43
|
-
include_package_data = True,
|
|
44
|
-
install_requires = requirements,
|
|
45
|
-
extras_require={ 'dev': dev_requirements },
|
|
46
|
-
dependency_links = cfg.get('dep_links','').split(),
|
|
47
|
-
python_requires = '>=' + cfg['min_python'],
|
|
48
|
-
long_description = open('README.md', encoding='utf-8').read(),
|
|
49
|
-
long_description_content_type = 'text/markdown',
|
|
50
|
-
zip_safe = False,
|
|
51
|
-
entry_points = {
|
|
52
|
-
'console_scripts': cfg.get('console_scripts','').split(),
|
|
53
|
-
'nbdev': [f'{cfg.get("lib_path")}={cfg.get("lib_path")}._modidx:d']
|
|
54
|
-
},
|
|
55
|
-
**setup_cfg)
|
|
56
|
-
|
|
57
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.26"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|