From 036177dc35eaed8dadf08b8697f7e657114a3a76 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Wed, 17 Jun 2015 21:36:48 +0300 Subject: [PATCH 01/51] 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 02/51] 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 03/51] 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 04/51] 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 05/51] 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 06/51] 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 07/51] 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 08/51] 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 09/51] 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 From 5c94d849ae2f5056227766863a229f387637fce6 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 11:28:02 +0800 Subject: [PATCH 10/51] Fix typos. --- scripts/fixate-requirements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index e187061551..8b7033da35 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -47,8 +47,8 @@ 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.') + help='Specify paths to requirements file(s). ' + 'In case several 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', From 905915e11102b7ff77b30dc91b72b93ae7c48f4e Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 11:29:30 +0800 Subject: [PATCH 11/51] Log where the requirements are written, fix typos and sort the requirements to preserve a stable order. --- scripts/fixate-requirements.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index 8b7033da35..fe605e1ea8 100644 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -15,12 +15,11 @@ # limitations under the License. """ -This script is used to automate generation of requirements.txt -for st2 components. +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 +"in-requirements.txt" file (input requirements file). In addition to 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. @@ -50,9 +49,9 @@ def parse_args(): help='Specify paths to requirements file(s). ' 'In case several requirements files are given their content is merged.') parser.add_argument('-f', '--fixed-requirements', required=True, - help='Specifiy path to fixed-requirements.txt file.') + help='Specify path to fixed-requirements.txt file.') parser.add_argument('-o', '--output-file', default='requirements.txt', - help='Specifiy path to the resulting requirements file.') + help='Specify path to the resulting requirements file.') if len(sys.argv) < 2: parser.print_help() sys.exit(1) @@ -79,7 +78,8 @@ def locate_file(path, must_exist=False): def merge_source_requirements(sources): - """Read requirements source files and merge it's content. + """ + Read requirements source files and merge it's content. """ projects = set() merged_requirements = [] @@ -103,9 +103,12 @@ def merge_source_requirements(sources): def write_requirements(sources=None, fixed_requirements=None, output_file=None): - """Wrire resulting requirements taking versions from the fixed_requirements. + """ + Write resulting requirements taking versions from the fixed_requirements. """ requirements = merge_source_requirements(sources) + # Sort the requirements to guarantee a stable order + requirements = sorted(requirements) fixed = load_requirements(locate_file(fixed_requirements, must_exist=True)) fixedreq_hash = {req.req.project_name: req for req in fixed if req.req} @@ -125,7 +128,7 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): rline = str(req.req) f.write(rline + '\n') - return + print('Requirements written to: {}'.format(output_file)) if __name__ == '__main__': From 66f6393818e0826dbc44623fb6330e21abdc99e2 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 16:48:26 +0800 Subject: [PATCH 12/51] Make file executable. --- scripts/fixate-requirements.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/fixate-requirements.py diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py old mode 100644 new mode 100755 From 35a58f8d406ccc2ab41321ba7bf35beca0e12ffb Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 16:58:32 +0800 Subject: [PATCH 13/51] Instead of copy and pasting code around in setup.py files, add all the common code to "dist_utils.py" module and copy this module over to each component package directory during build step. Update affected code. --- Makefile | 6 ++++++ scripts/dist_utils.py | 46 +++++++++++++++++++++++++++++++++++++++++++ st2actions/setup.py | 29 +++++++++++---------------- st2api/setup.py | 29 +++++++++++---------------- st2auth/setup.py | 29 +++++++++++---------------- st2client/setup.py | 29 +++++++++++---------------- st2common/setup.py | 32 +++++++++++------------------- st2debug/setup.py | 29 +++++++++++---------------- st2reactor/setup.py | 29 +++++++++++---------------- 9 files changed, 129 insertions(+), 129 deletions(-) create mode 100644 scripts/dist_utils.py diff --git a/Makefile b/Makefile index 9fa0a5091e..5093e956be 100644 --- a/Makefile +++ b/Makefile @@ -173,6 +173,12 @@ requirements: virtualenv $(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 + + # Copy over shared dist utils module which is needed by setup.py + @for component in $(COMPONENTS_TEST); do\ + cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ + done + for req in $(REQUIREMENTS); do \ echo "Installing $$req..." ; \ . $(VIRTUALENV_DIR)/bin/activate && pip install $(PIP_OPTIONS) $$req ; \ diff --git a/scripts/dist_utils.py b/scripts/dist_utils.py new file mode 100644 index 0000000000..43f220815b --- /dev/null +++ b/scripts/dist_utils.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) + + +def parse_version(version_file_path): + """ + Parse a version string from the provided version file. + """ + # TODO: For backward compatibility we use a global version file but eventually we should + # support per component versioning + with open(version_file_path, 'r') as f: + version = f.read().strip() + + return version diff --git a/st2actions/setup.py b/st2actions/setup.py index ecdd6340d1..5de8598a3f 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2api/setup.py b/st2api/setup.py index 7b5ba2a82f..7cb9f725f0 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2auth/setup.py b/st2auth/setup.py index 03d559975b..8483c9bef0 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2client/setup.py b/st2client/setup.py index b3d508d334..98603a5167 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2common/setup.py b/st2common/setup.py index da59a3b316..60f89472ef 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -14,40 +14,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -# 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 +from dist_utils import fetch_requirements +from dist_utils import parse_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) - -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() +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -install_reqs, dep_links = fetch_requirements() -st2_component = os.path.basename(current_dir) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2debug/setup.py b/st2debug/setup.py index dd43fd3e83..fa56b30780 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), diff --git a/st2reactor/setup.py b/st2reactor/setup.py index bdefff9bf3..b43fc91512 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -15,36 +15,29 @@ # limitations under the License. import os.path -from pip.req import parse_requirements from setuptools import setup, find_packages +from dist_utils import fetch_requirements +from dist_utils import parse_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) +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -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) +ST2_COMPONENT = os.path.basename(BASE_DIR) +REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') +VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') +install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +st2_version = parse_version(VERSION_FILE) setup( - name=st2_component, + name=ST2_COMPONENT, version=st2_version, - description='{} component'.format(st2_component), + 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', 'tests']), From 8e4cf589461534555137d00970a4c2ae6f435399 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 17:09:56 +0800 Subject: [PATCH 14/51] Add new sdist-requirements Make target which copies over required files to each component package directory. --- Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5093e956be..067bcbc133 100644 --- a/Makefile +++ b/Makefile @@ -174,11 +174,6 @@ requirements: virtualenv $(REQUIREMENTS) # Merge into one st2 components-wide requirements.txt file. python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt - # Copy over shared dist utils module which is needed by setup.py - @for component in $(COMPONENTS_TEST); do\ - cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ - done - for req in $(REQUIREMENTS); do \ echo "Installing $$req..." ; \ . $(VIRTUALENV_DIR)/bin/activate && pip install $(PIP_OPTIONS) $$req ; \ @@ -276,6 +271,21 @@ itests: requirements .itests . $(VIRTUALENV_DIR)/bin/activate; nosetests -sv $$component/tests/integration || exit 1; \ done +.PHONY: sdist-requirements +sdist-requirements: + # Copy over shared dist utils module which is needed by setup.py + @for component in $(COMPONENTS_TEST); do\ + cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ + done + + # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory + @for component in $(COMPONENTS_TEST); do\ + cp -f README.md $$component/; \ + cp -f CHANGELOG.rst $$component/; \ + cp -f CONTRIBUTING.rst $$component/; \ + cp -f LICENSE $$component/; \ + done + .PHONY: mistral-itests mistral-itests: requirements .mistral-itests From d5fba8ed2c7eb17a219fa9cf9b2570e6e6471349 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 17:14:12 +0800 Subject: [PATCH 15/51] Add long_description attribute to each compnent setup.py which is composed from README and CHANGELOG file. --- Makefile | 4 ++-- st2actions/setup.py | 1 + st2api/setup.py | 1 + st2auth/setup.py | 1 + st2client/setup.py | 1 + st2common/setup.py | 1 + st2reactor/setup.py | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 067bcbc133..8e6d19d22c 100644 --- a/Makefile +++ b/Makefile @@ -274,12 +274,12 @@ itests: requirements .itests .PHONY: sdist-requirements sdist-requirements: # Copy over shared dist utils module which is needed by setup.py - @for component in $(COMPONENTS_TEST); do\ + @for component in $(COMPONENTS); do\ cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ done # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory - @for component in $(COMPONENTS_TEST); do\ + @for component in $(COMPONENTS); do\ cp -f README.md $$component/; \ cp -f CHANGELOG.rst $$component/; \ cp -f CONTRIBUTING.rst $$component/; \ diff --git a/st2actions/setup.py b/st2actions/setup.py index 5de8598a3f..8a56e9220c 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, diff --git a/st2api/setup.py b/st2api/setup.py index 7cb9f725f0..eac4f4f120 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, diff --git a/st2auth/setup.py b/st2auth/setup.py index 8483c9bef0..8292e5d39d 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, diff --git a/st2client/setup.py b/st2client/setup.py index 98603a5167..dc60ceb361 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, diff --git a/st2common/setup.py b/st2common/setup.py index 60f89472ef..0e34612216 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, diff --git a/st2reactor/setup.py b/st2reactor/setup.py index b43fc91512..ea7ac81558 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -33,6 +33,7 @@ name=ST2_COMPONENT, version=st2_version, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', install_requires=install_reqs, From b7e3e58214bb56b042a9cce708db362499463273 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 17:24:45 +0800 Subject: [PATCH 16/51] Only copy readme over if component specific readme doesn't exist. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8e6d19d22c..ba6f4d3dc4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ DOC_BUILD_DIR := docs/build BINARIES := bin # All components are prefixed by st2 -COMPONENTS := $(wildcard st2*) +COMPONENTS := $(wildcard st2*/) # Components that implement a component-controlled test-runner. These components provide an # in-component Makefile. (Temporary fix until I can generalize the pecan unittest setup. -mar) @@ -280,7 +280,7 @@ sdist-requirements: # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory @for component in $(COMPONENTS); do\ - cp -f README.md $$component/; \ + test -s $$component/README.md || cp -f README.md $$component/; \ cp -f CHANGELOG.rst $$component/; \ cp -f CONTRIBUTING.rst $$component/; \ cp -f LICENSE $$component/; \ From 37c74b8540f02008e461521f4acf0536b021823c Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 17:27:33 +0800 Subject: [PATCH 17/51] Add license and url attribute to each setup.py file. --- st2actions/setup.py | 2 ++ st2api/setup.py | 2 ++ st2auth/setup.py | 2 ++ st2client/setup.py | 2 ++ st2common/setup.py | 2 ++ st2debug/setup.py | 2 ++ st2reactor/setup.py | 2 ++ 7 files changed, 14 insertions(+) diff --git a/st2actions/setup.py b/st2actions/setup.py index 8a56e9220c..40b9942a21 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2api/setup.py b/st2api/setup.py index eac4f4f120..8bdf5ffbc4 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2auth/setup.py b/st2auth/setup.py index 8292e5d39d..61cfa71831 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2client/setup.py b/st2client/setup.py index dc60ceb361..e6bda6d9b4 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2common/setup.py b/st2common/setup.py index 0e34612216..c983363a66 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2debug/setup.py b/st2debug/setup.py index fa56b30780..1ace3983f8 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -35,6 +35,8 @@ description='{} component'.format(ST2_COMPONENT), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, diff --git a/st2reactor/setup.py b/st2reactor/setup.py index ea7ac81558..ddbba06b8b 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -36,6 +36,8 @@ long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', + license='Apache License (2.0)', + url='http://www.stackstorm.com', install_requires=install_reqs, dependency_links=dep_links, test_suite=ST2_COMPONENT, From a6cc390e0af4768184220334461276ee307d5365 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 17:39:35 +0800 Subject: [PATCH 18/51] Add new "sdist" make target which created .tar.gz and wheel archive for each st2 component. --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ba6f4d3dc4..7adab24ebd 100644 --- a/Makefile +++ b/Makefile @@ -271,7 +271,7 @@ itests: requirements .itests . $(VIRTUALENV_DIR)/bin/activate; nosetests -sv $$component/tests/integration || exit 1; \ done -.PHONY: sdist-requirements +.PHONY: .sdist-requirements sdist-requirements: # Copy over shared dist utils module which is needed by setup.py @for component in $(COMPONENTS); do\ @@ -286,6 +286,16 @@ sdist-requirements: cp -f LICENSE $$component/; \ done +.PHONY: sdist +sdist: .sdist-requirements .sdist + +.PHONY: .sdist +.sdist: + @for component in $(COMPONENTS); do\ + python $$component/setup.py sdist;\ + python $$component/setup.py bdist_wheel;\ + done + .PHONY: mistral-itests mistral-itests: requirements .mistral-itests From a767ef4f3d8340d6060f8ce056d2a1fc1c1dd7c2 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 18:04:38 +0800 Subject: [PATCH 19/51] Port readme to rst format. --- README.md | 68 ----------------------- README.rst | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 68 deletions(-) delete mode 100644 README.md create mode 100644 README.rst diff --git a/README.md b/README.md deleted file mode 100644 index f70526d6e9..0000000000 --- a/README.md +++ /dev/null @@ -1,68 +0,0 @@ -[![StackStorm](https://github.com/stackstorm/st2/raw/master/stackstorm_logo.png)](http://www.stackstorm.com) - -**StackStorm** is a platform for integration and automation across services and tools, taking actions in response to events. Learn more at [www.stackstorm.com](http://www.stackstorm.com/product). - -[![Build Status](https://api.travis-ci.org/StackStorm/st2.svg?branch=master)](https://travis-ci.org/StackStorm/st2) [![IRC](https://img.shields.io/irc/%23stackstorm.png)](http://webchat.freenode.net/?channels=stackstorm) - -## StackStorm Overview - -### About - -StackStorm is a platform for integration and automation across services and tools. It ties together your existing infrastructure and application environment so you can more easily automate that environment -- with a particular focus on taking actions in response to events. - -StackStorm helps automate common operational patterns. Some examples are: - -* **Facilitated Troubleshooting** - triggering on system failures captured by Nagios, Sensu, New Relic and other monitoring, running a series of diagnostic checks on physical nodes, OpenStack or Amazon instances, and application components, and posting results to a shared communication context, like HipChat or JIRA. -* **Automated remediation** - identifying and verifying hardware failure on OpenStack compute node, properly evacuating instances and emailing VM about potential downtime, but if anything goes wrong - freezing the workflow and calling PagerDuty to wake up a human. -* **Continuous deployment** - build and test with Jenkins, provision a new AWS cluster, turn on some traffic with the load balancer, and roll-forth or roll-back based on NewRelic app performance data. - -StackStorm helps you compose these and other operational patterns as rules and workflows or actions; and these rules and workflows - the content within the StackStorm platform - are stored *as code* which means they support the same approach to collaboration that you use today for code development and can be shared with the broader open source community via StackStorm.com/community for example. - -### How it works - -![stackstorm component diagram](https://cloud.githubusercontent.com/assets/20028/5688946/fabef9ec-9822-11e4-859e-29bbb67df85b.jpg) - - StackStorm architecture diagram - -StackStorm plugs into the environment via the extensible set of adapters: sensors and actions. - -* **Sensors** are python plugins for inbound integration that watch for events from external systems and fire a StackStorm trigger when event happens. - -* **Triggers** are StackStorm representations of external events. There are generic triggers (e.g. timers, webhooks) and integration triggers (e.g. Sensu alert, JIRA issue updated). A new trigger type can be defined by writing a sensor plugin. - -* **Actions** are StackStorm outbound integrations. There are generic actions (ssh, REST call), integrations (OpenStack, Docker, Puppet), or custom actions. Actions are either python plugins, or any scripts, consumed into StackStorm by adding a few lines of metadata. Actions can be invoked directly by user via CLI or API, or used and called as part of automations - rules and workflows. - -* **Rules** map triggers to actions (or to workflows), applying matching criterias and mapping trigger payload to action inputs. - -* **Workflows** stitch actions together into “uber-actions”, defining the order, transition conditions, and passing the data. Most automations are more than one-step and thus need more than one action. Workflows, just like “atomic” actions, are available in action library, can be invoked manually or triggered by rules. - -* **Packs** are the units of content deployment. They simplify the management and sharing of StackStorm pluggable content by grouping integrations (triggers and actions) and automations (rules and workflows). A growing number of packs is available on StackStorm community. User can create their own packs, share them on Github, or submit to StackStorm community repo. - -* **Audit trail** of action executions, manual or automated, is recorded and stored with full details of triggering context and execution results. It is is also captured in audit logs for integrating with external logging and analytical tools: LogStash, Splunk, statsd, syslog. - - -StackStorm is a service with modular architecture. It comprises loosely coupled service components that communicate over the message bus, and scales horizontally to deliver automation at scale. StackStorm has a full REST API, CLI client for admins and users to operate it locally or remotely, and Python client bindings for developer’s convenience. Web UI is coming soon. - -StackStorm is new and under active development. We are opening it early to engage community, get feedback, and refine directions, and welcome contributions. - -## Documentation - -Additional documentation describing installation proceduces, action/rule/workflow authoring, and how to setup and use triggers/sensors can be found at [StackStorm Docs](http://docs.stackstorm.com). - -## Hacking / Contributing - -To set up dev environment and run StackStorm from sources, follow [these instructions](docs/source/install/sources.rst). - -For information on how to contribute, style guide, coding conventions and more, -please visit the [Development section](http://docs.stackstorm.com/development/index.html) -in our documentation. - -## Copyright, License, and Contributors Agreement - -Copyright 2015 StackStorm, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the [LICENSE](LICENSE) file, or at: - -[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -By contributing you agree that these contributions are your own (or approved by your employer) and you grant a full, complete, irrevocable copyright license to all users and developers of the project, present and future, pursuant to the license of the project. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000000..f5c8e885fc --- /dev/null +++ b/README.rst @@ -0,0 +1,157 @@ +|StackStorm| + +**StackStorm** is a platform for integration and automation across +services and tools, taking actions in response to events. Learn more at +`www.stackstorm.com`_. + +|Build Status| |IRC| + +StackStorm Overview +=================== + +About +----- + +StackStorm is a platform for integration and automation across services +and tools. It ties together your existing infrastructure and application +environment so you can more easily automate that environment – with a +particular focus on taking actions in response to events. + +StackStorm helps automate common operational patterns. Some examples +are: + +- **Facilitated Troubleshooting** - triggering on system failures + captured by Nagios, Sensu, New Relic and other monitoring, running a + series of diagnostic checks on physical nodes, OpenStack or Amazon + instances, and application components, and posting results to a + shared communication context, like HipChat or JIRA. +- **Automated remediation** - identifying and verifying hardware + failure on OpenStack compute node, properly evacuating instances and + emailing VM about potential downtime, but if anything goes wrong - + freezing the workflow and calling PagerDuty to wake up a human. +- **Continuous deployment** - build and test with Jenkins, provision a + new AWS cluster, turn on some traffic with the load balancer, and + roll-forth or roll-back based on NewRelic app performance data. + +StackStorm helps you compose these and other operational patterns as +rules and workflows or actions; and these rules and workflows - the +content within the StackStorm platform - are stored *as code* which +means they support the same approach to collaboration that you use today +for code development and can be shared with the broader open source +community via StackStorm.com/community for example. + +How it works +------------ + +.. figure:: https://cloud.githubusercontent.com/assets/20028/5688946/fabef9ec-9822-11e4-859e-29bbb67df85b.jpg + :alt: stackstorm component diagram + + stackstorm component diagram + +:: + + StackStorm architecture diagram + +StackStorm plugs into the environment via the extensible set of +adapters: sensors and actions. + +- **Sensors** are python plugins for inbound integration that watch for + events from external systems and fire a StackStorm trigger when event + happens. + +- **Triggers** are StackStorm representations of external events. There + are generic triggers (e.g. timers, webhooks) and integration triggers + (e.g. Sensu alert, JIRA issue updated). A new trigger type can be + defined by writing a sensor plugin. + +- **Actions** are StackStorm outbound integrations. There are generic + actions (ssh, REST call), integrations (OpenStack, Docker, Puppet), + or custom actions. Actions are either python plugins, or any scripts, + consumed into + +.. _www.stackstorm.com: http://www.stackstorm.com/product + +.. |StackStorm| image:: https://github.com/stackstorm/st2/raw/master/stackstorm_logo.png + :target: http://www.stackstorm.com +.. |Build Status| image:: https://api.travis-ci.org/StackStorm/st2.svg?branch=master + :target: https://travis-ci.org/StackStorm/st2 +.. |IRC| image:: https://img.shields.io/irc/%23stackstorm.png + :target: http://webchat.freenode.net/?channels=stackstorm|StackStorm| + +**StackStorm** is a platform for integration and automation across +services and tools, taking actions in response to events. Learn more at +`www.stackstorm.com`_. + +|Build Status| |IRC| + +StackStorm Overview +=================== + +About +----- + +StackStorm is a platform for integration and automation across services +and tools. It ties together your existing infrastructure and application +environment so you can more easily automate that environment – with a +particular focus on taking actions in response to events. + +StackStorm helps automate common operational patterns. Some examples +are: + +- **Facilitated Troubleshooting** - triggering on system failures + captured by Nagios, Sensu, New Relic and other monitoring, running a + series of diagnostic checks on physical nodes, OpenStack or Amazon + instances, and application components, and posting results to a + shared communication context, like HipChat or JIRA. +- **Automated remediation** - identifying and verifying hardware + failure on OpenStack compute node, properly evacuating instances and + emailing VM about potential downtime, but if anything goes wrong - + freezing the workflow and calling PagerDuty to wake up a human. +- **Continuous deployment** - build and test with Jenkins, provision a + new AWS cluster, turn on some traffic with the load balancer, and + roll-forth or roll-back based on NewRelic app performance data. + +StackStorm helps you compose these and other operational patterns as +rules and workflows or actions; and these rules and workflows - the +content within the StackStorm platform - are stored *as code* which +means they support the same approach to collaboration that you use today +for code development and can be shared with the broader open source +community via StackStorm.com/community for example. + +How it works +------------ + +.. figure:: https://cloud.githubusercontent.com/assets/20028/5688946/fabef9ec-9822-11e4-859e-29bbb67df85b.jpg + :alt: stackstorm component diagram + + stackstorm component diagram + +:: + + StackStorm architecture diagram + +StackStorm plugs into the environment via the extensible set of +adapters: sensors and actions. + +- **Sensors** are python plugins for inbound integration that watch for + events from external systems and fire a StackStorm trigger when event + happens. + +- **Triggers** are StackStorm representations of external events. There + are generic triggers (e.g. timers, webhooks) and integration triggers + (e.g. Sensu alert, JIRA issue updated). A new trigger type can be + defined by writing a sensor plugin. + +- **Actions** are StackStorm outbound integrations. There are generic + actions (ssh, REST call), integrations (OpenStack, Docker, Puppet), + or custom actions. Actions are either python plugins, or any scripts, + consumed into + +.. _www.stackstorm.com: http://www.stackstorm.com/product + +.. |StackStorm| image:: https://github.com/stackstorm/st2/raw/master/stackstorm_logo.png + :target: http://www.stackstorm.com +.. |Build Status| image:: https://api.travis-ci.org/StackStorm/st2.svg?branch=master + :target: https://travis-ci.org/StackStorm/st2 +.. |IRC| image:: https://img.shields.io/irc/%23stackstorm.png + :target: http://webchat.freenode.net/?channels=stackstorm From cbd3dde6f40b64d7253f19fd45fc67acfc2a64ed Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 18:21:07 +0800 Subject: [PATCH 20/51] Use __version__ attribute from package __init__.py file instead of using st2_version file. Note: For now we just copy over global __init__.py from st2common during build preparation step. --- Makefile | 7 ++++++- scripts/dist_utils.py | 12 ------------ st2actions/setup.py | 6 ++---- st2api/setup.py | 8 +++----- st2auth/setup.py | 6 ++---- st2client/setup.py | 6 ++---- st2common/setup.py | 6 ++---- st2debug/setup.py | 6 ++---- st2reactor/setup.py | 6 ++---- 9 files changed, 21 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 7adab24ebd..9301db0615 100644 --- a/Makefile +++ b/Makefile @@ -272,12 +272,17 @@ itests: requirements .itests done .PHONY: .sdist-requirements -sdist-requirements: +.sdist-requirements: # Copy over shared dist utils module which is needed by setup.py @for component in $(COMPONENTS); do\ cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ done + # Copy over __init__.py with a global shared __version__ attribute + @for component in $(COMPONENTS); do\ + cp -f ./st2common/st2common/__init__.py $$component/$$component; \ + done + # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory @for component in $(COMPONENTS); do\ test -s $$component/README.md || cp -f README.md $$component/; \ diff --git a/scripts/dist_utils.py b/scripts/dist_utils.py index 43f220815b..2d6fac0610 100644 --- a/scripts/dist_utils.py +++ b/scripts/dist_utils.py @@ -32,15 +32,3 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) - - -def parse_version(version_file_path): - """ - Parse a version string from the provided version file. - """ - # TODO: For backward compatibility we use a global version file but eventually we should - # support per component versioning - with open(version_file_path, 'r') as f: - version = f.read().strip() - - return version diff --git a/st2actions/setup.py b/st2actions/setup.py index 40b9942a21..30234a45a0 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2actions import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', diff --git a/st2api/setup.py b/st2api/setup.py index 8bdf5ffbc4..456c8c6c98 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -14,24 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os.path +import os from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2api import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', diff --git a/st2auth/setup.py b/st2auth/setup.py index 61cfa71831..641b55d619 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2auth import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', diff --git a/st2client/setup.py b/st2client/setup.py index e6bda6d9b4..698ca661ff 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2client import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', diff --git a/st2common/setup.py b/st2common/setup.py index c983363a66..a355aef16b 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2common import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', diff --git a/st2debug/setup.py b/st2debug/setup.py index 1ace3983f8..c5e4418fa6 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2debug import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), author='StackStorm', author_email='info@stackstorm.com', diff --git a/st2reactor/setup.py b/st2reactor/setup.py index ddbba06b8b..2c299194db 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -18,20 +18,18 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements -from dist_utils import parse_version +from st2reactor import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ST2_COMPONENT = os.path.basename(BASE_DIR) REQUIREMENTS_FILE = os.path.join(BASE_DIR, 'requirements.txt') -VERSION_FILE = os.path.join(BASE_DIR, '../st2_version.txt') install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) -st2_version = parse_version(VERSION_FILE) setup( name=ST2_COMPONENT, - version=st2_version, + version=__version__, description='{} component'.format(ST2_COMPONENT), long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', From fa511576d2fe9dfb4ae5e2b4f278550db8d874fe Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 18:33:46 +0800 Subject: [PATCH 21/51] Skip st2tests/ component for packaging. --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9301db0615..b061840db0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ COMPONENTS := $(wildcard st2*/) # Components that implement a component-controlled test-runner. These components provide an # in-component Makefile. (Temporary fix until I can generalize the pecan unittest setup. -mar) -COMPONENT_SPECIFIC_TESTS := st2tests +COMPONENT_SPECIFIC_TESTS := st2tests/ # nasty hack to get a space into a variable space_char := @@ -274,17 +274,17 @@ itests: requirements .itests .PHONY: .sdist-requirements .sdist-requirements: # Copy over shared dist utils module which is needed by setup.py - @for component in $(COMPONENTS); do\ - cp -f ./scripts/dist_utils.py $$component/dist_utils.py; \ + @for component in $(COMPONENTS_TEST); do\ + cp -f ./scripts/dist_utils.py $$component/dist_utils.py;\ done # Copy over __init__.py with a global shared __version__ attribute - @for component in $(COMPONENTS); do\ + @for component in $(COMPONENTS_TEST); do\ cp -f ./st2common/st2common/__init__.py $$component/$$component; \ done # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory - @for component in $(COMPONENTS); do\ + @for component in $(COMPONENTS_TEST); do\ test -s $$component/README.md || cp -f README.md $$component/; \ cp -f CHANGELOG.rst $$component/; \ cp -f CONTRIBUTING.rst $$component/; \ @@ -296,7 +296,7 @@ sdist: .sdist-requirements .sdist .PHONY: .sdist .sdist: - @for component in $(COMPONENTS); do\ + @for component in $(COMPONENTS_TEST); do\ python $$component/setup.py sdist;\ python $$component/setup.py bdist_wheel;\ done From f339c67c0ca72cfe4891834401707d51c988ad3e Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 18:46:47 +0800 Subject: [PATCH 22/51] Remove obsolete version file. --- st2_version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 st2_version diff --git a/st2_version b/st2_version deleted file mode 100644 index df39e58274..0000000000 --- a/st2_version +++ /dev/null @@ -1 +0,0 @@ -0.10.dev1 From e7efe46be5d68e2ba1aeba39275878249579b713 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:02:03 +0800 Subject: [PATCH 23/51] Use new README.rst file. --- st2actions/setup.py | 2 +- st2api/setup.py | 2 +- st2auth/setup.py | 2 +- st2client/setup.py | 2 +- st2common/setup.py | 2 +- st2debug/setup.py | 1 + st2reactor/setup.py | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/st2actions/setup.py b/st2actions/setup.py index 30234a45a0..b8f2f182f5 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2api/setup.py b/st2api/setup.py index 456c8c6c98..54d30beaaa 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2auth/setup.py b/st2auth/setup.py index 641b55d619..a45c5ba001 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2client/setup.py b/st2client/setup.py index 698ca661ff..e09616e849 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2common/setup.py b/st2common/setup.py index a355aef16b..76611d0b0d 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2debug/setup.py b/st2debug/setup.py index c5e4418fa6..0dc127a843 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -31,6 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2reactor/setup.py b/st2reactor/setup.py index 2c299194db..4fa8d37b83 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', From 6041861efb0372430f72bff7adac0c9c7df77efc Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:13:34 +0800 Subject: [PATCH 24/51] Replace dict comprehension with syntax which also works on 2.6. --- scripts/fixate-requirements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index fe605e1ea8..c0b643dbe5 100755 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -110,7 +110,7 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): # Sort the requirements to guarantee a stable order requirements = sorted(requirements) fixed = load_requirements(locate_file(fixed_requirements, must_exist=True)) - fixedreq_hash = {req.req.project_name: req for req in fixed if req.req} + fixedreq_hash = dict([(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") From 23dc8e32c3c5012deef9816debbbc50d29988dc6 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:14:32 +0800 Subject: [PATCH 25/51] README.md -> README.rst. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b061840db0..8718457c31 100644 --- a/Makefile +++ b/Makefile @@ -283,9 +283,9 @@ itests: requirements .itests cp -f ./st2common/st2common/__init__.py $$component/$$component; \ done - # Copy over README.md, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory + # Copy over README.rst, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory @for component in $(COMPONENTS_TEST); do\ - test -s $$component/README.md || cp -f README.md $$component/; \ + test -s $$component/README.rst || cp -f README.rst $$component/; \ cp -f CHANGELOG.rst $$component/; \ cp -f CONTRIBUTING.rst $$component/; \ cp -f LICENSE $$component/; \ From cfbdafc4d29d184b3ebf40b692277a259fda90da Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:19:09 +0800 Subject: [PATCH 26/51] Make sure we run fixate-requirements script in each component directory. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 8718457c31..f3f1db0e22 100644 --- a/Makefile +++ b/Makefile @@ -273,6 +273,11 @@ itests: requirements .itests .PHONY: .sdist-requirements .sdist-requirements: + # Run make requirements in each component directory + @for component in $(COMPONENTS_TEST); do\ + test -s $$component/Make || (pushd $$component && make -f Makefile requirements && popd);\ + done + # Copy over shared dist utils module which is needed by setup.py @for component in $(COMPONENTS_TEST); do\ cp -f ./scripts/dist_utils.py $$component/dist_utils.py;\ From 7fb6bec9dfe2751574637ab84d902641f5ab728c Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:27:35 +0800 Subject: [PATCH 27/51] Make sure we are using the latest version of pip on travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index bded13d317..e783a7041e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ env: cache: directories: - $HOME/.pip-cache/ +install: + - pip install --upgrade pip script: - ./scripts/travis.sh services: From 11175551b5629c3bd649ea3eb393ecf413636722 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 19:33:09 +0800 Subject: [PATCH 28/51] Update .gitignore. --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 22c49dc434..66dadce5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,8 @@ nosetests.xml .DS_Store ._* + +# Files which are copied over during sdist phase +st2*/LICENSE +st2*/CONTRIBUTING.rst +st2*/CHANGELOG.rst From 7f0875be0154cba57561f7c7811be173e08a8894 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 29 Jun 2015 22:39:36 +0800 Subject: [PATCH 29/51] Use python 2.6 compatible format syntax. --- scripts/fixate-requirements.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index c0b643dbe5..97080c3e36 100755 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -60,7 +60,7 @@ def parse_args(): def check_pip_version(): if StrictVersion(pip.__version__) < StrictVersion('6.0.0'): - print "Upgrade pip, your version `{}' "\ + print "Upgrade pip, your version `{0}' "\ "is outdated:\n".format(pip.__version__), GET_PIP sys.exit(1) @@ -73,7 +73,7 @@ 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)) + print("Error: couldn't locate file `{0}'".format(path)) return path @@ -97,7 +97,7 @@ def merge_source_requirements(sources): elif req.link: merged_requirements.append(req) else: - raise RuntimeError('Unexpected requirement {}'.format(req)) + raise RuntimeError('Unexpected requirement {0}'.format(req)) return merged_requirements @@ -128,7 +128,7 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): rline = str(req.req) f.write(rline + '\n') - print('Requirements written to: {}'.format(output_file)) + print('Requirements written to: {0}'.format(output_file)) if __name__ == '__main__': From 65c9123f636cd4c444a8cb300e45dc34062452be Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 00:12:46 +0800 Subject: [PATCH 30/51] Remove trailing slash. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f3f1db0e22..2614de9a04 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,11 @@ DOC_BUILD_DIR := docs/build BINARIES := bin # All components are prefixed by st2 -COMPONENTS := $(wildcard st2*/) +COMPONENTS := $(wildcard st2*) # Components that implement a component-controlled test-runner. These components provide an # in-component Makefile. (Temporary fix until I can generalize the pecan unittest setup. -mar) -COMPONENT_SPECIFIC_TESTS := st2tests/ +COMPONENT_SPECIFIC_TESTS := st2tests # nasty hack to get a space into a variable space_char := @@ -275,7 +275,7 @@ itests: requirements .itests .sdist-requirements: # Run make requirements in each component directory @for component in $(COMPONENTS_TEST); do\ - test -s $$component/Make || (pushd $$component && make -f Makefile requirements && popd);\ + test -s $$component/Makefile && (pushd $$component && make -f Makefile requirements && popd);\ done # Copy over shared dist utils module which is needed by setup.py From 8973084840a8f6f4163e4c0e3ce0137d2a9a54a4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 14:27:18 +0800 Subject: [PATCH 31/51] Sort the lines and not the requirements so the order is always the same. --- scripts/fixate-requirements.py | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/scripts/fixate-requirements.py b/scripts/fixate-requirements.py index 97080c3e36..354cf3cb86 100755 --- a/scripts/fixate-requirements.py +++ b/scripts/fixate-requirements.py @@ -107,26 +107,32 @@ def write_requirements(sources=None, fixed_requirements=None, output_file=None): Write resulting requirements taking versions from the fixed_requirements. """ requirements = merge_source_requirements(sources) - # Sort the requirements to guarantee a stable order - requirements = sorted(requirements) fixed = load_requirements(locate_file(fixed_requirements, must_exist=True)) fixedreq_hash = dict([(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") - links = set() - for req in requirements: - # we don't have any idea how to process links, so just add them - if req.link and req.link not in links: - links.add(req.link) - rline = str(req.link) - elif req.req: - project = req.req.project_name - if project in fixedreq_hash: - rline = str(fixedreq_hash[project].req) - else: - rline = str(req.req) - f.write(rline + '\n') + lines_to_write = [] + + links = set() + for req in requirements: + # we don't have any idea how to process links, so just add them + if req.link and req.link not in links: + links.add(req.link) + rline = str(req.link) + elif req.req: + project = req.req.project_name + if project in fixedreq_hash: + rline = str(fixedreq_hash[project].req) + else: + rline = str(req.req) + + lines_to_write.append(rline) + + # Sort the lines to guarantee a stable order + lines_to_write = sorted(lines_to_write) + data = '\n'.join(lines_to_write) + with open(output_file, 'w') as fp: + fp.write('# Don\'t edit this file. It\'s generated automatically!\n') + fp.write(data) print('Requirements written to: {0}'.format(output_file)) From dac1d7240792b189ee02dc462dfa07b55a53535a Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 14:38:48 +0800 Subject: [PATCH 32/51] Add missing gitpython requirement to st2action requirements. --- st2actions/in-requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/st2actions/in-requirements.txt b/st2actions/in-requirements.txt index 0f93ce1bbe..3b3335602b 100644 --- a/st2actions/in-requirements.txt +++ b/st2actions/in-requirements.txt @@ -9,3 +9,5 @@ oslo.config requests six pyyaml +# needed by core "packs" pack +gitpython From 1aa1ad84e52257d9ef4866fe1e1bcb9472d74fda Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 14:43:30 +0800 Subject: [PATCH 33/51] Make sure we are using latest version of pip inside our virtualenv. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 2614de9a04..8e2cb088cc 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,10 @@ requirements: virtualenv $(REQUIREMENTS) @echo @echo "==================== requirements ====================" @echo + + # Make sure we use latest version of pip + $(VIRTUALENV_DIR)/bin/pip install --upgrade pip + # Merge into one st2 components-wide requirements.txt file. python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt From 25a8ab2b7be77fbdf998d9f580e6cf9f031b596d Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:14:21 +0800 Subject: [PATCH 34/51] Add missing lockfile dependency. --- st2actions/in-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/st2actions/in-requirements.txt b/st2actions/in-requirements.txt index 3b3335602b..139799ce56 100644 --- a/st2actions/in-requirements.txt +++ b/st2actions/in-requirements.txt @@ -11,3 +11,4 @@ six pyyaml # needed by core "packs" pack gitpython +lockfile From ca732b747802c1f2859b1c4a2ab1ae603f50c219 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:20:53 +0800 Subject: [PATCH 35/51] Add missing requirements needed by linux pack. --- contrib/linux/requirements.txt | 2 +- st2actions/in-requirements.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/linux/requirements.txt b/contrib/linux/requirements.txt index 39a1267ec5..9148470ff4 100644 --- a/contrib/linux/requirements.txt +++ b/contrib/linux/requirements.txt @@ -1,5 +1,5 @@ # 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 diff --git a/st2actions/in-requirements.txt b/st2actions/in-requirements.txt index 139799ce56..f3799c0c60 100644 --- a/st2actions/in-requirements.txt +++ b/st2actions/in-requirements.txt @@ -12,3 +12,7 @@ pyyaml # needed by core "packs" pack gitpython lockfile +# needed by core "linux" pack - TODO: create virtualenv for linux pack on postinst +python-nmap +pyinotify +git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper From d2a5dd86ccf344eea1db62fab480102192f954ed Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:56:08 +0800 Subject: [PATCH 36/51] Add "fixate-requirements" global make target which generated requirements.txt file for all the components. --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 8e2cb088cc..51804a79c3 100644 --- a/Makefile +++ b/Makefile @@ -275,6 +275,18 @@ itests: requirements .itests . $(VIRTUALENV_DIR)/bin/activate; nosetests -sv $$component/tests/integration || exit 1; \ done +.PHONY: fixate-requirements +fixate-requirements: + # Fixate global requirements and requirements for each component + + # Merge into one st2 components-wide requirements.txt file. + python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt + + # Fixate requirements for each component + @for component in $(COMPONENTS_TEST); do\ + test -s $$component/Makefile && (pushd $$component && make -f Makefile requirements && popd);\ + done + .PHONY: .sdist-requirements .sdist-requirements: # Run make requirements in each component directory From c0abf833582df556d4743c0596f8394e29d6bd65 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:57:15 +0800 Subject: [PATCH 37/51] Add some docs on managing Python requirements. --- CONTRIBUTING.rst | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cfe9c946ea..77a3c3918e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -7,3 +7,44 @@ documentation, examples, ...). For more information on how to contribute and the guidelines you should follow, please visit the Development section of our documentation - http://docs.stackstorm.com/development/index.html + +Managing Python dependencies +---------------------------- + +.. note:: + + ``requirements.txt`` files are generated automatically using + ``scripts/fixate-requirements.py`` script and should't be editeed manually. + +To manage Python dependencies for each StackStorm component, we use the +following files: + +1. ``fixed-requirements.txt`` - A file which pins all the requirements to a + specific version. Keep in mind that this file is used by all the components. + This way we make sure different components always use the same version of a + particular dependency. +2. ``st2*/in-requirements.txt`` - Component specific requirements file. This + file contains a full list of the dependencies which are needed by this + particular component. +3. ``st2*/requirements.txt`` - Final component requirements file which is + generated by processing fixed-requirements.txt and in-requirements.txt file. + Note: This file is automatically generated and should not be edited + manually. +4. ``requirements.txt`` - Final requirements file for all the components which + is generated by processing fixed-requirements.txt and all the component + in-requirements.txt files. Note: This file is automatically generated and + should not be edited manually. + +Adding a new component dependency +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To add a new dependency for a particular component, you should perform the following steps: + +1. Add a name / link to the dependency to component ``in-requirements.txt`` + fire. For example ``st2actions/in-requirements.txt`` +2. Pin this requirement to a specific version in ``fixed-requirements.txt`` + file. +3. Generate final ``requirements.txt`` file for that component by running + ``make requirements`` target in the component directory. For example: + ``cd st2actions ; make requirements``. +4. Add a commit generated requirements.txt file. From 65d5669f3b02e72bc8d36c62f6019d4675819bcd Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:57:52 +0800 Subject: [PATCH 38/51] Update .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 66dadce5b7..2d26bae8c7 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ nosetests.xml st2*/LICENSE st2*/CONTRIBUTING.rst st2*/CHANGELOG.rst +st2*/dist_utils.py From 35bb74e4b5d23d17b6047947f49db0ce78714b41 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 15:59:22 +0800 Subject: [PATCH 39/51] Add generated requirements files. --- requirements.txt | 36 +++++++++++++++--------------------- st2actions/requirements.txt | 17 +++++++++++++++++ st2api/requirements.txt | 8 ++++++++ st2auth/requirements.txt | 7 +++++++ st2client/requirements.txt | 7 +++++++ st2common/requirements.txt | 16 ++++++++++++++++ st2debug/requirements.txt | 5 +++++ st2reactor/requirements.txt | 9 +++++++++ 8 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 st2actions/requirements.txt create mode 100644 st2api/requirements.txt create mode 100644 st2auth/requirements.txt create mode 100644 st2client/requirements.txt create mode 100644 st2common/requirements.txt create mode 100644 st2debug/requirements.txt create mode 100644 st2reactor/requirements.txt diff --git a/requirements.txt b/requirements.txt index 93d3070ca4..9091aa55e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,34 +1,28 @@ -# 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). +# Don't edit this file. It's generated automatically! apscheduler>=3.0.0rc1 eventlet>=0.13.0 -flask -flask-jsonschema +git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric +git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0#egg=python-mistralclient gitpython==0.3.2.1 jinja2 +jsonpath-rw>=1.3.0 jsonschema>=2.3.0 kombu -mongoengine>=0.8.7,<0.9 -oslo.config>=1.12.1,<1.13 +lockfile<0.11,>=0.10.2 +mongoengine<0.9,>=0.8.7 +oslo.config paramiko +passlib<1.7,>=1.6.2 pecan==0.7.0 +prettytable +pyinotify<=0.10,>=0.9.5 pymongo<3.0 python-dateutil -python-json-logger +python-gnupg<0.4,>=0.3.7 +python-nmap<0.4,>=0.3.4 pyyaml requests -six==1.9.0 -tooz -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 -jsonpath-rw>=1.3.0 -# Requirements for linux pack -# used by file watcher sensor -pyinotify>=0.9.5,<=0.10 -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 +six==1.9.0 +tooz \ No newline at end of file diff --git a/st2actions/requirements.txt b/st2actions/requirements.txt new file mode 100644 index 0000000000..73b605a1ee --- /dev/null +++ b/st2actions/requirements.txt @@ -0,0 +1,17 @@ +# Don't edit this file. It's generated automatically! +apscheduler>=3.0.0rc1 +eventlet>=0.13.0 +git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric +git+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0#egg=python-mistralclient +gitpython==0.3.2.1 +jinja2 +kombu +lockfile<0.11,>=0.10.2 +oslo.config +pyinotify<=0.10,>=0.9.5 +python-dateutil +python-nmap<0.4,>=0.3.4 +pyyaml +requests +six==1.9.0 \ No newline at end of file diff --git a/st2api/requirements.txt b/st2api/requirements.txt new file mode 100644 index 0000000000..f653af7922 --- /dev/null +++ b/st2api/requirements.txt @@ -0,0 +1,8 @@ +# Don't edit this file. It's generated automatically! +eventlet>=0.13.0 +jsonschema>=2.3.0 +kombu +mongoengine<0.9,>=0.8.7 +oslo.config +pecan==0.7.0 +six==1.9.0 \ No newline at end of file diff --git a/st2auth/requirements.txt b/st2auth/requirements.txt new file mode 100644 index 0000000000..4e41b2a2be --- /dev/null +++ b/st2auth/requirements.txt @@ -0,0 +1,7 @@ +# Don't edit this file. It's generated automatically! +eventlet>=0.13.0 +oslo.config +passlib<1.7,>=1.6.2 +pecan==0.7.0 +pymongo<3.0 +six==1.9.0 \ No newline at end of file diff --git a/st2client/requirements.txt b/st2client/requirements.txt new file mode 100644 index 0000000000..08bf6b8f80 --- /dev/null +++ b/st2client/requirements.txt @@ -0,0 +1,7 @@ +# Don't edit this file. It's generated automatically! +jsonpath-rw>=1.3.0 +prettytable +python-dateutil +pyyaml +requests +six==1.9.0 \ No newline at end of file diff --git a/st2common/requirements.txt b/st2common/requirements.txt new file mode 100644 index 0000000000..f2e7414408 --- /dev/null +++ b/st2common/requirements.txt @@ -0,0 +1,16 @@ +# Don't edit this file. It's generated automatically! +eventlet>=0.13.0 +git+https://github.com/StackStorm/fabric.git@stanley-patched#egg=fabric +jinja2 +jsonschema>=2.3.0 +kombu +mongoengine<0.9,>=0.8.7 +oslo.config +paramiko +pecan==0.7.0 +python-dateutil +pyyaml +requests +semver>=2.1.2 +six==1.9.0 +tooz \ No newline at end of file diff --git a/st2debug/requirements.txt b/st2debug/requirements.txt new file mode 100644 index 0000000000..129d98f915 --- /dev/null +++ b/st2debug/requirements.txt @@ -0,0 +1,5 @@ +# Don't edit this file. It's generated automatically! +python-gnupg<0.4,>=0.3.7 +pyyaml +requests +six==1.9.0 \ No newline at end of file diff --git a/st2reactor/requirements.txt b/st2reactor/requirements.txt new file mode 100644 index 0000000000..1654575884 --- /dev/null +++ b/st2reactor/requirements.txt @@ -0,0 +1,9 @@ +# Don't edit this file. It's generated automatically! +apscheduler>=3.0.0rc1 +eventlet>=0.13.0 +jsonpath-rw>=1.3.0 +jsonschema>=2.3.0 +kombu +oslo.config +python-dateutil +six==1.9.0 \ No newline at end of file From 421b5d661abbc3ba082e07cb3be32b0ce341ac59 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 16:42:52 +0800 Subject: [PATCH 40/51] Use python from virtualenv when running requirements make target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 51804a79c3..9376a8752c 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ requirements: virtualenv $(REQUIREMENTS) $(VIRTUALENV_DIR)/bin/pip install --upgrade pip # Merge into one st2 components-wide requirements.txt file. - python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt + $(VIRTUALENV_DIR)/bin/python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt for req in $(REQUIREMENTS); do \ echo "Installing $$req..." ; \ From 2d9d3115d9011ed3f1c68ebd81e5f2091f5dec9f Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 16:46:15 +0800 Subject: [PATCH 41/51] Directly use pip binary from vev instead of activating it first. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9376a8752c..8ce751260b 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,7 @@ requirements: virtualenv $(REQUIREMENTS) for req in $(REQUIREMENTS); do \ echo "Installing $$req..." ; \ - . $(VIRTUALENV_DIR)/bin/activate && pip install $(PIP_OPTIONS) $$req ; \ + $(VIRTUALENV_DIR)/bin/pip install $(PIP_OPTIONS) $$req ; \ done .PHONY: virtualenv From f865c35b0270dec6d9a8c8034206b178220ddcee Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 16:58:08 +0800 Subject: [PATCH 42/51] Update .gitignore, include dist_utils.py module and __init__.py file in each component directory. --- .gitignore | 1 - st2actions/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2actions/st2actions/__init__.py | 16 ++++++++++++++ st2api/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2api/st2api/__init__.py | 16 ++++++++++++++ st2auth/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2auth/st2auth/__init__.py | 16 ++++++++++++++ st2client/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2client/st2client/__init__.py | 2 +- st2common/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2debug/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2debug/st2debug/__init__.py | 16 ++++++++++++++ st2exporter/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2exporter/st2exporter/__init__.py | 16 ++++++++++++++ st2reactor/dist_utils.py | 34 +++++++++++++++++++++++++++++ st2reactor/st2reactor/__init__.py | 16 ++++++++++++++ 16 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 st2actions/dist_utils.py create mode 100644 st2api/dist_utils.py create mode 100644 st2auth/dist_utils.py create mode 100644 st2client/dist_utils.py create mode 100644 st2common/dist_utils.py create mode 100644 st2debug/dist_utils.py create mode 100644 st2exporter/dist_utils.py create mode 100644 st2reactor/dist_utils.py diff --git a/.gitignore b/.gitignore index 2d26bae8c7..66dadce5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,3 @@ nosetests.xml st2*/LICENSE st2*/CONTRIBUTING.rst st2*/CHANGELOG.rst -st2*/dist_utils.py diff --git a/st2actions/dist_utils.py b/st2actions/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2actions/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2actions/st2actions/__init__.py b/st2actions/st2actions/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2actions/st2actions/__init__.py +++ b/st2actions/st2actions/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' diff --git a/st2api/dist_utils.py b/st2api/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2api/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2api/st2api/__init__.py b/st2api/st2api/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2api/st2api/__init__.py +++ b/st2api/st2api/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' diff --git a/st2auth/dist_utils.py b/st2auth/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2auth/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2auth/st2auth/__init__.py b/st2auth/st2auth/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2auth/st2auth/__init__.py +++ b/st2auth/st2auth/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' diff --git a/st2client/dist_utils.py b/st2client/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2client/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2client/st2client/__init__.py b/st2client/st2client/__init__.py index 984e78b98b..2e4eb16b54 100644 --- a/st2client/st2client/__init__.py +++ b/st2client/st2client/__init__.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = '0.10dev' +__version__ = '0.12dev' diff --git a/st2common/dist_utils.py b/st2common/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2common/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2debug/dist_utils.py b/st2debug/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2debug/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2debug/st2debug/__init__.py b/st2debug/st2debug/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2debug/st2debug/__init__.py +++ b/st2debug/st2debug/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' diff --git a/st2exporter/dist_utils.py b/st2exporter/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2exporter/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2exporter/st2exporter/__init__.py b/st2exporter/st2exporter/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2exporter/st2exporter/__init__.py +++ b/st2exporter/st2exporter/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' diff --git a/st2reactor/dist_utils.py b/st2reactor/dist_utils.py new file mode 100644 index 0000000000..2d6fac0610 --- /dev/null +++ b/st2reactor/dist_utils.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# 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. + +from pip.req import parse_requirements + +__all__ = [ + 'fetch_requirements' +] + + +def fetch_requirements(requirements_file_path): + """ + Return a list of requirements and links by parsing the provided requirements file. + """ + links = [] + reqs = [] + for req in parse_requirements(requirements_file_path, session=False): + if req.link: + links.append(str(req.link)) + reqs.append(str(req.req)) + return (reqs, links) diff --git a/st2reactor/st2reactor/__init__.py b/st2reactor/st2reactor/__init__.py index e69de29bb2..2e4eb16b54 100644 --- a/st2reactor/st2reactor/__init__.py +++ b/st2reactor/st2reactor/__init__.py @@ -0,0 +1,16 @@ +# 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. + +__version__ = '0.12dev' From f7dfa84d1fc35932487a2da377e57b37a2a4ae14 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 17:49:52 +0800 Subject: [PATCH 43/51] Update "make debs" and "make rpms" to use virtualenv - this way we always use correct and latest version of pip. Also update virtualenv target to install latest version of pip instead of doing it in the requirements target. --- Makefile | 27 +++++++++++++++------------ st2client/Makefile | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 8ce751260b..782c1a6132 100644 --- a/Makefile +++ b/Makefile @@ -171,9 +171,6 @@ requirements: virtualenv $(REQUIREMENTS) @echo @echo "==================== requirements ====================" @echo - - # Make sure we use latest version of pip - $(VIRTUALENV_DIR)/bin/pip install --upgrade pip # Merge into one st2 components-wide requirements.txt file. $(VIRTUALENV_DIR)/bin/python ./scripts/fixate-requirements.py -s st2*/in-requirements.txt -f fixed-requirements.txt @@ -212,6 +209,12 @@ $(VIRTUALENV_DIR)/bin/activate: echo ' functions -e old_deactivate' >> $(VIRTUALENV_DIR)/bin/activate.fish echo 'end' >> $(VIRTUALENV_DIR)/bin/activate.fish touch $(VIRTUALENV_DIR)/bin/activate.fish + + # Make sure we use latest version of pip + $(VIRTUALENV_DIR)/bin/pip install --upgrade pip + + # Install stdeb st2client build dependency + $(VIRTUALENV_DIR)/bin/pip install stdeb .PHONY: tests tests: pytests @@ -334,27 +337,27 @@ mistral-itests: requirements .mistral-itests . $(VIRTUALENV_DIR)/bin/activate; nosetests -s -v st2tests/integration || exit 1; .PHONY: rpms -rpms: +rpms: virtualenv @echo @echo "==================== rpm ====================" @echo rm -Rf ~/rpmbuild - $(foreach COM,$(COMPONENTS), pushd $(COM); make rpm; popd;) - pushd st2client && make rpm && popd + $(foreach COM,$(COMPONENTS), pushd $(COM); . ../$(VIRTUALENV_DIR)/bin/activate && make rpm; popd;) + pushd st2client && . ../$(VIRTUALENV_DIR)/bin/activate && make rpm && popd -rhel-rpms: +rhel-rpms: virtualenv @echo @echo "==================== rpm ====================" @echo rm -Rf ~/rpmbuild - $(foreach COM,$(COMPONENTS), pushd $(COM); make rhel-rpm; popd;) - pushd st2client && make rhel-rpm && popd + $(foreach COM,$(COMPONENTS), pushd $(COM); . ../$(VIRTUALENV_DIR)/bin/activate && make rhel-rpm; popd;) + pushd st2client && . ../$(VIRTUALENV_DIR)/bin/activate && make rhel-rpm && popd .PHONY: debs -debs: +debs: virtualenv @echo @echo "==================== deb ====================" @echo rm -Rf ~/debbuild - $(foreach COM,$(COMPONENTS), pushd $(COM); make deb; popd;) - pushd st2client && make deb && popd + $(foreach COM,$(COMPONENTS), pushd $(COM); . ../$(VIRTUALENV_DIR)/bin/activate && make deb; popd;) + pushd st2client && . ../$(VIRTUALENV_DIR)/bin/activate && make deb && popd diff --git a/st2client/Makefile b/st2client/Makefile index f05583d14d..9d9dc614cf 100644 --- a/st2client/Makefile +++ b/st2client/Makefile @@ -8,7 +8,7 @@ RELEASE=1 COMPONENTS := st2client .PHONY: rpm -rpm: +rpm: python setup.py bdist_rpm mkdir -p $(RPM_ROOT)/RPMS/noarch cp dist/$(COMPONENTS)*noarch.rpm $(RPM_ROOT)/RPMS/noarch/$(COMPONENTS)-$(VER)-$(RELEASE).noarch.rpm From c5c37cbb415c01f670a09ad9befe7186523ff34d Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 18:37:35 +0800 Subject: [PATCH 44/51] Add stub README.rst file to every component directory. Update setup.py so it doesn't include changelog in the package description. --- Makefile | 3 +-- st2actions/README.md | 5 ----- st2actions/README.rst | 8 ++++++++ st2actions/setup.py | 2 +- st2api/README.md | 5 ----- st2api/README.rst | 4 ++++ st2api/setup.py | 2 +- st2auth/README.rst | 4 ++++ st2auth/setup.py | 2 +- st2client/setup.py | 2 +- st2common/README.rst | 4 ++++ st2common/setup.py | 2 +- st2debug/README.rst | 5 +++++ st2debug/setup.py | 2 +- st2exporter/{README.md => README.rst} | 3 ++- st2reactor/README.rst | 7 +++++++ st2reactor/setup.py | 2 +- 17 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 st2actions/README.md create mode 100644 st2actions/README.rst delete mode 100644 st2api/README.md create mode 100644 st2api/README.rst create mode 100644 st2auth/README.rst create mode 100644 st2common/README.rst create mode 100644 st2debug/README.rst rename st2exporter/{README.md => README.rst} (66%) create mode 100644 st2reactor/README.rst diff --git a/Makefile b/Makefile index 782c1a6132..af1557765d 100644 --- a/Makefile +++ b/Makefile @@ -307,10 +307,9 @@ fixate-requirements: cp -f ./st2common/st2common/__init__.py $$component/$$component; \ done - # Copy over README.rst, CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory + # Copy over CHANGELOG.RST, CONTRIBUTING.RST and LICENSE file to each component directory @for component in $(COMPONENTS_TEST); do\ test -s $$component/README.rst || cp -f README.rst $$component/; \ - cp -f CHANGELOG.rst $$component/; \ cp -f CONTRIBUTING.rst $$component/; \ cp -f LICENSE $$component/; \ done diff --git a/st2actions/README.md b/st2actions/README.md deleted file mode 100644 index e7113501c8..0000000000 --- a/st2actions/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Action Runner -============= - -See: https://stackstorm.atlassian.net/wiki/display/STORM/Demo+-+ActionRunner - https://stackstorm.atlassian.net/wiki/display/STORM/API+Design diff --git a/st2actions/README.rst b/st2actions/README.rst new file mode 100644 index 0000000000..fdd48ad9f6 --- /dev/null +++ b/st2actions/README.rst @@ -0,0 +1,8 @@ +Action Runner +============= + +StackStorm component including the following services: + +* Action Runner +* Notifier +* Results Tracker diff --git a/st2actions/setup.py b/st2actions/setup.py index b8f2f182f5..8ef0687a77 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2api/README.md b/st2api/README.md deleted file mode 100644 index b57fc36b95..0000000000 --- a/st2api/README.md +++ /dev/null @@ -1,5 +0,0 @@ -st2 API -======= - -See: https://stackstorm.atlassian.net/wiki/display/STORM/Demo+-+ActionRunner - https://stackstorm.atlassian.net/wiki/display/STORM/API+Design diff --git a/st2api/README.rst b/st2api/README.rst new file mode 100644 index 0000000000..92a2b5bb09 --- /dev/null +++ b/st2api/README.rst @@ -0,0 +1,4 @@ +API service +=========== + +StackStorm API service. diff --git a/st2api/setup.py b/st2api/setup.py index 54d30beaaa..67449f6c39 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2auth/README.rst b/st2auth/README.rst new file mode 100644 index 0000000000..cdcdcb9990 --- /dev/null +++ b/st2auth/README.rst @@ -0,0 +1,4 @@ +Auth API service +================ + +StackStorm Auth API service. diff --git a/st2auth/setup.py b/st2auth/setup.py index a45c5ba001..98344970d4 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2client/setup.py b/st2client/setup.py index e09616e849..bff6fb1ec0 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2common/README.rst b/st2common/README.rst new file mode 100644 index 0000000000..8f31adc112 --- /dev/null +++ b/st2common/README.rst @@ -0,0 +1,4 @@ +StackStorm Common Package +========================= + +StackStorm package containing common code used by other components. diff --git a/st2common/setup.py b/st2common/setup.py index 76611d0b0d..2f83dd6e1c 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2debug/README.rst b/st2debug/README.rst new file mode 100644 index 0000000000..fe907392f9 --- /dev/null +++ b/st2debug/README.rst @@ -0,0 +1,5 @@ +StackStorm Debug Utility +======================== + +StackStorm utility for sending debug information to StackStorm for helping with +troubleshooting. diff --git a/st2debug/setup.py b/st2debug/setup.py index 0dc127a843..eea6528159 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', diff --git a/st2exporter/README.md b/st2exporter/README.rst similarity index 66% rename from st2exporter/README.md rename to st2exporter/README.rst index 190d05140b..ab46994707 100644 --- a/st2exporter/README.md +++ b/st2exporter/README.rst @@ -1,3 +1,4 @@ -## St2 exporter +StackStorm exporter +=================== Listens to execution updates from RabbitMQ and creates JSON files out of them. diff --git a/st2reactor/README.rst b/st2reactor/README.rst new file mode 100644 index 0000000000..6fbc2c36a6 --- /dev/null +++ b/st2reactor/README.rst @@ -0,0 +1,7 @@ +StackStorm Reactor +================== + +StackStorm component including the following services: + +* Rules Engine +* Sensor Container diff --git a/st2reactor/setup.py b/st2reactor/setup.py index 4fa8d37b83..313815c227 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -31,7 +31,7 @@ name=ST2_COMPONENT, version=__version__, description='{} component'.format(ST2_COMPONENT), - long_description=open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read(), + long_description=open('README.rst').read(), author='StackStorm', author_email='info@stackstorm.com', license='Apache License (2.0)', From d692f5d4fef55209aa3f491b1e337f889a150f82 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 19:10:11 +0800 Subject: [PATCH 45/51] Add classifier back to st2client setup.py. --- st2client/setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/st2client/setup.py b/st2client/setup.py index bff6fb1ec0..dc5dae2333 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -42,6 +42,16 @@ zip_safe=False, include_package_data=True, packages=find_packages(exclude=['setuptools', 'tests']), + 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' + ], entry_points={ 'console_scripts': [ 'st2 = st2client.shell:main' From 5c862ca54f98197b15d17273a43b0651518e70b4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 20:12:22 +0800 Subject: [PATCH 46/51] Explicitly include readme, changelog and license file in every manifest. --- st2actions/MANIFEST.in | 3 +++ st2api/MANIFEST.in | 3 +++ st2auth/MANIFEST.in | 3 +++ st2client/MANIFEST.in | 2 ++ st2common/MANIFEST.in | 3 +++ st2debug/MANIFEST.in | 3 +++ st2reactor/MANIFEST.in | 3 +++ 7 files changed, 20 insertions(+) diff --git a/st2actions/MANIFEST.in b/st2actions/MANIFEST.in index 28556e968b..db914df889 100644 --- a/st2actions/MANIFEST.in +++ b/st2actions/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2actions *.* * +include README.rst +include CHANGELOG.rst +include LICENSE diff --git a/st2api/MANIFEST.in b/st2api/MANIFEST.in index 27c6005d1c..79f2f57fd0 100644 --- a/st2api/MANIFEST.in +++ b/st2api/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2api *.* * +include README.rst +include CHANGELOG.rst +include LICENSE diff --git a/st2auth/MANIFEST.in b/st2auth/MANIFEST.in index 440a6b8741..52642c0f47 100644 --- a/st2auth/MANIFEST.in +++ b/st2auth/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2auth *.* * +include README.rst +include CHANGELOG.rst +include LICENSE diff --git a/st2client/MANIFEST.in b/st2client/MANIFEST.in index 84aa989c43..11a4310f66 100644 --- a/st2client/MANIFEST.in +++ b/st2client/MANIFEST.in @@ -2,4 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2client *.* * +include README.rst +include CHANGELOG.rst include LICENSE diff --git a/st2common/MANIFEST.in b/st2common/MANIFEST.in index 1bad7eda3c..7d5b50acff 100644 --- a/st2common/MANIFEST.in +++ b/st2common/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2common *.* * +include README.rst +include CHANGELOG.rst +include LICENSE diff --git a/st2debug/MANIFEST.in b/st2debug/MANIFEST.in index 4460d8dcc6..45b3683592 100644 --- a/st2debug/MANIFEST.in +++ b/st2debug/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2debug *.* * +include README.rst +include CHANGELOG.rst +include LICENSE diff --git a/st2reactor/MANIFEST.in b/st2reactor/MANIFEST.in index 9baa625501..db8049a581 100644 --- a/st2reactor/MANIFEST.in +++ b/st2reactor/MANIFEST.in @@ -2,3 +2,6 @@ # Include all files under the source tree by default. # Another behaviour can be used in the future though. recursive-include st2reactor *.* * +include README.rst +include CHANGELOG.rst +include LICENSE From 02c2fa5fe93581fdfe7bff719d14bd71402d8ced Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 20:25:04 +0800 Subject: [PATCH 47/51] Update all the manifest files to exclude *.pyc files and to include requirements.txt. --- st2actions/MANIFEST.in | 5 ++--- st2api/MANIFEST.in | 5 ++--- st2auth/MANIFEST.in | 5 ++--- st2client/MANIFEST.in | 5 ++--- st2common/MANIFEST.in | 5 ++--- st2debug/MANIFEST.in | 5 ++--- st2reactor/MANIFEST.in | 5 ++--- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/st2actions/MANIFEST.in b/st2actions/MANIFEST.in index db914df889..d8eda368c0 100644 --- a/st2actions/MANIFEST.in +++ b/st2actions/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2api/MANIFEST.in b/st2api/MANIFEST.in index 79f2f57fd0..e5e97f9f30 100644 --- a/st2api/MANIFEST.in +++ b/st2api/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2auth/MANIFEST.in b/st2auth/MANIFEST.in index 52642c0f47..5d55897685 100644 --- a/st2auth/MANIFEST.in +++ b/st2auth/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2client/MANIFEST.in b/st2client/MANIFEST.in index 11a4310f66..bfb3879765 100644 --- a/st2client/MANIFEST.in +++ b/st2client/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2common/MANIFEST.in b/st2common/MANIFEST.in index 7d5b50acff..54b223b3ac 100644 --- a/st2common/MANIFEST.in +++ b/st2common/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 st2common *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2debug/MANIFEST.in b/st2debug/MANIFEST.in index 45b3683592..88bce57b15 100644 --- a/st2debug/MANIFEST.in +++ b/st2debug/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc diff --git a/st2reactor/MANIFEST.in b/st2reactor/MANIFEST.in index db8049a581..cf2d6cd46b 100644 --- a/st2reactor/MANIFEST.in +++ b/st2reactor/MANIFEST.in @@ -1,7 +1,6 @@ -# 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 *.* * +include requirements.txt include README.rst include CHANGELOG.rst include LICENSE +global-exclude *.pyc From faf502df4d7ec835d44c88e7ba2db8ea64dae07f Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 30 Jun 2015 20:36:31 +0800 Subject: [PATCH 48/51] Update all setup.py modules to apply vagrant workaround so "make deb" target also works locally in a vagrant vm. --- scripts/dist_utils.py | 17 ++++++++++++++++- st2actions/dist_utils.py | 17 ++++++++++++++++- st2actions/setup.py | 2 ++ st2api/dist_utils.py | 17 ++++++++++++++++- st2api/setup.py | 2 ++ st2auth/dist_utils.py | 17 ++++++++++++++++- st2auth/setup.py | 2 ++ st2client/dist_utils.py | 17 ++++++++++++++++- st2client/setup.py | 2 ++ st2common/dist_utils.py | 17 ++++++++++++++++- st2common/setup.py | 2 ++ st2debug/dist_utils.py | 17 ++++++++++++++++- st2debug/setup.py | 2 ++ st2exporter/dist_utils.py | 17 ++++++++++++++++- st2reactor/dist_utils.py | 17 ++++++++++++++++- st2reactor/setup.py | 2 ++ 16 files changed, 158 insertions(+), 9 deletions(-) diff --git a/scripts/dist_utils.py b/scripts/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/scripts/dist_utils.py +++ b/scripts/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2actions/dist_utils.py b/st2actions/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2actions/dist_utils.py +++ b/st2actions/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2actions/setup.py b/st2actions/setup.py index 8ef0687a77..1c76d21587 100644 --- a/st2actions/setup.py +++ b/st2actions/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2actions import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2api/dist_utils.py b/st2api/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2api/dist_utils.py +++ b/st2api/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2api/setup.py b/st2api/setup.py index 67449f6c39..da59145ed0 100644 --- a/st2api/setup.py +++ b/st2api/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2api import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2auth/dist_utils.py b/st2auth/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2auth/dist_utils.py +++ b/st2auth/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2auth/setup.py b/st2auth/setup.py index 98344970d4..af68007420 100644 --- a/st2auth/setup.py +++ b/st2auth/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2auth import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2client/dist_utils.py b/st2client/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2client/dist_utils.py +++ b/st2client/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2client/setup.py b/st2client/setup.py index dc5dae2333..926a7ccca7 100644 --- a/st2client/setup.py +++ b/st2client/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2client import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2common/dist_utils.py b/st2common/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2common/dist_utils.py +++ b/st2common/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2common/setup.py b/st2common/setup.py index 2f83dd6e1c..5fb88baf7f 100644 --- a/st2common/setup.py +++ b/st2common/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2common import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2debug/dist_utils.py b/st2debug/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2debug/dist_utils.py +++ b/st2debug/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2debug/setup.py b/st2debug/setup.py index eea6528159..039879cea6 100644 --- a/st2debug/setup.py +++ b/st2debug/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2debug import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, diff --git a/st2exporter/dist_utils.py b/st2exporter/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2exporter/dist_utils.py +++ b/st2exporter/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2reactor/dist_utils.py b/st2reactor/dist_utils.py index 2d6fac0610..db7457d52f 100644 --- a/st2reactor/dist_utils.py +++ b/st2reactor/dist_utils.py @@ -14,10 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + from pip.req import parse_requirements __all__ = [ - 'fetch_requirements' + 'fetch_requirements', + 'apply_vagrant_workaround' ] @@ -32,3 +35,15 @@ def fetch_requirements(requirements_file_path): links.append(str(req.link)) reqs.append(str(req.req)) return (reqs, links) + + +def apply_vagrant_workaround(): + """ + Function which detects if the script is being executed inside vagrant and if it is, it deletes + "os.link" attribute. + + Note: Without this workaround, setup.py sdist will fail when running inside a shared directory + (nfs / virtualbox shared folders). + """ + if os.environ.get('USER', None) == 'vagrant': + del os.link diff --git a/st2reactor/setup.py b/st2reactor/setup.py index 313815c227..bf9be4b19a 100644 --- a/st2reactor/setup.py +++ b/st2reactor/setup.py @@ -18,6 +18,7 @@ from setuptools import setup, find_packages from dist_utils import fetch_requirements +from dist_utils import apply_vagrant_workaround from st2reactor import __version__ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -27,6 +28,7 @@ install_reqs, dep_links = fetch_requirements(REQUIREMENTS_FILE) +apply_vagrant_workaround() setup( name=ST2_COMPONENT, version=__version__, From 91635aaade794049b2e37a2d8d188aa986f3fcb6 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 1 Jul 2015 14:41:52 +0800 Subject: [PATCH 49/51] Update st2client makefile to correctly purhge the tar.gz dist file. --- st2client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2client/Makefile b/st2client/Makefile index 9d9dc614cf..666c0b1975 100644 --- a/st2client/Makefile +++ b/st2client/Makefile @@ -30,7 +30,7 @@ deb: python setup.py --command-packages=stdeb.command bdist_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 + rm -Rf dist deb_dist $(COMPONENTS)-*.tar.gz $(COMPONENTS).egg-info ChangeLog AUTHORS build .PHONY: requirements requirements: From 2570bbbe32df131a4b03ba546738e93b8efafdf4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 1 Jul 2015 14:45:18 +0800 Subject: [PATCH 50/51] Update st2common Makefile to correctly clean up after creating a package. --- st2common/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/st2common/Makefile b/st2common/Makefile index 2705503528..2979d3aa43 100644 --- a/st2common/Makefile +++ b/st2common/Makefile @@ -32,6 +32,7 @@ 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/ + rm -rf st2/ logrotate.d/ .PHONY: requirements requirements: From 4d2785f01c1fb34f76eb64683d889c02c1f21e82 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 1 Jul 2015 14:48:23 +0800 Subject: [PATCH 51/51] Fix st2common debian install file, contrib/tests doesn't exist anymore. --- contrib/README.md | 1 - st2common/packaging/debian/install | 1 - 2 files changed, 2 deletions(-) diff --git a/contrib/README.md b/contrib/README.md index 13b8f55937..a00d2250b9 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -9,7 +9,6 @@ Contrib 2. St2 samples that may be of interest to the users. These samples will be shipped with the product but will not be auto-registered. * `st2/contrib/examples` - * `st2/contrib/tests` * `st2/contrib/hello-st2` See [`st2/st2common/packaging`](../st2common/packaging) to figure where and how it is all installed. diff --git a/st2common/packaging/debian/install b/st2common/packaging/debian/install index cdcf7eff30..95a5e5a93a 100644 --- a/st2common/packaging/debian/install +++ b/st2common/packaging/debian/install @@ -2,7 +2,6 @@ contrib/core opt/stackstorm/packs/ contrib/packs opt/stackstorm/packs/ contrib/linux opt/stackstorm/packs/ contrib/examples usr/share/doc/st2/ -contrib/tests usr/share/stackstorm/ docs usr/share/doc/st2/ st2common usr/lib/python2.7/dist-packages/ bin usr/lib/python2.7/dist-packages/st2common/