Skip to content

Commit

Permalink
Merge pull request #4209 from StackStorm/setup_reqs
Browse files Browse the repository at this point in the history
Make st2client setup.py requirements consistent
  • Loading branch information
Kami authored Jul 9, 2018
2 parents 3eb9ad7 + 8dda4a6 commit f279ea1
Show file tree
Hide file tree
Showing 28 changed files with 256 additions and 154 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Added
* Add new ``?tags``, query param filter to the ``/v1/actions`` API endpoint. This query parameter
allows users to filter out actions based on the tag name . By default, when no filter values are
provided, all actions are returned. (new feature) #4219

Changed
~~~~~~~

* Update ``st2client/setup.py`` file to dynamically load requirements from
``st2client/requirements.txt`` file. The code works with pip >= 6.0.0, although using pip 9.0.0
or higher is strongly recommended. (improvement) #4209

2.8.0 - July 10, 2018
---------------------
Expand Down
7 changes: 7 additions & 0 deletions contrib/examples/triggers/sample-trigger.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
name: sample_trigger
description: Sample trigger
payload_schema:
type: "object"
properties:
executed_at:
type: "string"
format: "date-time"
default: "2014-07-30 05:04:24.578325"
16 changes: 10 additions & 6 deletions contrib/runners/action_chain_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/announcement_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/cloudslang_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/http_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/inquirer_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/local_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/mistral_v2/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/noop_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/orchestra_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/python_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
16 changes: 10 additions & 6 deletions contrib/runners/remote_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Loading

0 comments on commit f279ea1

Please sign in to comment.