forked from daviddrysdale/python-phonenumbers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use single setup.py for normal and lite packages
At package generation time, add a 'lite' command line option that forces the light version of the package. At installation time, use absence of phonenumbers/tzdata to indicate light version being installed. This is somewhat experimental; dynamically messing with setup processing may well have unexpected side effects.
- Loading branch information
1 parent
745682b
commit 6686d64
Showing
3 changed files
with
27 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,15 +32,38 @@ | |
# Discover version of phonenumbers package | ||
from phonenumbers import __version__ | ||
|
||
distutils.core.setup(name='phonenumbers', | ||
# Discover whether per-prefix data is available | ||
if 'lite' in sys.argv: | ||
lite = True | ||
del sys.argv[sys.argv.index('lite')] | ||
else: | ||
lite = False | ||
if not lite: | ||
try: | ||
import phonenumbers.tzdata | ||
except ImportError: | ||
lite = True | ||
|
||
# Various parameters depend on whether we are the lite package or not | ||
if lite: | ||
pkgname = 'phonenumberslite' | ||
pkgs = ['phonenumbers', 'phonenumbers.data', 'phonenumbers.shortdata'] | ||
pkgstatus = 'Development Status :: 4 - Beta' | ||
lite = True | ||
else: | ||
pkgname = 'phonenumbers' | ||
pkgs = ['phonenumbers', 'phonenumbers.data', 'phonenumbers.geodata', 'phonenumbers.shortdata', | ||
'phonenumbers.carrierdata', 'phonenumbers.tzdata'] | ||
pkgstatus = 'Development Status :: 5 - Production/Stable' | ||
|
||
distutils.core.setup(name=pkgname, | ||
version=__version__, | ||
description="Python version of Google's common library for parsing, formatting, storing and validating international phone numbers.", | ||
author='David Drysdale', | ||
author_email='[email protected]', | ||
url='https://github.com/daviddrysdale/python-phonenumbers', | ||
license='Apache License 2.0', | ||
packages=['phonenumbers', 'phonenumbers.data', 'phonenumbers.geodata', 'phonenumbers.shortdata', | ||
'phonenumbers.carrierdata', 'phonenumbers.tzdata'], | ||
packages=pkgs, | ||
test_suite="tests", | ||
platforms='Posix; MacOS X; Windows', | ||
classifiers=['Development Status :: 5 - Production/Stable', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters