Skip to content

Commit b73b0c6

Browse files
committed
remove osp from setup.py
1 parent c22a402 commit b73b0c6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
from distutils.core import setup
1818
import os
19-
import os.path as osp
20-
19+
# import os.path as osp
20+
from pathlib import Path
2121

2222
def get_package_data(name, extlist):
2323
"""Return data files for package *name* with extensions in *extlist*"""
@@ -28,10 +28,12 @@ def get_package_data(name, extlist):
2828
for fname in filenames:
2929
if (
3030
not fname.startswith('.')
31-
and osp.splitext(fname)[1] in extlist
31+
# and osp.splitext(fname)[1] in extlist
32+
and Path(fname).suffix in extlist
3233
):
3334
flist.append(
34-
osp.join(dirpath, fname)[offset:]
35+
# osp.join(dirpath, fname)[offset:]
36+
str(Path(dirpath) / fname)[offset:]
3537
)
3638
return flist
3739

@@ -40,7 +42,9 @@ def get_subpackages(name):
4042
"""Return subpackages of package *name*"""
4143
splist = []
4244
for dirpath, _dirnames, _filenames in os.walk(name):
43-
if osp.isfile(osp.join(dirpath, '__init__.py')):
45+
# if osp.isfile(osp.join(dirpath, '__init__.py')):
46+
# if osp.isfile(str(Path(dirpath) / '__init__.py')):
47+
if (Path(dirpath) / '__init__.py').is_file():
4448
splist.append(".".join(dirpath.split(os.sep)))
4549
return splist
4650

0 commit comments

Comments
 (0)