Merge branch 'amalfix'

This commit is contained in:
Anthony Scopatz 2016-06-24 17:35:36 -04:00
commit 70d52ce457
2 changed files with 25 additions and 2 deletions

14
news/amalfix.rst Normal file
View file

@ -0,0 +1,14 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* ``setup.py`` will only amalgamate source files if ``amalgamate.py`` is
available. This fixes issues with installing from pip.
**Security:** None

View file

@ -48,6 +48,16 @@ def clean_tables():
os.environ['XONSH_DEBUG'] = '1'
from xonsh import __version__ as XONSH_VERSION
def amalagamate_source():
"""Amalgamtes source files."""
try:
import amalgamate
except ImportError:
print('Could not import amalgamate, skipping.', file=sys.stderr)
return
amalgamate.main(['amalgamate', '--debug=XONSH_DEBUG', 'xonsh'])
def build_tables():
"""Build the lexer/parser modules."""
print('Building lexer and parser tables.')
@ -55,8 +65,7 @@ def build_tables():
from xonsh.parser import Parser
Parser(lexer_table='lexer_table', yacc_table='parser_table',
outputdir='xonsh')
import amalgamate
amalgamate.main(['amalgamate', '--debug=XONSH_DEBUG', 'xonsh'])
amalagamate_source()
sys.path.pop(0)