Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 2.7 tests #10

Merged
merged 4 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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