From 8fbd841d17a029232577d71587c02aa429874287 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 28 Feb 2020 17:36:22 -0600 Subject: [PATCH 1/9] Update to bionic for Travis. Correct comment about IPv6 workaround. --- .travis.yml | 4 ++-- skeleton.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17e45a67..923377f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic language: python python: @@ -11,7 +11,7 @@ install: - pip install tox tox-venv before_script: - # Disable IPv6. Ref travis-ci/travis-ci#8361 + # Enable IPv6. Ref travis-ci/travis-ci#8361 - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi diff --git a/skeleton.md b/skeleton.md index 340b65cf..4544158f 100644 --- a/skeleton.md +++ b/skeleton.md @@ -120,7 +120,7 @@ Features include: Features include: - test against Python 3 -- run on Ubuntu Xenial +- run on Ubuntu Bionic - correct for broken IPv6 ### AppVeyor From b4dd44cc7c8da44bcc8f2674d2a5d764091f63c6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 15 Mar 2020 15:05:37 -0400 Subject: [PATCH 2/9] Suppress warnings in pytest-flake8, pytest-black, and pytest-checkdocs. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 7b9b714f..60d9bf76 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,3 +3,5 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 --black --cov doctest_optionflags=ALLOW_UNICODE ELLIPSIS filterwarnings= + # https://github.com/pytest-dev/pytest/issues/6928 + ignore:direct construction of .*Item has been deprecated:DeprecationWarning From 2c2fee097e1898a8c00b4434f74063302aeb96e9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 27 Mar 2020 09:22:01 -0400 Subject: [PATCH 3/9] Prefer pytest-black to pytest-black-multipy --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index c20fa103..3f887a64 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ testing = pytest >= 3.5, !=3.7.3 pytest-checkdocs >= 1.2.3 pytest-flake8 - pytest-black-multipy + pytest-black >= 0.3.7 pytest-cov # local From 045e6ad88af135f85365248812cbe5ddb3faf355 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 Apr 2020 14:51:43 -0400 Subject: [PATCH 4/9] Test against Windows and Mac --- azure-pipelines.yml | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..25e638b5 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,80 @@ +# Create the project in Azure with: +# az devops project create --name $name --organization https://dev.azure.com/$org/ --visibility public +# then configure the pipelines (through web UI) + +trigger: + branches: + include: + - '*' + tags: + include: + - '*' + +pool: + vmImage: $(pool_vm_image) + +variables: +- group: Azure secrets + +stages: +- stage: Test + jobs: + + - job: 'Test' + strategy: + matrix: + Bionic Python 3.6: + python.version: '3.6' + pool_vm_image: Ubuntu-18.04 + Bionic Python 3.8: + python.version: '3.8' + pool_vm_image: Ubuntu-18.04 + Windows: + python.version: '3.8' + pool_vm_image: vs2017-win2016 + MacOS: + python.version: '3.8' + pool_vm_image: macos-10.15 + + maxParallel: 4 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -- --junit-xml=test-results.xml + displayName: 'run tests' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test-results.xml' + testRunTitle: 'Python $(python.version)' + condition: succeededOrFailed() + +- stage: Publish + dependsOn: Test + jobs: + - job: 'Publish' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.8' + architecture: 'x64' + + - script: python -m pip install tox + displayName: 'Install tox' + + - script: | + tox -e release + env: + TWINE_PASSWORD: $(PyPI-token) + displayName: 'publish to PyPI' + + condition: contains(variables['Build.SourceBranch'], 'tags') From bb96dc3fcd738e3202423a0ed09ea9f5dd4ce50b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 25 Apr 2020 09:54:59 -0400 Subject: [PATCH 5/9] Define a default pool_vm_image --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 25e638b5..fd432962 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,6 +15,8 @@ pool: variables: - group: Azure secrets +- name: pool_vm_image + value: Ubuntu-18.04 stages: - stage: Test @@ -25,10 +27,8 @@ stages: matrix: Bionic Python 3.6: python.version: '3.6' - pool_vm_image: Ubuntu-18.04 Bionic Python 3.8: python.version: '3.8' - pool_vm_image: Ubuntu-18.04 Windows: python.version: '3.8' pool_vm_image: vs2017-win2016 From f66d87899937361bea35f437ba293774f0375ca2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 27 Apr 2020 18:49:51 -0400 Subject: [PATCH 6/9] Remove tox-venv and tox-pip-version. Tox-venv is discouraged (https://github.com/tox-dev/tox-venv/issues/48#issuecomment-620227405) and tox-pip-version was only there to support tox-venv. venv is dead; long live virtualenv. --- tox.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tox.ini b/tox.ini index fb98930e..ba5857a3 100644 --- a/tox.ini +++ b/tox.ini @@ -3,15 +3,10 @@ envlist = python minversion = 3.2 # https://github.com/jaraco/skeleton/issues/6 tox_pip_extensions_ext_venv_update = true -# Ensure that a late version of pip is used even on tox-venv. -requires = - tox-pip-version>=0.0.6 - tox-venv [testenv] deps = -pip_version = pip commands = pytest {posargs} usedevelop = True From 0df8947fc97f0f0fab6e680d20d8affe5838aec3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 May 2020 23:15:53 -0400 Subject: [PATCH 7/9] Remove more references to tox-venv --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 923377f6..37fa499d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ python: cache: pip install: -- pip install tox tox-venv +- pip install tox before_script: # Enable IPv6. Ref travis-ci/travis-ci#8361 diff --git a/appveyor.yml b/appveyor.yml index 6a1c99a9..c6f46e4f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,7 +18,7 @@ cache: - '%LOCALAPPDATA%\pip\Cache' test_script: - - "python -m pip install -U tox tox-venv virtualenv" + - "python -m pip install -U tox virtualenv" - "tox" version: '{build}' From 649bc7934a13b78eb1283cad9919b9f26c5426e9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 2 May 2020 07:25:43 -0400 Subject: [PATCH 8/9] Add workaround for warning emitted when junitxml is used. Ref pytest-dev/pytest#6178. --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 60d9bf76..62c0f365 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,6 +2,8 @@ norecursedirs=dist build .tox .eggs addopts=--doctest-modules --flake8 --black --cov doctest_optionflags=ALLOW_UNICODE ELLIPSIS +# workaround for warning pytest-dev/pytest#6178 +junit_family=xunit2 filterwarnings= # https://github.com/pytest-dev/pytest/issues/6928 ignore:direct construction of .*Item has been deprecated:DeprecationWarning From 7455f2f25310b2d778a648e45d32033ccc790946 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 May 2020 15:31:25 -0400 Subject: [PATCH 9/9] Include mypy for type checking during tests. --- mypy.ini | 2 ++ pytest.ini | 2 +- setup.cfg | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000..976ba029 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +ignore_missing_imports = True diff --git a/pytest.ini b/pytest.ini index 62c0f365..381b3271 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] norecursedirs=dist build .tox .eggs -addopts=--doctest-modules --flake8 --black --cov +addopts=--doctest-modules --flake8 --black --cov --mypy doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 diff --git a/setup.cfg b/setup.cfg index 3f887a64..e2dcebb1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,7 @@ testing = pytest-flake8 pytest-black >= 0.3.7 pytest-cov + pytest-mypy # local