This repository has been archived by the owner on Nov 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed agile scripts, everything in setup.py
- Loading branch information
Showing
7 changed files
with
94 additions
and
97 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
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
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
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 |
---|---|---|
@@ -1,19 +1,69 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import os | ||
import json | ||
import subprocess | ||
|
||
from setuptools import setup, find_packages | ||
from extensions import ext | ||
|
||
import pulsar_config as config | ||
import pulsar_test | ||
|
||
|
||
class PulsarTest(pulsar_test.Test): | ||
start_coverage = True | ||
|
||
|
||
def extend(params, package=None): | ||
if package: | ||
path = os.path.dirname(__file__) | ||
data = sh('%s %s package_info %s %s' | ||
% (sys.executable, __file__, package, path)) | ||
params.update(json.loads(data)) | ||
|
||
return params | ||
|
||
|
||
def read(name): | ||
filename = os.path.join(os.path.dirname(__file__), name) | ||
with open(filename) as fp: | ||
return fp.read() | ||
|
||
|
||
def requirements(name): | ||
install_requires = [] | ||
dependency_links = [] | ||
|
||
for line in read(name).split('\n'): | ||
if line.startswith('-e '): | ||
link = line[3:].strip() | ||
if link == '.': | ||
continue | ||
dependency_links.append(link) | ||
line = link.split('=')[1] | ||
line = line.strip() | ||
if line: | ||
install_requires.append(line) | ||
|
||
return install_requires, dependency_links | ||
|
||
|
||
def sh(command): | ||
return subprocess.Popen(command, | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
shell=True, | ||
universal_newlines=True).communicate()[0] | ||
|
||
|
||
meta = dict( | ||
name='pulsar', | ||
author="Luca Sbardella", | ||
author_email="[email protected]", | ||
maintainer_email="[email protected]", | ||
url="https://github.com/quantmind/pulsar", | ||
license="BSD", | ||
long_description=config.read('README.rst'), | ||
long_description=read('README.rst'), | ||
include_package_data=True, | ||
setup_requires=['wheel'], | ||
packages=find_packages(include=['pulsar', 'pulsar.*', 'pulsar_test']), | ||
|
@@ -43,22 +93,36 @@ | |
) | ||
|
||
|
||
class PulsarTest(pulsar_test.Test): | ||
start_coverate = True | ||
|
||
|
||
def run_setup(with_cext): | ||
params = ext.params() if with_cext else {} | ||
params.update(meta) | ||
cmdclass = params.get('cmdclass', {}) | ||
cmdclass['test'] = PulsarTest | ||
params['cmdclass'] = cmdclass | ||
setup(**config.setup(params, 'pulsar')) | ||
setup(**extend(params, 'pulsar')) | ||
|
||
|
||
def package_info(): | ||
package = sys.argv[2] | ||
if len(sys.argv) > 3: | ||
sys.path.append(sys.argv[3]) | ||
os.environ['package_info'] = package | ||
pkg = __import__(package) | ||
print(json.dumps(dict(version=pkg.__version__, | ||
description=pkg.__doc__))) | ||
|
||
|
||
if __name__ == '__main__': | ||
try: | ||
run_setup(True) | ||
except ext.BuildFailed as exc: | ||
print('WARNING: C extensions could not be compiled: %s' % exc.msg) | ||
run_setup(False) | ||
command = sys.argv[1] if len(sys.argv) > 1 else None | ||
if command == 'package_info': | ||
package_info() | ||
elif command == 'agile': | ||
from agile import AgileManager | ||
AgileManager(description='Release manager for pulsar', | ||
argv=sys.argv[2:]).start() | ||
else: | ||
try: | ||
run_setup(True) | ||
except ext.BuildFailed as exc: | ||
print('WARNING: C extensions could not be compiled: %s' % exc.msg) | ||
run_setup(False) |
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