From a845f71305f9ee12837b620430be7db3a5108612 Mon Sep 17 00:00:00 2001 From: Elliott Murray Date: Thu, 21 May 2020 12:19:16 +0100 Subject: [PATCH 1/2] Removed 2.x support --- .travis.yml | 5 ++--- README.md | 2 ++ docker/py27.Dockerfile | 24 ------------------------ pact/__version__.py | 2 +- requirements_dev.txt | 1 - setup.py | 4 ---- tox.ini | 5 ++--- 7 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 docker/py27.Dockerfile diff --git a/.travis.yml b/.travis.yml index c85563fd0..f62fb3d7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: - ruby python: - - "2.7" - "3.4" - "3.5" - "3.6" @@ -20,7 +19,7 @@ script: - flake8 - pydocstyle pact - tox - - if [[ $TRAVIS_PYTHON_VERSION == "3.6" ]]; then make package && pip install ./dist/pact-python-*.tar.gz && make e2e; fi + - if [[ $TRAVIS_PYTHON_VERSION == "3.4" ]]; then make package && pip install ./dist/pact-python-*.tar.gz && make e2e; fi before_deploy: - export RELEASE_PACKAGE=$(ls dist/pact-python-*.tar.gz) @@ -33,6 +32,6 @@ deploy: secure: W8osmmZ2F+XACUrh0gLedBhvN9zjo9FrUKgQQ/bdgeol+Qo9gyn0cu9RJd/jzlOyHHL4GyBxkgPen6J3KKTJE1J8loZF/u0rgl7H8mSq3SAv4zRk2aFBypfqJrUhiTPHcXyn2L3xWC0PfS5F+ANTDuGAIcxS9sUZEu2Snw8H1avTgFhXbEiR+xfg8Qwh9qOVO2TY9YDkTFkpST/wqFLKxstx8z9ek/wSxcAaF6EO55v6oQmtK8vn+AX7VlvwYgbGrTK/D4bdwZpc/YXEnG/zviSBnZKzOpOyg2vIi/yejFsMQVeAlG84xFsax61KrvmZfaNN+NF175hFLBCKNjUMVNaY80bRX9n4inHIBqRYWBsdurlogdfPsDEOBGfPMf2Sy0vWoRFFzRAQk4m6V/g67YdgVjN4Fi+u8CuqD59EoISH8BdwGnFsz22C3KldIZjz2eleMTsvTkq1hX1Y3hlRfIiETpl8YEL9sDMY5nVcnNTCT2ysyHOdEUigzSubzqB5O5WIkBSyDXdkjBW7BiaIAc7jvb3wrnce+M19Y2Aour4C6KEhp05u3ePSGjOBsJtI8U3/kLjrv5wZA40IIarPUDqvKK9tS+LfpEoCqPCEypTJ069lOQRBGsLy+573qsJhcYwwaYx66FcQ7CXVYR2sTQ7m8w5PXBZj60UhOvd1URU= on: repo: pact-foundation/pact-python - python: "2.7" + python: "3.4" tags: true skip_cleanup: true diff --git a/README.md b/README.md index c4fb16e44..2be36af60 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Currently supports version 2 of the [Pact specification]. For more information about what Pact is, and how it can help you test your code more efficiently, check out the [Pact documentation]. +Note: As of Version 1.0 deprecates support for python 2.7 to allow us to incorporate python 3.x features more readily. If you want to still use Python 2.7 use the 0.x.y versions. Only bug fixes will now be added to that release. + # How to use pact-python ## Installation diff --git a/docker/py27.Dockerfile b/docker/py27.Dockerfile deleted file mode 100644 index 6b6acbb70..000000000 --- a/docker/py27.Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:2.7.17-alpine3.11 - -WORKDIR /home - -COPY requirements_dev.txt . - -RUN apk update -RUN apk upgrade - -RUN apk add gcc py-pip python-dev libffi-dev openssl-dev gcc libc-dev bash make - -RUN python -m pip install psutil subprocess32 -RUN pip install -r requirements_dev.txt -RUN apk --no-cache add ca-certificates wget && \ - wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-bin-2.25-r0.apk && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-i18n-2.25-r0.apk && \ - apk add glibc-bin-2.25-r0.apk glibc-i18n-2.25-r0.apk glibc-2.25-r0.apk - - -RUN ln -sf /usr/glibc-compat/bin/locale /usr/local/bin/locale - -CMD tox -e py27 diff --git a/pact/__version__.py b/pact/__version__.py index 7c90f2742..63a4d3d59 100644 --- a/pact/__version__.py +++ b/pact/__version__.py @@ -1,3 +1,3 @@ """Pact version info.""" -__version__ = '0.22.0' +__version__ = '1.0.0' diff --git a/requirements_dev.txt b/requirements_dev.txt index aa0690946..3d5b62a8d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -3,7 +3,6 @@ Flask==1.0 configparser==3.5.0 codecov==2.0.5 coverage==4.3.4 -enum34==1.1.6 flake8==3.2.1 mccabe==0.5.2 mock==2.0.0 diff --git a/setup.py b/setup.py index 2826d7bd9..e2407980d 100644 --- a/setup.py +++ b/setup.py @@ -115,10 +115,6 @@ def read(filename): 'six>=1.9.0', ] -if sys.version_info.major == 2: - dependencies.append('subprocess32') - dependencies.append('enum34') - if __name__ == '__main__': setup( cmdclass={ diff --git a/tox.ini b/tox.ini index 601856d48..85f8e8fb7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] -envlist=py{27,34,35,36,37,38}-{test,install} +envlist=py{34,35,36,37,38}-{test,install} [testenv] deps= test: -rrequirements_dev.txt - py27-test: subprocess32 -commands= +ommands= test: nosetests install: python -c "import pact" From 8bc6d48bac3c5484db8e1b9090ba7f964e727349 Mon Sep 17 00:00:00 2001 From: Elliott Murray Date: Thu, 21 May 2020 12:32:27 +0100 Subject: [PATCH 2/2] Release script to make life a bit easier --- CHANGELOG.md | 1 + pact/__version__.py | 2 +- release_prep.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 release_prep.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e96b458..b76867444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ + ### 0.22.0 * d112a4a - Merge pull request #134 from elliottmurray/multiple-custom-provider-header (Elliott Murray, Mon May 11 16:32:49 2020 +0100) * 58f8e6b - Fix some style issues (Elliott Murray, Wed Apr 29 12:35:00 2020 +0100) diff --git a/pact/__version__.py b/pact/__version__.py index 63a4d3d59..7c90f2742 100644 --- a/pact/__version__.py +++ b/pact/__version__.py @@ -1,3 +1,3 @@ """Pact version info.""" -__version__ = '1.0.0' +__version__ = '0.22.0' diff --git a/release_prep.sh b/release_prep.sh new file mode 100755 index 000000000..a4ea2c48a --- /dev/null +++ b/release_prep.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +VERSION=$1 + +if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]*$ ]]; then + echo "Updating version $VERSION." +else + echo "Invalid version number $VERSION" + exit 1; +fi + +TAG_NAME="v$VERSION" + +echo "Releasing $TAG_NAME" + +echo -e "`git log --pretty=format:' * %h - %s (%an, %ad)' $TAG_NAME..HEAD`\n$(cat CHANGELOG.md)" > CHANGELOG.md + +echo "Appended Changelog to $VERSION" + +git add CHANGELOG.md pact/__version__.py +git commit -m "Releasing version $VERSION" + +git tag -a "$TAG_NAME" -m "Releasing version $VERSION" + +# && git push origin master --tags` + +