From 50d42624ccb6ba0f55184ea2ee78fe297e2b2d5f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 12 Aug 2020 11:55:55 +0200 Subject: [PATCH] better support of PACKAGE_DST environment variable --- setup.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a52538c..9812bac 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from setuptools import setup, find_packages +from setuptools import setup import os from tiramisu import __version__ -PACKAGE_NAME = os.environ.get('PACKAGE_DST', 'tiramisu') +ORI_PACKAGE_NAME = 'tiramisu' +PACKAGE_NAME = os.environ.get('PACKAGE_DST', ORI_PACKAGE_NAME) + +if PACKAGE_NAME != ORI_PACKAGE_NAME: + package_dir = {PACKAGE_NAME: ORI_PACKAGE_NAME} +else: + package_dir = None setup( version=__version__, @@ -40,5 +46,6 @@ producing flexible and fast options access. This version requires Python 3.5 or later. """, include_package_data=True, - packages=find_packages(include=['tiramisu']) + package_dir=package_dir, + packages=[PACKAGE_NAME], )