diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f8559b8..36241cb6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,7 +96,7 @@ jobs: ### INITIALIZE AND CACHE REQUIREMENTS ### - restore_cache: keys: - - v4-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ .Environment.CIRCLE_JOB }} + - v5-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ .Environment.CIRCLE_JOB }} - run: name: install dependencies command: | @@ -112,7 +112,7 @@ jobs: - save_cache: paths: - ./pipcache - key: v4-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v5-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ .Environment.CIRCLE_JOB }} # ### RUN TESTS ### - run: name: run tests @@ -137,7 +137,7 @@ jobs: ### INITIALIZE AND CACHE REQUIREMENTS ### - restore_cache: keys: - - v4-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/optional.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ checksum "requirements/colors.txt" }}-{{ .Environment.CIRCLE_JOB }} + - v5-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/optional.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ checksum "requirements/colors.txt" }}-{{ .Environment.CIRCLE_JOB }} - run: name: install dependencies command: | @@ -154,7 +154,7 @@ jobs: paths: #- ./venv - ./pipcache - key: v4-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/optional.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ checksum "requirements/colors.txt" }}-{{ .Environment.CIRCLE_JOB }} + key: v5-dependencies-{{ checksum "requirements/runtime.txt" }}-{{ checksum "requirements/optional.txt" }}-{{ checksum "requirements/tests.txt" }}-{{ checksum "requirements/jupyter.txt" }}-{{ checksum "requirements/colors.txt" }}-{{ .Environment.CIRCLE_JOB }} # ### RUN TESTS ### - run: name: run tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc78ba98..75e84947 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v4.2.0 + uses: actions/setup-python@v4.3.0 with: python-version: 3.8 - name: Install dependencies @@ -40,7 +40,7 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v4.2.0 + uses: actions/setup-python@v4.3.0 with: python-version: 3.8 - name: Upgrade pip @@ -104,8 +104,7 @@ jobs: - '3.8' - '3.9' - '3.10' - - '3.11.0-rc.2' - #- '3.11' soon + - '3.11' - pypy-3.7 install-extras: - tests diff --git a/src/xdoctest/utils/util_import.py b/src/xdoctest/utils/util_import.py index 846b623b..d0d2dc47 100644 --- a/src/xdoctest/utils/util_import.py +++ b/src/xdoctest/utils/util_import.py @@ -571,8 +571,20 @@ def _syspath_modname_to_modpath(modname, sys_path=None, exclude=None): >>> modpath = _syspath_modname_to_modpath(modname) >>> exclude = [split_modpath(modpath)[0]] >>> found = _syspath_modname_to_modpath(modname, exclude=exclude) - >>> # this only works if installed in dev mode, pypi fails - >>> assert found is None, 'should not have found {} because we excluded'.format(found, exclude) + >>> if found is not None: + >>> # Note: the basic form of this test may fail if there are + >>> # multiple versions of the package installed. Try and fix that. + >>> other = split_modpath(found)[0] + >>> assert other not in exclude + >>> exclude.append(other) + >>> found = _syspath_modname_to_modpath(modname, exclude=exclude) + >>> if found is not None: + >>> raise AssertionError( + >>> 'should not have found {}.'.format(found) + >>> ' because we excluded: {}.'.format(exclude) + >>> ' cwd={} '.format(os.getcwd()) + >>> ' sys.path={} '.format(sys.path) + >>> ) """ import glob