forked from dropbox/sqlalchemy-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (53 loc) · 1.82 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from setuptools import setup
import os
name = 'sqlalchemy-stubs'
description = 'SQLAlchemy stubs and mypy plugin'
install_instructions = """\
# Experimental SQLAlchemy type stubs and mypy plugin
This package contains type stubs and mypy plugin to provide more precise
static types and type inference for SQLAlchemy framework. SQLAlchemy uses
dynamic Python features that are hard to understand by static type checkers,
this is why the plugin is needed in addition to type stubs.
Currently, some basic use cases like inferring model field types are supported.
The final goal is to be able to get precise types for most common patterns.
## Installation
```
pip install sqlalchemy-stubs
```
Important: you need to enable the plugin in your mypy config file:
```
[mypy]
plugins = sqlmypy
```
"""
def find_stub_files():
result = []
for root, dirs, files in os.walk(name):
for file in files:
if file.endswith('.pyi'):
if os.path.sep in root:
sub_root = root.split(os.path.sep, 1)[-1]
file = os.path.join(sub_root, file)
result.append(file)
return result
setup(name='sqlalchemy-stubs',
version='0.3',
description=description,
long_description=install_instructions,
long_description_content_type='text/markdown',
author='Ivan Levkivskyi',
author_email='[email protected]',
license='MIT License',
url="https://github.com/dropbox/sqlalchemy-stubs",
py_modules=['sqlmypy', 'sqltyping'],
install_requires=[
'mypy>=0.720',
'typing-extensions>=3.7.4'
],
packages=['sqlalchemy-stubs'],
package_data={'sqlalchemy-stubs': find_stub_files()},
classifiers=[
'Development Status :: 3 - Alpha',
'Programming Language :: Python :: 3'
]
)