From 40a36c3c8ee493ea6d29917f4d5520c530eaf377 Mon Sep 17 00:00:00 2001 From: joncrall Date: Thu, 28 Jan 2021 14:13:07 -0500 Subject: [PATCH 1/9] Start branch for 0.15.4 --- CHANGELOG.md | 9 ++++++--- appveyor.yml | 4 ++++ xdoctest/__init__.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf633cb3..8e52216a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,10 @@ We are currently working on porting this changelog to the specifications in This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Version 0.15.3 - Unreleased +## Version 0.15.4 - Unreleased + + +## Version 0.15.3 - Released 2021-01-28 ### Fixed * Color issues on win32 @@ -15,13 +18,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm * Moved to CircleCI deploy scripts -## Version 0.15.2 - Unreleased +## Version 0.15.2 - Released 2021-01-28 ### Fixed * Bug where references to doctest variables were never released -## Version 0.15.1 - Unreleased +## Version 0.15.1 - Released 2021-01-28 ### Added * Documentation improvements diff --git a/appveyor.yml b/appveyor.yml index 19674897..4cf09d31 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,7 @@ +# Notes: Rolling Builds AKA Autocancel redundant builds +# https://www.appveyor.com/docs/build-configuration/#rolling-builds +# https://ci.appveyor.com/project/Erotemic/xdoctest/settings + image: - Visual Studio 2015 diff --git a/xdoctest/__init__.py b/xdoctest/__init__.py index f7f484ff..d329e3ab 100644 --- a/xdoctest/__init__.py +++ b/xdoctest/__init__.py @@ -282,7 +282,7 @@ def fib(n): mkinit xdoctest --nomods ''' -__version__ = '0.15.3' +__version__ = '0.15.4' # Expose only select submodules From 7c17953892e8a683674de259d7eedde54d99faab Mon Sep 17 00:00:00 2001 From: CircleCI Date: Thu, 28 Jan 2021 14:45:38 -0500 Subject: [PATCH 2/9] Fixes for circleci config --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b02c1783..323304e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -400,15 +400,15 @@ jobs: URL_HOST=$(git remote get-url origin | sed -e 's|https\?://.*@||g' | sed -e 's|https\?://||g') echo "URL_HOST = $URL_HOST" # A git config user name and email is required. Set if needed. - if [[ "$(git config user.email)" == "" ]; then + if [[ "$(git config user.email)" == "" ]]; then git config user.email "ci@circleci.com" git config user.name "CircleCI" fi if [ $(git tag -l "$VERSION") ]; then + echo "Tag already exists" + else git tag $VERSION -m "tarball tag $VERSION" git push --tags "https://${GIT_PUSH_TOKEN}@${URL_HOST}" - else - echo "Tag already exists" fi From 15c674cc358745dd2a816f474462017b754c554a Mon Sep 17 00:00:00 2001 From: CircleCI Date: Thu, 28 Jan 2021 14:56:27 -0500 Subject: [PATCH 3/9] wip --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 323304e7..61e198bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ __doc__: &__doc__ Instructions: Browse to: - https://app.circleci.com/settings/project/github/GITHUB_USER/PYPKG/environment-variables + https://app.circleci.com/settings/project/github/Erotemic/xdoctest/environment-variables Do whatever you need to locally access the values of these variables @@ -260,6 +260,7 @@ jobs: - image: circleci/python steps: - checkout + working_directory: ~/{{ .Environment.CIRCLE_JOB }} .test_minimal_template: &test_minimal_template <<: From 31ebeeab687c6946e29e1e330bfde15c2cf8148a Mon Sep 17 00:00:00 2001 From: CircleCI Date: Thu, 28 Jan 2021 15:09:48 -0500 Subject: [PATCH 4/9] Add 3.10 rc --- .circleci/config.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61e198bc..1e0f4f86 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -211,6 +211,7 @@ workflows: version: 2 test: jobs: + - test_full/cp310-310-linux - test_full/cp39-39-linux - test_full/cp38-38-linux - test_full/cp37-37m-linux @@ -219,6 +220,7 @@ workflows: - test_full/cp34-34m-linux - test_full/cp27-27mu-linux + - test_minimal/cp310-310-linux - test_minimal/cp39-39-linux - test_minimal/cp38-38-linux - test_minimal/cp37-37m-linux @@ -260,7 +262,7 @@ jobs: - image: circleci/python steps: - checkout - working_directory: ~/{{ .Environment.CIRCLE_JOB }} + #working_directory: ~/{{ .Environment.CIRCLE_JOB }} .test_minimal_template: &test_minimal_template <<: @@ -422,6 +424,11 @@ jobs: # # All we need to do is change the base docker image so python is the # version we want we can reuse everything else from the template + # + test_full/cp310-310-linux: + <<: *test_full_template + docker: + - image: circleci/python:3.10-rc test_full/cp39-39-linux: <<: *test_full_template @@ -459,9 +466,13 @@ jobs: - image: circleci/python:2.7 # ------------ + test_minimal/cp310-310-linux: + <<: *test_minimal_template + docker: + - image: circleci/python:3.10-rc test_minimal/cp39-39-linux: - <<: *test_full_template + <<: *test_minimal_template docker: - image: circleci/python:3.9 From 8523575d2f82c7d9d2dcff142940829723677d4f Mon Sep 17 00:00:00 2001 From: CircleCI Date: Thu, 28 Jan 2021 18:55:45 -0500 Subject: [PATCH 5/9] wip --- xdoctest/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdoctest/__init__.py b/xdoctest/__init__.py index d329e3ab..5530b844 100644 --- a/xdoctest/__init__.py +++ b/xdoctest/__init__.py @@ -45,7 +45,7 @@ Getting Started 0: Installation -------------------------------- -First ensure that you have :doc:`Python installed <../installing_python>` and +First ensure that you have :doc:`Python installed <../../installing_python>` and ideally are in a virtual environment. Install xdoctest using the pip. .. code:: bash From cff0c80dbe3698a508b1e3b8f037a6de31db8690 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Fri, 29 Jan 2021 09:55:05 -0500 Subject: [PATCH 6/9] Fix 3_10 tags, add ipynb to manifest --- MANIFEST.in | 1 + setup.py | 14 +++- testing/_grave.py | 176 ---------------------------------------------- 3 files changed, 12 insertions(+), 179 deletions(-) delete mode 100644 testing/_grave.py diff --git a/MANIFEST.in b/MANIFEST.in index 7f224bc6..98fb751b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,3 +11,4 @@ recursive-include docs *.txt recursive-include docs Makefile recursive-include requirements *.txt recursive-include testing *.py +recursive-include testing *.ipynb diff --git a/setup.py b/setup.py index bf045948..f1be6fee 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +""" +TODO: + look into pbr for versioning? +""" from setuptools import setup import sys from os.path import exists @@ -150,7 +154,11 @@ def native_mb_python_tag(plat_impl=None, version_info=None): version_info = sys.version_info major, minor = version_info[0:2] - ver = '{}{}'.format(major, minor) + major, minor = version_info[0:2] + if minor > 9: + ver = '{}_{}'.format(major, minor) + else: + ver = '{}{}'.format(major, minor) if plat_impl == 'CPython': # TODO: get if cp27m or cp27mu @@ -162,8 +170,8 @@ def native_mb_python_tag(plat_impl=None, version_info=None): else: abi = 'm' else: - if ver == '38': - # no abi in 38? + if sys.version_info[:2] >= (3, 8): + # bpo-36707: 3.8 dropped the m flag abi = '' else: abi = 'm' diff --git a/testing/_grave.py b/testing/_grave.py deleted file mode 100644 index ebaa5fd5..00000000 --- a/testing/_grave.py +++ /dev/null @@ -1,176 +0,0 @@ - - -def demodata(): - from xdoctest import utils, parser - string = ''' - text - >>> dsrc() - want - - >>> dsrc() - >>> cont( - ... a=b) - ... dsrc - >>> dsrc(): - ... a - ... b = """ - multiline - """ - want - - text - ... still text - >>> "now its a doctest" - - text - ''' - string = utils.codeblock(string) - self = parser.DoctestParser() - self._label_docsrc_lines(string) - - self.parse(string) - - string = utils.codeblock( - ''' - .. doctest:: - - >>> print( - ... "Hi\\n\\nByé") - Hi - ... - Byé - >>> 1/0 # Byé - 1 - ''') - import doctest - self2 = parser.DoctestParser() - self1 = doctest.DocTestParser() - self2._label_docsrc_lines(string) - - string = utils.codeblock( - """ - .. doctest:: - - >>> ''' - multiline strings are now kosher - ''' - multiline strings are now kosher - """) - - string = utils.codeblock( - """ - .. doctest:: - - >>> x = y - ... foo = bar - """) - - string = utils.codeblock( - ''' - text-line-1 - text-line-2 - text-line-3 - text-line-4 - text-line-5 - text-line-6 - text-line-7 - text-line-8 - text-line-9 - text-line-10 - text-line-11 - >>> 1 + 1 - 3 - - text-line-after - ''') - - string = utils.codeblock( - """ - >>> ''' - multiline strings are now kosher - '''.strip() - 'multiline strings are now kosher' - - >>> ''' - double multiline string - '''.strip() - ... - >>> ''' - double multiline string - '''.strip() - 'double multiline string' - """) - - import doctest - import ubelt as ub - self1 = doctest.DocTestParser() - self2 = parser.DoctestParser() - self2._label_docsrc_lines(string) - print('\n==== PARSER2 ====') - for x, o in enumerate(self2.parse(string)): - print('----') - print(x) - if not isinstance(o, str): - print(ub.repr2(o.__dict__, sv=True)) - # print('o.source = {!r}'.format(o.source)) - # print('o.want = {!r}'.format(o.want)) - else: - print('o = {!r}'.format(o)) - print('\n==== PARSER1 ====') - for x, o in enumerate(self1.parse(string)): - print('----') - print(x) - if not isinstance(o, str): - print(ub.repr2(o.__dict__)) - # print('o.source = {!r}'.format(o.source)) - # print('o.want = {!r}'.format(o.want)) - else: - print('o = {!r}'.format(o)) - - string = utils.codeblock( - """ - .. doctest:: - - >>> ''' - multiline strings are now kosher - ''' - multiline strings are now kosher - """) - - string = utils.codeblock( - ''' - >>> import os - >>> os.environ["HELLO"] - 'WORLD' - ''') - self = parser.DoctestParser() - self._label_docsrc_lines(string) - ex = self.parse(string)[0] - - parts = self2.parse(string) - print('parts = {!r}'.format(parts)) - for o in parts: - if not isinstance(o, str): - e = o - print('e.source = {!r}'.format(e.source)) - print('e.want = {!r}'.format(e.want)) - - source = utils.codeblock( - ''' - a = b; b = c - def foo(): - pass - pass - try: - a = b - except Exception as ex: - pass - else: - pass - class X: - def foo(): - pass - ''') - import ast - pt = ast.parse(source) - ps1_linenos = sorted({node.lineno for node in pt.body}) From a1adfbff86df960516b6ab93d0cd02c65b72fd96 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Fri, 29 Jan 2021 10:02:26 -0500 Subject: [PATCH 7/9] Attempt to use codecov in circleci --- .circleci/config.yml | 14 ++++++++------ CHANGELOG.md | 3 +++ run_tests.py | 12 ++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e0f4f86..ed1f5765 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -292,12 +292,13 @@ jobs: name: run tests command: | . venv/bin/activate - # pip install pytest-cov==2.8.1 # hack to avoid regression - #python run_tests.py - python -m pytest --cov=xdoctest --cov-config .coveragerc --cov-report term -s + python run_tests.py - store_artifacts: path: test-reports destination: test-reports + - store_artifacts: + path: .coverage + destination: .coverage .test_full_template: &test_full_template @@ -328,12 +329,13 @@ jobs: name: run tests command: | . venv/bin/activate - # pip install pytest-cov==2.8.1 # hack to avoid regression - #python run_tests.py - python -m pytest --cov=xdoctest --cov-config .coveragerc --cov-report term -s + python run_tests.py - store_artifacts: path: test-reports destination: test-reports + - store_artifacts: + path: .coverage + destination: .coverage .gpgsign_template: &gpgsign_template <<: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e52216a..b538bea0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## Version 0.15.4 - Unreleased +### Fixed +* Minor issues with release tarballs. + ## Version 0.15.3 - Released 2021-01-28 diff --git a/run_tests.py b/run_tests.py index e941c8ef..041256d3 100755 --- a/run_tests.py +++ b/run_tests.py @@ -1,14 +1,18 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- if __name__ == '__main__': import pytest import sys - # NOTE: it is important to return the correct error code - sys.exit(pytest.main([ + package_name = 'xdoctest' + pytest_args = [ '-p', 'pytester', '-p', 'no:doctest', - '--cov=xdoctest', '--cov-config', '.coveragerc', '--cov-report', 'html', '--cov-report', 'term', '--xdoctest', - ] + sys.argv[1:])) + '--cov=' + package_name, + package_name, 'testing' + ] + pytest_args = pytest_args + sys.argv[1:] + sys.exit(pytest.main(pytest_args)) From 3a9e835a82aeb9bfcda0819496c38c0f67d473c6 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Fri, 29 Jan 2021 10:07:25 -0500 Subject: [PATCH 8/9] Add codecov command --- .circleci/config.yml | 4 ++++ tox.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed1f5765..273f7cd0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -293,6 +293,8 @@ jobs: command: | . venv/bin/activate python run_tests.py + # Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration) + codecov - store_artifacts: path: test-reports destination: test-reports @@ -330,6 +332,8 @@ jobs: command: | . venv/bin/activate python run_tests.py + # Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration) + codecov - store_artifacts: path: test-reports destination: test-reports diff --git a/tox.ini b/tox.ini index b55c970f..01375276 100644 --- a/tox.ini +++ b/tox.ini @@ -12,4 +12,4 @@ commands = # isort --check-only --diff --recursive --skip .tox --skip migrations # flake8 deps = - -rrequirements.txt + -r requirements.txt From 2a089d83f16526f82f98f35bbb3d7b687ecee735 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Fri, 29 Jan 2021 10:38:19 -0500 Subject: [PATCH 9/9] allow coverage drop --- .circleci/config.yml | 6 +++--- .codecov.yml | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 273f7cd0..27c209a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -292,7 +292,7 @@ jobs: name: run tests command: | . venv/bin/activate - python run_tests.py + $PYTHON_EXE run_tests.py # Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration) codecov - store_artifacts: @@ -331,7 +331,7 @@ jobs: name: run tests command: | . venv/bin/activate - python run_tests.py + $PYTHON_EXE run_tests.py # Upload to codecov.io (requires a CODECOV_TOKEN environ or github+circleci integration) codecov - store_artifacts: @@ -404,7 +404,7 @@ jobs: # Execute the publish script for real this time MB_PYTHON_TAG=$MB_PYTHON_TAG DO_GPG=True GPG_KEYID=$GPG_KEYID TWINE_PASSWORD=$TWINE_PASSWORD TWINE_USERNAME=$TWINE_USERNAME GPG_EXECUTABLE=$GPG_EXECUTABLE CURRENT_BRANCH=release DEPLOY_BRANCH=release DO_UPLOAD=True DO_TAG=False ./publish.sh # Have the server git-tag the release and push the tags - VERSION=$(python -c "import setup; print(setup.VERSION)") + VERSION=$($PYTHON_EXE -c "import setup; print(setup.VERSION)") # do sed twice to handle the case of https clone with and without a read token URL_HOST=$(git remote get-url origin | sed -e 's|https\?://.*@||g' | sed -e 's|https\?://||g') echo "URL_HOST = $URL_HOST" diff --git a/.codecov.yml b/.codecov.yml index d96e9a2e..6e790657 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -8,10 +8,14 @@ coverage: range: "70...100" status: - project: yes + project: + default: + threshold: 10% patch: yes changes: no + + parsers: gcov: branch_detection: