2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 18:07:12 +01:00

Merge branch 'pip_integration' into 'master'

Pip integration

See merge request ita1024/waf!2253
This commit is contained in:
ita1024 2019-06-27 06:36:48 +00:00
commit ba3135c52b
2 changed files with 37 additions and 1 deletions

25
utils/setup.py Normal file
View File

@ -0,0 +1,25 @@
import setuptools
import sys
sys.path.insert(0,'..')
import waflib.Context
with open("../README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="waf",
version=waflib.Context.WAFVERSION,
author="Thomas Nagy",
author_email="author@example.com",
description="Build Framework",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://gitlab.com/ita1024/waf",
package_dir={'': '../'},
packages=['waflib', 'waflib/Tools', 'waflib/extras'],
scripts=['../waf-light'],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
)

View File

@ -130,6 +130,15 @@ def test(dir):
except OSError:
pass
def test_syspath():
for dir in sys.path:
try:
os.stat(join(dir, 'waflib'))
return True
except OSError:
pass
return False
def find_lib():
src = os.path.abspath(inspect.getfile(inspect.getmodule(err)))
base, name = os.path.split(src)
@ -142,6 +151,7 @@ def find_lib():
if name.endswith('waf-light'):
w = test(base)
if w: return w
if test_syspath(): return None
err('waf-light requires waflib -> export WAFDIR=/folder')
dirname = '%s-%s-%s' % (WAF, VERSION, REVISION)
@ -159,7 +169,8 @@ def find_lib():
return dir
wafdir = find_lib()
sys.path.insert(0, wafdir)
if wafdir is not None:
sys.path.insert(0, wafdir)
if __name__ == '__main__':
#import waflib.extras.compat15#PRELUDE