From a717fee16edee84a759c96451015d2dd86aa1e57 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 10 Apr 2019 14:35:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20Exclude=20blobs=20from=20sdist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using ``MANIFEST.in`` because of setuptools limitation. Ref: https://github.com/pypa/setuptools_scm/issues/190#issuecomment-481669649 --- MANIFEST.in | 1 + setup.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000..ff876bb6d3 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +prune asset diff --git a/setup.py b/setup.py index 4f9cc10767..335de03950 100644 --- a/setup.py +++ b/setup.py @@ -278,6 +278,22 @@ def read_configuration(filepath): opt['package_data'] = {} for k, v in opt_package_data.items(): opt['package_data'][k] = cfg_val_to_list(v) + try: + opt_exclude_package_data = dict( + cfg.items('options.exclude_package_data'), + ) + if ( + not opt_exclude_package_data.get('', '').strip() + and '*' in opt_exclude_package_data + ): + opt_exclude_package_data[''] = opt_exclude_package_data['*'] + del opt_exclude_package_data['*'] + except NoSectionError: + pass + else: + opt['exclude_package_data'] = {} + for k, v in opt_exclude_package_data.items(): + opt['exclude_package_data'][k] = cfg_val_to_list(v) cur_pkgs = opt.get('packages', '').strip() if '\n' in cur_pkgs: opt['packages'] = cfg_val_to_list(opt['packages'])