Skip to content

Commit

Permalink
Merge pull request #726 from google/manifest
Browse files Browse the repository at this point in the history
Fix pip install errors.
  • Loading branch information
rchen152 authored Nov 4, 2020
2 parents a1a6c24 + 5dd02dd commit 70215e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include LICENSE
include pyproject.toml
include pytype/pyi/*
include pytype/test_data/*

include pytype/typegraph/*
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import shutil
import sys

from setuptools import setup
from setuptools import setup, Extension

# Path to directory containing setup.py
here = os.path.abspath(os.path.dirname(__file__))
Expand All @@ -37,23 +37,27 @@

def get_parser_ext():
"""Get the parser extension."""
extra_compile_args = []
# We need some platform-dependent compile args for the C extensions.
if sys.platform == 'win32':
# windows does not have unistd.h; lex/yacc needs this define.
extra_compile_args.append('-DYY_NO_UNISTD_H')

# This is a setuptools.Extension, with an added include for pybind11, a few
# flags, and a cxx_std setting.
return Pybind11Extension(
extra_compile_args = ['-DYY_NO_UNISTD_H']
extra_link_args = []
elif sys.platform == 'darwin':
# clang on darwin requires some extra flags, which gcc does not support
extra_compile_args = ['-std=c++11', '-stdlib=libc++']
extra_link_args = ['-stdlib=libc++']
else:
extra_compile_args = ['-std=c++11']
extra_link_args = []
return Extension(
'pytype.pyi.parser_ext',
sources=[
'pytype/pyi/parser_ext.cc',
'pytype/pyi/lexer.lex.cc',
'pytype/pyi/parser.tab.cc',
],
cxx_std=11,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)


Expand Down

0 comments on commit 70215e1

Please sign in to comment.