Commit fbb1a3b0 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[pkg] Use setuptools.find_packages()

We drop the custom get_packages() function in setup.py that used to look
for test files (not discovered automatically since test directories are
not packages) and replace it by explicit entries in MANIFEST.in.
parent af1245fe6b7b
......@@ -40,18 +40,27 @@ recursive-include cubicweb/schemas *.py *.sql
recursive-include requirements *.txt
recursive-include cubicweb/test *.py
recursive-include cubicweb/test/data bootstrap_cubes *.py *.sql
recursive-include cubicweb/test/data-rewrite bootstrap_cubes *.py
recursive-include cubicweb/test/data_schemareader *.py
recursive-include cubicweb/dataimport/test *.py
recursive-include cubicweb/dataimport/test/data *.py *.csv *.txt
recursive-include cubicweb/dataimport/test/data-massimport *.py
recursive-include cubicweb/devtools/test *.py
recursive-include cubicweb/devtools/test/data *.py *.txt *.js *.po.ref
recursive-include cubicweb/entities/test *.py
recursive-include cubicweb/entities/test/data *.py
recursive-include cubicweb/etwist/test *.py
recursive-include cubicweb/etwist/test/data *.py
recursive-include cubicweb/ext/test *.py
recursive-include cubicweb/ext/test/data *.py
recursive-include cubicweb/hooks/test *.py
recursive-include cubicweb/hooks/test/data-computed *.py
recursive-include cubicweb/hooks/test/data *.py
recursive-include cubicweb/sobjects/test *.py
recursive-include cubicweb/sobjects/test/data bootstrap_cubes *.py
recursive-include cubicweb/server/test *.py
recursive-include cubicweb/server/test/data bootstrap_cubes *.py source* *.conf.in *.ldif
recursive-include cubicweb/server/test/data-cwep002 *.py
recursive-include cubicweb/server/test/datacomputed *.py
......@@ -59,8 +68,10 @@ recursive-include cubicweb/server/test/data-schema2sql toignore
recursive-include cubicweb/server/test/data-migractions bootstrap_cubes *.py
recursive-include cubicweb/server/test/data-schemaserial *.py
include cubicweb/web/test/testutils.js
recursive-include cubicweb/web/test *.py
recursive-include cubicweb/web/test/data bootstrap_cubes pouet.css *.py
recursive-include cubicweb/web/test/data/static/jstests *.js *.html *.json
recursive-include cubicweb/wsgi/test *.py
include cubicweb/pyramid/development.ini.tmpl
......
......@@ -22,10 +22,9 @@
"""
import io
import os
from os.path import dirname, exists, isdir, join
from os.path import dirname, join
from setuptools import setup
from setuptools import setup, find_packages
here = dirname(__file__)
......@@ -52,23 +51,6 @@ data_files = __pkginfo__['data_files']
package_data = __pkginfo__['package_data']
def get_packages(directory, prefix):
"""return a list of subpackages for the given directory
"""
result = []
for package in os.listdir(directory):
absfile = join(directory, package)
if isdir(absfile):
if exists(join(absfile, '__init__.py')) or \
package in ('test', 'tests'):
if prefix:
result.append('%s.%s' % (prefix, package))
else:
result.append(package)
result += get_packages(absfile, result[-1])
return result
setup(
name=distname,
version=version,
......@@ -78,7 +60,7 @@ setup(
long_description=long_description,
author=author,
author_email=author_email,
packages=[modname] + get_packages(join(here, modname), modname),
packages=find_packages(),
package_data=package_data,
data_files=data_files,
include_package_data=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment