From 036177dc35eaed8dadf08b8697f7e657114a3a76 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 17 Jun 2015 21:36:48 +0300 Subject: [PATCH 1/9] added requirements.txt for specific components --- requirements.txt | 3 ++- st2api/requirements.txt | 7 +++++++ st2auth/requirements.txt | 6 ++++++ st2client/requirements.txt | 6 +++--- st2common/requirements.txt | 15 +++++++++++++++ st2debug/requirements.txt | 4 ++++ st2reactor/requirement.txt | 8 ++++++++ 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 st2api/requirements.txt create mode 100644 st2auth/requirements.txt create mode 100644 st2common/requirements.txt create mode 100644 st2debug/requirements.txt create mode 100644 st2reactor/requirement.txt diff --git a/requirements.txt b/requirements.txt index 3641121fc6..2b00ad8fde 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +# 1. Don't include forget to populate spcific requirements.txt. IMORTANT!!! +# 2. Don't include setuptools into any of requirements.txt (we don't want it bundled). apscheduler>=3.0.0rc1 eventlet>=0.13.0 flask @@ -15,7 +17,6 @@ python-dateutil python-json-logger pyyaml requests -setuptools==11.1 six==1.9.0 tooz git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0 diff --git a/st2api/requirements.txt b/st2api/requirements.txt new file mode 100644 index 0000000000..f77cf95ecd --- /dev/null +++ b/st2api/requirements.txt @@ -0,0 +1,7 @@ +eventlet>=0.13.0 +jsonschema>=2.3.0 +kombu +mongoengine>=0.8.7,<0.9 +oslo.config +pecan==0.7.0 +six==1.9.0 diff --git a/st2auth/requirements.txt b/st2auth/requirements.txt new file mode 100644 index 0000000000..d3efad133d --- /dev/null +++ b/st2auth/requirements.txt @@ -0,0 +1,6 @@ +eventlet>=0.13.0 +oslo.config +passlib>=1.6.2,<1.7 +pecan==0.7.0 +pymongo<3.0 +six==1.9.0 diff --git a/st2client/requirements.txt b/st2client/requirements.txt index 32915d0deb..793264fa16 100644 --- a/st2client/requirements.txt +++ b/st2client/requirements.txt @@ -1,6 +1,6 @@ prettytable +python-dateutil pyyaml +jsonpath-rw>=1.3.0 requests -six -python-dateutil -jsonpath-rw +six==1.9.0 diff --git a/st2common/requirements.txt b/st2common/requirements.txt new file mode 100644 index 0000000000..3c0cc785a9 --- /dev/null +++ b/st2common/requirements.txt @@ -0,0 +1,15 @@ +python-dateutil +eventlet>=0.13.0 +git+https://github.com/StackStorm/fabric.git@stanley-patched +jinja2 +jsonschema>=2.3.0 +kombu +mongoengine>=0.8.7,<0.9 +oslo.config +paramiko +pecan==0.7.0 +pyyaml +requests +semver>=2.1.2 +six==1.9.0 +tooz diff --git a/st2debug/requirements.txt b/st2debug/requirements.txt new file mode 100644 index 0000000000..4bd03da64c --- /dev/null +++ b/st2debug/requirements.txt @@ -0,0 +1,4 @@ +python-gnupg>=0.3.7,<0.4 +requests +six==1.9.0 +pyyaml diff --git a/st2reactor/requirement.txt b/st2reactor/requirement.txt new file mode 100644 index 0000000000..0a1bfdf8f1 --- /dev/null +++ b/st2reactor/requirement.txt @@ -0,0 +1,8 @@ +apscheduler>=3.0.0rc1 +python-dateutil +eventlet>=0.13.0 +jsonpath-rw>=1.3.0 +jsonschema>=2.3.0 +kombu +oslo.config +six==1.9.0 From 93a1baa05b8c4327ff6476f5a1fc4f1efb24258c Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Thu, 18 Jun 2015 01:36:48 +0300 Subject: [PATCH 2/9] setup.py new requirements idea --- requirements.txt | 6 ++--- st2api/setup.cfg | 6 ----- st2api/setup.py | 50 +++++++++++++++++++++++++------------- st2common/requirements.txt | 2 +- st2common/setup.cfg | 6 ----- st2common/setup.py | 47 ++++++++++++++++++++++++----------- 6 files changed, 70 insertions(+), 47 deletions(-) delete mode 100644 st2api/setup.cfg delete mode 100644 st2common/setup.cfg diff --git a/requirements.txt b/requirements.txt index 2b00ad8fde..eff146d367 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,8 +19,8 @@ pyyaml requests six==1.9.0 tooz -git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0 -git+https://github.com/StackStorm/fabric.git@stanley-patched +git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0#egg=python-mistralclient +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric passlib>=1.6.2,<1.7 lockfile>=0.10.2,<0.11 python-gnupg>=0.3.7,<0.4 @@ -28,7 +28,7 @@ jsonpath-rw>=1.3.0 # Requirements for linux pack # used by file watcher sensor pyinotify>=0.9.5,<=0.10 --e git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper +git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper # used by nmap actions python-nmap>=0.3.4,<0.4 semver>=2.1.2 diff --git a/st2api/setup.cfg b/st2api/setup.cfg deleted file mode 100644 index 8436704bc2..0000000000 --- a/st2api/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[nosetests] -match=^st2api -where=test -nocapture=1 -cover-package=st2api -cover-erase=1 diff --git a/st2api/setup.py b/st2api/setup.py index 2f14aa3955..08dc7e61d7 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -14,27 +14,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import re +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + + +current_dir = os.path.dirname(os.path.realpath(__file__)) +version_file = os.path.join(current_dir, '../st2client/st2client/__init__.py') +with open(version_file, 'r') as f: + vmatch = re.search(r'__version__ = [\'\"](.*)[\'\"]$', f.read(), flags=re.MULTILINE) + + +install_reqs, dep_links = fetch_requirements() +ST2_COMPONENT = os.path.basename(current_dir) +ST2_VERSION = vmatch.group(1) + setup( - name='st2api', - version='0.4.0', - description='', + name=ST2_COMPONENT, + version=ST2_VERSION, + description='{} component'.format(ST2_COMPONENT), author='StackStorm', author_email='info@stackstorm.com', - install_requires=[ - "pecan", - ], - package_data={ - 'st2api': ['templates/*.html'] - }, - test_suite='st2api', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=ST2_COMPONENT, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools']) ) diff --git a/st2common/requirements.txt b/st2common/requirements.txt index 3c0cc785a9..7e5666b710 100644 --- a/st2common/requirements.txt +++ b/st2common/requirements.txt @@ -1,6 +1,6 @@ python-dateutil eventlet>=0.13.0 -git+https://github.com/StackStorm/fabric.git@stanley-patched +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric jinja2 jsonschema>=2.3.0 kombu diff --git a/st2common/setup.cfg b/st2common/setup.cfg deleted file mode 100644 index db93e88ae7..0000000000 --- a/st2common/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[nosetests] -match=^st2common -where=test -nocapture=1 -cover-package=st2common -cover-erase=1 diff --git a/st2common/setup.py b/st2common/setup.py index ba51c78775..08dc7e61d7 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -14,24 +14,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import re +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + + +current_dir = os.path.dirname(os.path.realpath(__file__)) +version_file = os.path.join(current_dir, '../st2client/st2client/__init__.py') +with open(version_file, 'r') as f: + vmatch = re.search(r'__version__ = [\'\"](.*)[\'\"]$', f.read(), flags=re.MULTILINE) + + +install_reqs, dep_links = fetch_requirements() +ST2_COMPONENT = os.path.basename(current_dir) +ST2_VERSION = vmatch.group(1) + setup( - name='st2common', - version='0.4.0', - description='', + name=ST2_COMPONENT, + version=ST2_VERSION, + description='{} component'.format(ST2_COMPONENT), author='StackStorm', author_email='info@stackstorm.com', - install_requires=[ - "pecan", - ], - test_suite='st2common', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=ST2_COMPONENT, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools']) ) From 159d79766d2d01a027a3a72ef3207bbc17da49b0 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Mon, 22 Jun 2015 20:24:02 +0300 Subject: [PATCH 3/9] fixate-requirements.py --- scripts/fixate-requirements.py | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 scripts/fixate-requirements.py diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py new file mode 100644 index 0000000000..7b796ae25d --- /dev/null +++ b/scripts/fixate-requirements.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import os +import os.path +import sys +import pprint +from urlparse import urlparse +from distutils.version import StrictVersion +from setuptools import setup, find_packages + + +cwd = os.path.abspath(os.getcwd()) +FIXED_REQF = os.path.join(cwd, '../fixed-requirements.txt') +LOCAL_REQF = os.path.join(cwd, 'requirements.txt') +GET_PIP = " curl https://bootstrap.pypa.io/get-pip.py | python" + +try: + import pip + from pip.req import parse_requirements +except ImportError: + print "Download pip:\n", GET_PIP + sys.exit(1) + + +def check_pip_version(): + if StrictVersion(pip.__version__) < StrictVersion('7.0.0'): + print "Upgrade pip, your version `{}' "\ + "is outdated:\n".format(pip.__version__), GET_PIP + sys.exit(1) + + +def check_requiremnts_sources(): + for f in (FIXED_REQF, LOCAL_REQF): + if not os.path.exists(f): + print "Error: file `{}' not found".format(f) + sys.exit(1) + + +def load_requirements(file_path): + return tuple((r for r in parse_requirements(file_path, session=False))) + + +def fixate(): + local_reqs = load_requirements(LOCAL_REQF) + fixed_reqs = load_requirements(FIXED_REQF) + + with open("final-requirements.txt", "w") as f: + f.write("# Don't edit this file. It's generated automatically!\n") + for req in local_reqs: + # we don't have any idea how to process links, so just add them + if req.link: + rline = str(req.link) + "\n" + elif req.req: + fixed = next((r for r in fixed_reqs if r.req.project_name + == req.req.project_name), None) + rline = (str(fixed.req) if fixed else str(req.req)) + "\n" + else: + raise RuntimeError("Unexpected requirement {}".format(req)) + f.write(rline) + + +if __name__ == "__main__": + check_pip_version() + check_requiremnts_sources() + fixate() From 4d973be72ba4a63efc9e56a4ea78d6a413262b99 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Mon, 22 Jun 2015 20:31:51 +0300 Subject: [PATCH 4/9] import cleanups --- scripts/fixate-requirements.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index 7b796ae25d..8cca8d89d1 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -3,10 +3,7 @@ import os import os.path import sys -import pprint -from urlparse import urlparse from distutils.version import StrictVersion -from setuptools import setup, find_packages cwd = os.path.abspath(os.getcwd()) From 48a07a6afa2c914c6862ce74d4c579ac4e47492d Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 24 Jun 2015 20:26:35 +0300 Subject: [PATCH 5/9] requirements move on, source merging with fixate-requirements.py --- fixed-requirements.txt | 1 + scripts/fixate-requirements.py | 130 ++++++++++++++---- st2_version | 1 + st2common/MANIFEST.in | 4 + st2common/Makefile | 3 + .../{requirements.txt => in-requirements.txt} | 0 st2common/setup.py | 28 ++-- 7 files changed, 125 insertions(+), 42 deletions(-) create mode 100644 fixed-requirements.txt create mode 100644 st2_version create mode 100644 st2common/MANIFEST.in rename st2common/{requirements.txt => in-requirements.txt} (100%) diff --git a/fixed-requirements.txt b/fixed-requirements.txt new file mode 100644 index 0000000000..a6a628e6cd --- /dev/null +++ b/fixed-requirements.txt @@ -0,0 +1 @@ +eventlet>=0.13.0 diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index 8cca8d89d1..e501d3e850 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -1,62 +1,134 @@ #!/usr/bin/env python +# Licensed to the StackStorm, Inc ('StackStorm') under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +This script is used to automate generation of requirements.txt +for st2 components. + +The idea behind this script is that that each component has it's own requirements +in-requirements.txt file (input requirements file). Except this file +there's also the top-level fixed-requirements.txt which pins production versions +for the whole st2 stack. During production use (building, packaging, etc) +requirements.txt is generated from in-requirements.txt where version of packages are +fixed according to fixed-requirements.txt. +""" + +import argparse import os import os.path import sys from distutils.version import StrictVersion - -cwd = os.path.abspath(os.getcwd()) -FIXED_REQF = os.path.join(cwd, '../fixed-requirements.txt') -LOCAL_REQF = os.path.join(cwd, 'requirements.txt') -GET_PIP = " curl https://bootstrap.pypa.io/get-pip.py | python" +OSCWD = os.path.abspath(os.curdir) +GET_PIP = ' curl https://bootstrap.pypa.io/get-pip.py | python' try: import pip from pip.req import parse_requirements except ImportError: - print "Download pip:\n", GET_PIP + print 'Download pip:\n', GET_PIP sys.exit(1) +def parse_args(): + parser = argparse.ArgumentParser(description='Tool for requirements.txt generation.') + parser.add_argument('-s', '--source-requirements', nargs='+', + required=True, + help='Specifiy paths to requirements file(s). ' + 'In case severasl requirements files are given their content is merged.') + parser.add_argument('-f', '--fixed-requirements', required=True, + help='Specifiy path to fixed-requirements.txt file.') + parser.add_argument('-o', '--output-file', default='requirements.txt', + help='Specifiy path to the resulting requirements file.') + if len(sys.argv) < 2: + parser.print_help() + sys.exit(1) + return vars(parser.parse_args()) + + def check_pip_version(): - if StrictVersion(pip.__version__) < StrictVersion('7.0.0'): + if StrictVersion(pip.__version__) < StrictVersion('6.0.0'): print "Upgrade pip, your version `{}' "\ "is outdated:\n".format(pip.__version__), GET_PIP sys.exit(1) -def check_requiremnts_sources(): - for f in (FIXED_REQF, LOCAL_REQF): - if not os.path.exists(f): - print "Error: file `{}' not found".format(f) - sys.exit(1) - - def load_requirements(file_path): return tuple((r for r in parse_requirements(file_path, session=False))) -def fixate(): - local_reqs = load_requirements(LOCAL_REQF) - fixed_reqs = load_requirements(FIXED_REQF) +def locate_file(path, must_exist=False): + if not os.path.isabs(path): + path = os.path.join(OSCWD, path) + if must_exist and not os.path.isfile(path): + print("Error: couldn't locate file `{}'".format(path)) + return path - with open("final-requirements.txt", "w") as f: + +def merge_source_requirements(sources): + """Read requirements source files and merge it's content. + """ + projects = set() + merged_requirements = [] + for infile_path in (locate_file(p, must_exist=True) for p in sources): + for req in load_requirements(infile_path): + # Requirements lines like "project[version_spec]" + if req.req: + # Skip already added project name + if req.req.project_name in projects: + continue + projects.add(req.req.project_name) + merged_requirements.append(req) + + # Requirements lines like "vcs+proto://url" + elif req.link: + merged_requirements.append(req) + else: + raise RuntimeError('Unexpected requirement {}'.format(req)) + + return merged_requirements + + +def write_requirements(sources=None, fixed_requirements=None, output_file=None): + """Wrire resulting requirements taking versions from the fixed_requirements. + """ + requirements = merge_source_requirements(sources) + fixed = load_requirements(locate_file(fixed_requirements, must_exist=True)) + fixedreq_hash = {req.req.project_name: req for req in fixed if req.req} + + with open(output_file, 'w') as f: f.write("# Don't edit this file. It's generated automatically!\n") - for req in local_reqs: + for req in requirements: # we don't have any idea how to process links, so just add them if req.link: - rline = str(req.link) + "\n" - elif req.req: - fixed = next((r for r in fixed_reqs if r.req.project_name - == req.req.project_name), None) - rline = (str(fixed.req) if fixed else str(req.req)) + "\n" + rline = str(req.link) else: - raise RuntimeError("Unexpected requirement {}".format(req)) - f.write(rline) + project = req.req.project_name + if project in fixedreq_hash: + rline = str(fixedreq_hash[project]) + else: + rline = str(req.req) + f.write(rline + '\n') + + return -if __name__ == "__main__": +if __name__ == '__main__': check_pip_version() - check_requiremnts_sources() - fixate() + args = parse_args() + write_requirements(sources=args['source_requirements'], + fixed_requirements=args['fixed_requirements'], + output_file=args['output_file']) diff --git a/st2_version b/st2_version new file mode 100644 index 0000000000..f228ab0275 --- /dev/null +++ b/st2_version @@ -0,0 +1 @@ +0.10dev0 diff --git a/st2common/MANIFEST.in b/st2common/MANIFEST.in new file mode 100644 index 0000000000..07fd4cc209 --- /dev/null +++ b/st2common/MANIFEST.in @@ -0,0 +1,4 @@ +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Other behaviour can be used though. +recursive-include st2common *.* * diff --git a/st2common/Makefile b/st2common/Makefile index 5286d87e39..4f3e272a0e 100644 --- a/st2common/Makefile +++ b/st2common/Makefile @@ -32,3 +32,6 @@ deb: tar --transform=s~^~$(COMPONENTS)-$(VER)/~ --exclude=correlation -czf ~/$(COMPONENTS).tar.gz bin st2 logrotate.d $(COMPONENTS) ../contrib ../docs ../tools/ ../requirements.txt packaging/debian pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ + +.PHONY: requirements + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2common/requirements.txt b/st2common/in-requirements.txt similarity index 100% rename from st2common/requirements.txt rename to st2common/in-requirements.txt diff --git a/st2common/setup.py b/st2common/setup.py index 08dc7e61d7..0afc9ca581 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re +# Just setup pip before using with a command: +# curl https://bootstrap.pypa.io/get-pip.py | python + import os.path from pip.req import parse_requirements from setuptools import setup, find_packages @@ -29,28 +31,28 @@ def fetch_requirements(): reqs.append(str(req.req)) return (reqs, links) - current_dir = os.path.dirname(os.path.realpath(__file__)) -version_file = os.path.join(current_dir, '../st2client/st2client/__init__.py') -with open(version_file, 'r') as f: - vmatch = re.search(r'__version__ = [\'\"](.*)[\'\"]$', f.read(), flags=re.MULTILINE) - +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() install_reqs, dep_links = fetch_requirements() -ST2_COMPONENT = os.path.basename(current_dir) -ST2_VERSION = vmatch.group(1) +st2_component = os.path.basename(current_dir) setup( - name=ST2_COMPONENT, - version=ST2_VERSION, - description='{} component'.format(ST2_COMPONENT), + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, - test_suite=ST2_COMPONENT, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['setuptools']) + packages=find_packages(exclude=['setuptools', 'examples', 'tests']), + scripts=[ + 'bin/st2-bootstrap-rmq', + 'bin/st2-register-content' + ] ) From a51c4f224cf5b993d42a3e4daac3ce413550fed8 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 24 Jun 2015 22:07:36 +0300 Subject: [PATCH 6/9] renaming requirements.txt -> in-requirements.txt, makefiles fixes --- Makefile | 4 +++- scripts/fixate-requirements.py | 2 +- st2actions/Makefile | 3 +++ st2actions/in-requirements.txt | 11 +++++++++++ st2api/Makefile | 3 +++ st2api/{requirements.txt => in-requirements.txt} | 0 st2auth/Makefile | 4 ++++ st2auth/{requirements.txt => in-requirements.txt} | 0 st2client/Makefile | 4 ++++ st2client/{requirements.txt => in-requirements.txt} | 0 st2common/Makefile | 1 + st2debug/Makefile | 4 ++++ st2reactor/Makefile | 3 +++ st2reactor/{requirement.txt => in-requirements.txt} | 0 14 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 st2actions/in-requirements.txt rename st2api/{requirements.txt => in-requirements.txt} (100%) rename st2auth/{requirements.txt => in-requirements.txt} (100%) rename st2client/{requirements.txt => in-requirements.txt} (100%) rename st2reactor/{requirement.txt => in-requirements.txt} (100%) diff --git a/Makefile b/Makefile index 7fa62cb249..d024e9303b 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ COMPONENTS_TEST := $(foreach component,$(filter-out $(COMPONENT_SPECIFIC_TESTS), PYTHON_TARGET := 2.7 -REQUIREMENTS := requirements.txt test-requirements.txt st2client/requirements.txt +REQUIREMENTS := requirements.txt test-requirements.txt PIP_OPTIONS := $(ST2_PIP_OPTIONS) @@ -168,6 +168,8 @@ requirements: virtualenv $(REQUIREMENTS) @echo @echo "==================== requirements ====================" @echo + # Merge into one st2 components-wide requirements.txt file. + python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt for req in $(REQUIREMENTS); do \ echo "Installing $$req..." ; \ . $(VIRTUALENV_DIR)/bin/activate && pip install $(PIP_OPTIONS) $$req ; \ diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index e501d3e850..3ad95c518a 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -118,7 +118,7 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): else: project = req.req.project_name if project in fixedreq_hash: - rline = str(fixedreq_hash[project]) + rline = str(fixedreq_hash[project].req) else: rline = str(req.req) f.write(rline + '\n') diff --git a/st2actions/Makefile b/st2actions/Makefile index a628108d88..1543b5920e 100644 --- a/st2actions/Makefile +++ b/st2actions/Makefile @@ -42,3 +42,6 @@ deb: pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2actions/in-requirements.txt b/st2actions/in-requirements.txt new file mode 100644 index 0000000000..0f93ce1bbe --- /dev/null +++ b/st2actions/in-requirements.txt @@ -0,0 +1,11 @@ +apscheduler +python-dateutil +eventlet +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric +jinja2 +kombu +git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0#egg=python-mistralclient +oslo.config +requests +six +pyyaml diff --git a/st2api/Makefile b/st2api/Makefile index 15ced17adb..a7737297a9 100644 --- a/st2api/Makefile +++ b/st2api/Makefile @@ -40,3 +40,6 @@ deb: pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2api/requirements.txt b/st2api/in-requirements.txt similarity index 100% rename from st2api/requirements.txt rename to st2api/in-requirements.txt diff --git a/st2auth/Makefile b/st2auth/Makefile index 95b54583ec..e117fd0899 100644 --- a/st2auth/Makefile +++ b/st2auth/Makefile @@ -39,3 +39,7 @@ deb: tar --transform=s~^~$(COMPONENTS)-$(VER)/~ -czf ~/$(COMPONENTS).tar.gz bin conf $(COMPONENTS) packaging/debian pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ + +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2auth/requirements.txt b/st2auth/in-requirements.txt similarity index 100% rename from st2auth/requirements.txt rename to st2auth/in-requirements.txt diff --git a/st2client/Makefile b/st2client/Makefile index 98306062fa..f05583d14d 100644 --- a/st2client/Makefile +++ b/st2client/Makefile @@ -31,3 +31,7 @@ deb: mkdir -p ~/debbuild cp deb_dist/python-$(COMPONENTS)*-1_all.deb ~/debbuild/$(COMPONENTS)_$(VER)-$(RELEASE)_amd64.deb rm -Rf dist deb_dist $(COMPONENTS)-$(VER).tar.gz $(COMPONENTS).egg-info ChangeLog AUTHORS build + +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2client/requirements.txt b/st2client/in-requirements.txt similarity index 100% rename from st2client/requirements.txt rename to st2client/in-requirements.txt diff --git a/st2common/Makefile b/st2common/Makefile index 4f3e272a0e..2705503528 100644 --- a/st2common/Makefile +++ b/st2common/Makefile @@ -34,4 +34,5 @@ deb: cp -f ~/$(COMPONENT)*.deb ~/debbuild/ .PHONY: requirements +requirements: python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2debug/Makefile b/st2debug/Makefile index 86719900e0..653b694e30 100644 --- a/st2debug/Makefile +++ b/st2debug/Makefile @@ -39,3 +39,7 @@ deb: tar --transform=s~^~$(COMPONENTS)-$(VER)/~ -czf ~/$(COMPONENTS).tar.gz bin $(COMPONENTS) packaging/debian pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ + +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2reactor/Makefile b/st2reactor/Makefile index e1a85c2051..8320f229c9 100644 --- a/st2reactor/Makefile +++ b/st2reactor/Makefile @@ -26,3 +26,6 @@ deb: pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd cp -f ~/$(COMPONENT)*.deb ~/debbuild/ +.PHONY: requirements +requirements: + python ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt diff --git a/st2reactor/requirement.txt b/st2reactor/in-requirements.txt similarity index 100% rename from st2reactor/requirement.txt rename to st2reactor/in-requirements.txt From 68b0826374193e8fb99883acd5ffc8cba012dcd5 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Fri, 26 Jun 2015 13:16:25 +0300 Subject: [PATCH 7/9] removing versions from in-requirements.txt --- fixed-requirements.txt | 17 +++++++++++++++++ scripts/fixate-requirements.py | 6 ++++-- st2actions/MANIFEST.in | 5 ++++- st2api/MANIFEST.in | 5 ++++- st2api/in-requirements.txt | 10 +++++----- st2auth/MANIFEST.in | 5 ++++- st2auth/in-requirements.txt | 10 +++++----- st2client/MANIFEST.in | 5 ++++- st2client/in-requirements.txt | 4 ++-- st2common/MANIFEST.in | 2 +- st2common/in-requirements.txt | 12 ++++++------ st2debug/MANIFEST.in | 4 ++++ st2debug/in-requirements.txt | 4 ++++ st2debug/requirements.txt | 4 ---- st2reactor/MANIFEST.in | 4 ++++ st2reactor/in-requirements.txt | 10 +++++----- 16 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 st2debug/MANIFEST.in create mode 100644 st2debug/in-requirements.txt delete mode 100644 st2debug/requirements.txt create mode 100644 st2reactor/MANIFEST.in diff --git a/fixed-requirements.txt b/fixed-requirements.txt index a6a628e6cd..d6b0390933 100644 --- a/fixed-requirements.txt +++ b/fixed-requirements.txt @@ -1 +1,18 @@ +# Packages versions fixed for the whole st2 stack eventlet>=0.13.0 +six==1.9.0 +apscheduler>=3.0.0rc1 +eventlet>=0.13.0 +gitpython==0.3.2.1 +jsonschema>=2.3.0 +mongoengine>=0.8.7,<0.9 +pecan==0.7.0 +pymongo<3.0 +six==1.9.0 +passlib>=1.6.2,<1.7 +lockfile>=0.10.2,<0.11 +python-gnupg>=0.3.7,<0.4 +jsonpath-rw>=1.3.0 +pyinotify>=0.9.5,<=0.10 +python-nmap>=0.3.4,<0.4 +semver>=2.1.2 diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index 3ad95c518a..e187061551 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -111,11 +111,13 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): with open(output_file, 'w') as f: f.write("# Don't edit this file. It's generated automatically!\n") + links = set() for req in requirements: # we don't have any idea how to process links, so just add them - if req.link: + if req.link and req.link not in links: + links.add(req.link) rline = str(req.link) - else: + elif req.req: project = req.req.project_name if project in fixedreq_hash: rline = str(fixedreq_hash[project].req) diff --git a/st2actions/MANIFEST.in b/st2actions/MANIFEST.in index 8226a3afaa..28556e968b 100644 --- a/st2actions/MANIFEST.in +++ b/st2actions/MANIFEST.in @@ -1 +1,4 @@ -recursive-include * +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2actions *.* * diff --git a/st2api/MANIFEST.in b/st2api/MANIFEST.in index c922f11ad7..27c6005d1c 100644 --- a/st2api/MANIFEST.in +++ b/st2api/MANIFEST.in @@ -1 +1,4 @@ -recursive-include public * +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2api *.* * diff --git a/st2api/in-requirements.txt b/st2api/in-requirements.txt index f77cf95ecd..0e6cc0f013 100644 --- a/st2api/in-requirements.txt +++ b/st2api/in-requirements.txt @@ -1,7 +1,7 @@ -eventlet>=0.13.0 -jsonschema>=2.3.0 +eventlet +jsonschema kombu -mongoengine>=0.8.7,<0.9 +mongoengine oslo.config -pecan==0.7.0 -six==1.9.0 +pecan +six diff --git a/st2auth/MANIFEST.in b/st2auth/MANIFEST.in index c922f11ad7..440a6b8741 100644 --- a/st2auth/MANIFEST.in +++ b/st2auth/MANIFEST.in @@ -1 +1,4 @@ -recursive-include public * +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2auth *.* * diff --git a/st2auth/in-requirements.txt b/st2auth/in-requirements.txt index d3efad133d..38727eda5a 100644 --- a/st2auth/in-requirements.txt +++ b/st2auth/in-requirements.txt @@ -1,6 +1,6 @@ -eventlet>=0.13.0 +eventlet oslo.config -passlib>=1.6.2,<1.7 -pecan==0.7.0 -pymongo<3.0 -six==1.9.0 +passlib +pecan +pymongo +six diff --git a/st2client/MANIFEST.in b/st2client/MANIFEST.in index a7da3fcb49..84aa989c43 100644 --- a/st2client/MANIFEST.in +++ b/st2client/MANIFEST.in @@ -1,2 +1,5 @@ -include requirements.txt +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2client *.* * include LICENSE diff --git a/st2client/in-requirements.txt b/st2client/in-requirements.txt index 793264fa16..80564f1e64 100644 --- a/st2client/in-requirements.txt +++ b/st2client/in-requirements.txt @@ -1,6 +1,6 @@ prettytable python-dateutil pyyaml -jsonpath-rw>=1.3.0 +jsonpath-rw requests -six==1.9.0 +six diff --git a/st2common/MANIFEST.in b/st2common/MANIFEST.in index 07fd4cc209..1bad7eda3c 100644 --- a/st2common/MANIFEST.in +++ b/st2common/MANIFEST.in @@ -1,4 +1,4 @@ # https://docs.python.org/2/distutils/sourcedist.html#commands # Include all files under the source tree by default. -# Other behaviour can be used though. +# Another behaviour can be used in the future though. recursive-include st2common *.* * diff --git a/st2common/in-requirements.txt b/st2common/in-requirements.txt index 7e5666b710..b31e10f562 100644 --- a/st2common/in-requirements.txt +++ b/st2common/in-requirements.txt @@ -1,15 +1,15 @@ python-dateutil -eventlet>=0.13.0 +eventlet git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric jinja2 -jsonschema>=2.3.0 +jsonschema kombu -mongoengine>=0.8.7,<0.9 +mongoengine oslo.config paramiko -pecan==0.7.0 +pecan pyyaml requests -semver>=2.1.2 -six==1.9.0 +semver +six tooz diff --git a/st2debug/MANIFEST.in b/st2debug/MANIFEST.in new file mode 100644 index 0000000000..4460d8dcc6 --- /dev/null +++ b/st2debug/MANIFEST.in @@ -0,0 +1,4 @@ +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2debug *.* * diff --git a/st2debug/in-requirements.txt b/st2debug/in-requirements.txt new file mode 100644 index 0000000000..96ec4e8977 --- /dev/null +++ b/st2debug/in-requirements.txt @@ -0,0 +1,4 @@ +python-gnupg +requests +six +pyyaml diff --git a/st2debug/requirements.txt b/st2debug/requirements.txt deleted file mode 100644 index 4bd03da64c..0000000000 --- a/st2debug/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -python-gnupg>=0.3.7,<0.4 -requests -six==1.9.0 -pyyaml diff --git a/st2reactor/MANIFEST.in b/st2reactor/MANIFEST.in new file mode 100644 index 0000000000..9baa625501 --- /dev/null +++ b/st2reactor/MANIFEST.in @@ -0,0 +1,4 @@ +# https://docs.python.org/2/distutils/sourcedist.html#commands +# Include all files under the source tree by default. +# Another behaviour can be used in the future though. +recursive-include st2reactor *.* * diff --git a/st2reactor/in-requirements.txt b/st2reactor/in-requirements.txt index 0a1bfdf8f1..36144736e8 100644 --- a/st2reactor/in-requirements.txt +++ b/st2reactor/in-requirements.txt @@ -1,8 +1,8 @@ -apscheduler>=3.0.0rc1 +apscheduler python-dateutil -eventlet>=0.13.0 -jsonpath-rw>=1.3.0 -jsonschema>=2.3.0 +eventlet +jsonpath-rw +jsonschema kombu oslo.config -six==1.9.0 +six From 09593f8b6f08a904532b5f70811965a8f6836c92 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Fri, 26 Jun 2015 13:44:17 +0300 Subject: [PATCH 8/9] setup.py unify --- st2_version | 2 +- st2actions/setup.py | 47 +++++++++++++++++++++++---------- st2api/setup.py | 24 ++++++++--------- st2auth/setup.py | 45 ++++++++++++++++++++++---------- st2client/setup.py | 63 +++++++++++++++++---------------------------- st2common/setup.py | 2 +- st2debug/setup.py | 42 ++++++++++++++++++++++-------- st2reactor/setup.py | 48 ++++++++++++++++++++++++---------- 8 files changed, 166 insertions(+), 107 deletions(-) diff --git a/st2_version b/st2_version index f228ab0275..d8c320324c 100644 --- a/st2_version +++ b/st2_version @@ -1 +1 @@ -0.10dev0 +0.10.dev0 diff --git a/st2actions/setup.py b/st2actions/setup.py index 2a83d35251..ecdd6340d1 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -14,24 +14,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + +current_dir = os.path.dirname(os.path.realpath(__file__)) +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() + +install_reqs, dep_links = fetch_requirements() +st2_component = os.path.basename(current_dir) + setup( - name='st2actions', - version='0.4.0', - description='', + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', - install_requires=[ - "pecan", - ], - test_suite='st2actions', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools', 'tests']), + scripts=[ + 'bin/st2actionrunner', + 'bin/st2notifier', + 'bin/st2resultstracker' + ] ) diff --git a/st2api/setup.py b/st2api/setup.py index 08dc7e61d7..7b5ba2a82f 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re import os.path from pip.req import parse_requirements from setuptools import setup, find_packages @@ -29,28 +28,27 @@ def fetch_requirements(): reqs.append(str(req.req)) return (reqs, links) - current_dir = os.path.dirname(os.path.realpath(__file__)) -version_file = os.path.join(current_dir, '../st2client/st2client/__init__.py') -with open(version_file, 'r') as f: - vmatch = re.search(r'__version__ = [\'\"](.*)[\'\"]$', f.read(), flags=re.MULTILINE) - +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() install_reqs, dep_links = fetch_requirements() -ST2_COMPONENT = os.path.basename(current_dir) -ST2_VERSION = vmatch.group(1) +st2_component = os.path.basename(current_dir) setup( - name=ST2_COMPONENT, - version=ST2_VERSION, - description='{} component'.format(ST2_COMPONENT), + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, - test_suite=ST2_COMPONENT, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['setuptools']) + packages=find_packages(exclude=['setuptools', 'tests']), + scripts=[ + 'bin/st2api' + ] ) diff --git a/st2auth/setup.py b/st2auth/setup.py index 675c1dbe22..03d559975b 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -14,24 +14,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + +current_dir = os.path.dirname(os.path.realpath(__file__)) +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() + +install_reqs, dep_links = fetch_requirements() +st2_component = os.path.basename(current_dir) + setup( - name='st2auth', - version='0.4.0', - description='', + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', - install_requires=[ - "pecan", - ], - test_suite='st2auth', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools', 'tests']), + scripts=[ + 'bin/st2auth' + ] ) diff --git a/st2client/setup.py b/st2client/setup.py index 963a4a4dbb..b3d508d334 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -14,55 +14,40 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys - +import os.path +from pip.req import parse_requirements from setuptools import setup, find_packages -PKG_ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) -PKG_REQ_FILE = '%s/requirements.txt' % PKG_ROOT_DIR -os.chdir(PKG_ROOT_DIR) - - -def get_version_string(): - version = None - sys.path.insert(0, PKG_ROOT_DIR) - from st2client import __version__ - version = __version__ - sys.path.pop(0) - return version - +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) -def get_requirements(): - with open(PKG_REQ_FILE) as f: - required = f.read().splitlines() +current_dir = os.path.dirname(os.path.realpath(__file__)) +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() - # Ignore comments in the requirements file - required = [line for line in required if not line.startswith('#')] - return required +install_reqs, dep_links = fetch_requirements() +st2_component = os.path.basename(current_dir) setup( - name='st2client', - version=get_version_string(), - description='CLI and python client library for the StackStorm (st2) automation platform.', + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', - url='http://www.stackstorm.com', - packages=find_packages(exclude=['tests']), - install_requires=get_requirements(), - license='Apache License (2.0)', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7' - ], + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=st2_component, + zip_safe=False, + include_package_data=True, + packages=find_packages(exclude=['setuptools', 'tests']), entry_points={ 'console_scripts': [ 'st2 = st2client.shell:main' diff --git a/st2common/setup.py b/st2common/setup.py index 0afc9ca581..da59a3b316 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -50,7 +50,7 @@ def fetch_requirements(): test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['setuptools', 'examples', 'tests']), + packages=find_packages(exclude=['setuptools', 'tests']), scripts=[ 'bin/st2-bootstrap-rmq', 'bin/st2-register-content' diff --git a/st2debug/setup.py b/st2debug/setup.py index 69af675475..dd43fd3e83 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -14,21 +14,41 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + +current_dir = os.path.dirname(os.path.realpath(__file__)) +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() + +install_reqs, dep_links = fetch_requirements() +st2_component = os.path.basename(current_dir) + setup( - name='st2debug', - version='0.4.0', - description='', + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', - test_suite='st2debug', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools', 'tests']), + scripts=[ + 'bin/st2-submit-debug-info' + ] ) diff --git a/st2reactor/setup.py b/st2reactor/setup.py index 77b0757a74..bdefff9bf3 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -14,24 +14,44 @@ # See the License for the specific language governing permissions and # limitations under the License. -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages +import os.path +from pip.req import parse_requirements +from setuptools import setup, find_packages + + +def fetch_requirements(): + links = [] + reqs = [] + for req in parse_requirements('requirements.txt', session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + +current_dir = os.path.dirname(os.path.realpath(__file__)) +with open(os.path.join(current_dir, 'st2_version'), 'r') as f: + st2_version = f.read().strip() + +install_reqs, dep_links = fetch_requirements() +st2_component = os.path.basename(current_dir) + setup( - name='st2reactor', - version='0.4.0', - description='', + name=st2_component, + version=st2_version, + description='{} component'.format(st2_component), author='StackStorm', author_email='info@stackstorm.com', - install_requires=[ - "pecan", - ], - test_suite='st2reactor', + install_requires=install_reqs, + dependency_links=dep_links, + test_suite=st2_component, zip_safe=False, include_package_data=True, - packages=find_packages(exclude=['ez_setup']) + packages=find_packages(exclude=['setuptools', 'tests']), + scripts=[ + 'bin/st2-rule-tester', + 'bin/st2-trigger-refire', + 'bin/st2rulesengine', + 'bin/st2sensorcontainer' + ] ) From d43f06d02f28ac8d3cbe894ba65b9e73b9c71315 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Fri, 26 Jun 2015 16:11:52 +0300 Subject: [PATCH 9/9] version bump --- st2_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2_version b/st2_version index d8c320324c..df39e58274 100644 --- a/st2_version +++ b/st2_version @@ -1 +1 @@ -0.10.dev0 +0.10.dev1