Skip to content

Commit 5c9aaa7

Browse files
committed
Update packages after generation on install
1 parent 40cf804 commit 5c9aaa7

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
'scikit-image'
6565
],
6666
},
67-
'packages': find_packages(),
67+
'packages': ['pythreejs'], # Manually specify here, update after autogen
6868
'zip_safe': False,
6969
'cmdclass': cmdclass,
7070
'author': 'PyThreejs Development Team',

setupbase.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from glob import glob
1919
from subprocess import check_call
2020

21-
from setuptools import Command
21+
from setuptools import Command, find_packages
2222
from setuptools.command.build_py import build_py
2323
from setuptools.command.sdist import sdist
2424
from setuptools.command.develop import develop
@@ -82,26 +82,17 @@ def expand_data_files(data_file_patterns):
8282
return data_files
8383

8484

85-
def find_packages(top):
86-
"""
87-
Find all of the packages.
88-
"""
89-
packages = []
90-
for d, dirs, _ in os.walk(top, followlinks=True):
91-
if os.path.exists(pjoin(d, '__init__.py')):
92-
packages.append(os.path.relpath(d, top).replace(os.path.sep, '.'))
93-
elif d != top:
94-
# Do not look for packages in subfolders if current is not a package
95-
dirs[:] = []
96-
return packages
97-
98-
9985
def update_package_data(distribution):
10086
"""update build_py options to get package_data changes"""
10187
build_py = distribution.get_command_obj('build_py')
10288
build_py.finalize_options()
10389

10490

91+
def update_packages(command):
92+
"""update build_py options to get packages changes"""
93+
command.distribution.packages = find_packages()
94+
95+
10596
def create_cmdclass(wrappers=None):
10697
"""Create a command class with the given optional wrappers.
10798
@@ -377,6 +368,8 @@ def run(self):
377368
else:
378369
pass
379370

371+
update_packages(self)
372+
380373
result = cls.run(self)
381374
# update package data
382375
update_package_data(self.distribution)

0 commit comments

Comments
 (0)