Skip to content

Commit 5d572a1

Browse files
committed
use old setup style for now
1 parent 19c7dc2 commit 5d572a1

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

setup.cfg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ project_urls =
2525
Issue Tracker=https://github.com/sqlalchemy/sqlalchemy2-stubs/
2626

2727
[options]
28-
packages = sqlalchemy-stubs
29-
#include_package_data = true
3028
python_requires = >=3.6
3129

3230
install_requires =
3331
mypy>=0.790
3432
typing-extensions>=3.7.4
3533

36-
[options.package_data]
37-
* = *.pyi
34+
[options.data_files]
3835

3936
[mypy]
4037

setup.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
import os
2+
13
from setuptools import setup
24

3-
setup()
5+
6+
def find_stub_files():
7+
result = []
8+
for root, dirs, files in os.walk("sqlalchemy-stubs"):
9+
for file in files:
10+
if file.endswith(".pyi"):
11+
if os.path.sep in root:
12+
sub_root = root.split(os.path.sep, 1)[-1]
13+
file = os.path.join(sub_root, file)
14+
result.append(file)
15+
return result
16+
17+
18+
setup(
19+
packages=["sqlalchemy-stubs"],
20+
package_data={"sqlalchemy-stubs": find_stub_files()},
21+
)

sqlalchemy-stubs/ext/mypy/mock_orm.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ class Mapped:
4545
def __get__(self, instance: None, owner: Any) -> Mapped[_T]: ...
4646
@overload
4747
def __get__(self, instance: object, owner: Any) -> Union[_T, None]: ...
48-
4948
# TODO: this is a hack to work with the plugin for now, needs adjustment
5049
@classmethod
5150
def _empty_constructor(cls, _T) -> "Mapped[_T]": ...
52-
5351
@property
5452
def property(self) -> object: ...
55-
5653
# so that it can work with the "constructor", or none
5754
# def __init__(self, type: _T) -> None: ...

0 commit comments

Comments
 (0)