Skip to content

Commit

Permalink
Merge pull request #10 from StackStorm-Exchange/fix-python2.7-tests
Browse files Browse the repository at this point in the history
Fix Python 2.7 tests
  • Loading branch information
nmaludy authored Jul 23, 2020
2 parents 6ddfccd + 6d3b628 commit 097c531
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v0.1.6

- Pinned parsedatetime to <2.6 to fix tests on Python 2.7
- Updated requirements file handling and Makefile

## v0.1.5

- Fixed issue with wait-for module where newest version only supports python 3
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ list:
fi;
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort | uniq | xargs

virtualenv: venv
virtualenv venv || python3 -m venv venv

.PHONY: pip-tools
pip-tools:
. venv/bin/activate; pip install pip-tools

.PHONY: requirements
requirements: pip-tools
. venv/bin/activate; pip-compile requirements.in > requirements.txt

.PHONY: requirements-tests
requirements-tests: pip-tools
. venv/bin/activate; pip-compile requirements-tests.in > requirements-tests.txt

# forward all make targets not found in this makefile to the ci makefile to do
# the actual work (by calling the invoke-ci-makefile target)
# http://stackoverflow.org/wiki/Last-Resort_Makefile_Targets
Expand Down
2 changes: 1 addition & 1 deletion pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- cloudforms
- provision
- bestfit
version: 0.1.5
version: "0.1.6"
python_versions:
- "2"
- "3"
Expand Down
3 changes: 3 additions & 0 deletions requirements-tests.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mock>=1.3.0,<2.0
unittest2>=1.1.0,<2.0
nose>=1.3.7
19 changes: 15 additions & 4 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
mock>=1.3.0,<2.0
unittest2>=1.1.0,<2.0
nose>=1.3.7

#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements-tests.in
#
argparse==1.4.0 # via unittest2
funcsigs==1.0.2 # via mock
linecache2==1.0.0 # via traceback2
mock==1.3.0 # via -r requirements-tests.in
nose==1.3.7 # via -r requirements-tests.in
pbr==5.4.5 # via mock
six==1.15.0 # via mock, unittest2
traceback2==1.4.0 # via unittest2
unittest2==1.1.0 # via -r requirements-tests.in
21 changes: 21 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
manageiq-client>=0.3.0

# Pin parsedatetime to < 2.6 avoid this issue on Python 2.7:
#
# https://github.com/bear/parsedatetime/issues/245
# https://github.com/bear/parsedatetime/issues/246
# https://github.com/bear/parsedatetime/issues/251
#
# Waiting on #247 for a proper fix:
#
# https://github.com/bear/parsedatetime/pull/247 - proper fix
# https://github.com/bear/parsedatetime/pull/248 - bad fix
#
parsedatetime<2.6

# Can also use environment markers to install different versions for Python 2
# and Python 3:
#parsedatetime<2.6; python_version < "3"
#parsedatetime; python_version >= "3"

wait-for<1.1 # Version 1.1 dropped Python 2.7 support
19 changes: 17 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
manageiq-client>=0.3.0
wait-for==1.0.14
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements.in
#
certifi==2020.6.20 # via requests
chardet==3.0.4 # via requests
idna==2.10 # via requests
iso8601==0.1.12 # via manageiq-client
manageiq-client==0.6.1 # via -r requirements.in
parsedatetime==2.5 # via -r requirements.in, wait-for
requests==2.24.0 # via manageiq-client
simplejson==3.17.2 # via manageiq-client
six==1.15.0 # via manageiq-client, wait-for
urllib3==1.25.10 # via requests
wait-for==1.0.14 # via -r requirements.in, manageiq-client

0 comments on commit 097c531

Please sign in to comment.