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

Dev Branch: 1.2.1 #163

Merged
merged 6 commits into from
Sep 15, 2024
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
71 changes: 43 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4.1.1
- name: Set up Python 3.12 for linting
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.1
with:
python-version: '3.12'
- name: Install dependencies
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4.1.1
- name: Set up Python 3.12
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.1
with:
python-version: '3.12'
- name: Upgrade pip
Expand All @@ -62,9 +62,9 @@ jobs:
- name: Build sdist
shell: bash
run: |-
python -m pip install pip -U
python -m pip install setuptools>=0.8 wheel build
python -m pip install setuptools>=0.8 wheel build twine
python -m build --sdist --outdir wheelhouse
python -m twine check ./wheelhouse/xdoctest*.tar.gz
- name: Install sdist
run: |-
ls -al wheelhouse
Expand Down Expand Up @@ -98,11 +98,11 @@ jobs:
echo "MOD_DPATH = $MOD_DPATH"
python -m pytest --verbose --cov=xdoctest $MOD_DPATH ../tests
cd ..
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
name: Upload sdist artifact
with:
name: sdist_wheels
path: wheelhouse/*.tar.gz
path: ./wheelhouse/xdoctest*.tar.gz
build_purepy_wheels:
##
# Download and test the pure-python wheels that were build in the
Expand All @@ -128,7 +128,7 @@ jobs:
with:
platforms: all
- name: Setup Python
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
- name: Build pure wheel
Expand All @@ -140,10 +140,10 @@ jobs:
- name: Show built files
shell: bash
run: ls -la wheelhouse
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
name: Upload wheels artifact
with:
name: wheels
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/xdoctest*.whl
test_purepy_wheels:
name: ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
Expand Down Expand Up @@ -273,13 +273,14 @@ jobs:
with:
platforms: all
- name: Setup Python
uses: actions/setup-python@v5.0.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download wheels
with:
name: wheels
pattern: wheels-*
merge-multiple: true
path: wheelhouse
- name: Install wheel ${{ matrix.install-extras }}
shell: bash
Expand All @@ -291,11 +292,23 @@ jobs:
echo "Installing helpers"
pip install setuptools>=0.8 setuptools_scm wheel build -U
pip install tomli pkginfo
export WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('xdoctest*.whl'))[-1]).replace(chr(92), chr(47)))")
export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
echo "$WHEEL_FPATH=WHEEL_FPATH"
echo "$INSTALL_EXTRAS=INSTALL_EXTRAS"
echo "$MOD_VERSION=MOD_VERSION"
export WHEEL_FPATH=$(python -c "if 1:
import pathlib
dist_dpath = pathlib.Path('wheelhouse')
candidates = list(dist_dpath.glob('xdoctest*.whl'))
candidates += list(dist_dpath.glob('xdoctest*.tar.gz'))
fpath = sorted(candidates)[-1]
print(str(fpath).replace(chr(92), chr(47)))
")
export MOD_VERSION=$(python -c "if 1:
from pkginfo import Wheel, SDist
fpath = '$WHEEL_FPATH'
cls = Wheel if fpath.endswith('.whl') else SDist
print(cls(fpath).version)
")
echo "WHEEL_FPATH=$WHEEL_FPATH"
echo "INSTALL_EXTRAS=$INSTALL_EXTRAS"
echo "MOD_VERSION=$MOD_VERSION"
pip install --prefer-binary "xdoctest[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
echo "Install finished."
- name: Test wheel ${{ matrix.install-extras }}
Expand Down Expand Up @@ -350,7 +363,7 @@ jobs:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
test_deploy:
name: Uploading Test to PyPi
name: Deploy Test
runs-on: ubuntu-latest
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release')
needs:
Expand All @@ -359,12 +372,13 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download wheels
with:
name: wheels
pattern: wheels-*
merge-multiple: true
path: wheelhouse
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download sdist
with:
name: sdist_wheels
Expand Down Expand Up @@ -413,7 +427,7 @@ jobs:
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
name: Upload deploy artifacts
with:
name: deploy_artifacts
Expand All @@ -424,7 +438,7 @@ jobs:
wheelhouse/*.asc
wheelhouse/*.ots
live_deploy:
name: Uploading Live to PyPi
name: Deploy Live
runs-on: ubuntu-latest
if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
needs:
Expand All @@ -433,12 +447,13 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download wheels
with:
name: wheels
pattern: wheels-*
merge-multiple: true
path: wheelhouse
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download sdist
with:
name: sdist_wheels
Expand Down Expand Up @@ -487,7 +502,7 @@ jobs:
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
name: Upload deploy artifacts
with:
name: deploy_artifacts
Expand All @@ -508,7 +523,7 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
- uses: actions/download-artifact@v4.1.2
name: Download artifacts
with:
name: deploy_artifacts
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Version 1.2.1 - Unreleased

### Changed
* Removed `16806_WORKAROUND` as it is not longer needed for Python 3.8+

### Fixed
* Fixed incorrect return type in docstrings


## Version 1.2.0 - Released 2024-08-20

### Added
* Support for top level awaits in async code examples.

### Removed
* Dropped 3.6 and 3.7 support. Now supporting 3.6+ Use xdoctest<=1.1.6 for 3.6 or 3.7 support.
* Dropped 3.6 and 3.7 support. Now supporting 3.8+ Use xdoctest<=1.1.6 for 3.6 or 3.7 support.


## Version 1.1.6 - Released 2024-08-01
Expand Down
2 changes: 1 addition & 1 deletion dev/backwards_incompatiblity_examples_inthewild.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Note, if we put a # after the empty line, the code still breaks, so that is
# something we can/should fix.

# >>> class NamesFilter(object):
# >>> class NamesFilter:
# ... def __init__(self, allowed):
# ... self._allowed = allowed
# ...
Expand Down
2 changes: 1 addition & 1 deletion dev/demo/demo_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def demo3():
pass


class Demo5(object):
class Demo5:
"""
CommandLine:
xdoctest -m ~/code/xdoctest/dev/demo/demo_errors.py Demo5
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ url = "https://github.com/Erotemic/xdoctest"
license = "Apache 2"
dev_status = "stable"
typed = true
skip_autogen = ["MANIFEST.in"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down
6 changes: 1 addition & 5 deletions requirements/colors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
#Pygments >= 2.2.0

Pygments>= 2.4.1 ; python_version >= '3.5.0' # Python 2.7
Pygments>= 2.0.0 ; python_version < '3.5.0' and python_version >= '2.7.0' # Python 2.7-3.4

Pygments >= 2.15.1
colorama >= 0.4.1;platform_system=="Windows"
2 changes: 1 addition & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ sphinx-autobuild >= 2021.3.14
sphinx_rtd_theme >= 1.0.0
sphinxcontrib-napoleon >= 0.7
sphinx-autoapi >= 1.8.4
Pygments >= 2.9.0
Pygments >= 2.15.1
myst_parser >= 0.18.0
sphinx-reredirects >= 0.0.1
9 changes: 0 additions & 9 deletions requirements/jupyter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@
# xdev availpkg attrs
# xdev availpkg ipython_genutils


nbconvert>=6.1.0; python_version >= '3.7.0' and platform_python_implementation != "PyPy" # Python 3.7+
nbconvert>=6.0.0; python_version < '3.7.0' and python_version >= '3.6.0' and platform_python_implementation != "PyPy" # Python 3.6

# For nbconvert
jinja2>=3.0.0 ; python_version >= '3.6' and platform_python_implementation != "PyPy" # Python 3.6+


jupyter_client>=7.0.0


IPython>=7.23.1


# Requires psutil? Breaking on pypy windows?
ipykernel>=6.11.0 ; python_version < '4.0' and python_version >= '3.12' and (platform_system!="Windows" or platform_python_implementation != "PyPy") # Python 3.12+
ipykernel>=6.0.0 ; python_version < '3.12' and python_version >= '3.7' and (platform_system!="Windows" or platform_python_implementation != "PyPy") # Python 3.7-3.11


# For IPython-kernel
debugpy>=1.6.0 ; python_version >= '3.10' # Python 3.10+
debugpy>=1.3.0 ; python_version < '3.10' and python_version >= '3.9' # Python 3.9
Expand All @@ -35,14 +30,10 @@ debugpy>=1.0.0 ; python_version < '3.9' and python_version >= '3.8' # Pyt
# Needed for earlier versions of nbconvert
ipython_genutils >= 0.2.0 ; python_version >= '3.6' and platform_python_implementation != "PyPy" # Python 3.10+


# For IPython
jedi>=0.16

attrs>=19.2.0

# For jupyter-client
jupyter_core >= 4.7.0

# For jupyter-core
# pywin32>=1.0; platform_system=="Windows" and python_version >= '3.6' and platform_python_implementation != "PyPy"
2 changes: 1 addition & 1 deletion requirements/tests-binary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pybind11>=2.10.3 ; python_version < '4.0' and python_version >= '3.11' # Pyt
pybind11>=2.7.1 ; python_version < '3.11' # Python <=3.10

cmake>=3.25.0 ; python_version < '4.0' and python_version >= '3.11' # Python 3.11+
cmake>=3.21.2 ; python_version < '3.11' # Python <=3.10
cmake>=3.21.2 ; python_version < '3.11' # Python <=3.10
6 changes: 3 additions & 3 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# major.minor version.
# See xdev availpkg for helper script

pytest >= 6.2.5 ; python_version >= '3.10.0' # Python 3.10+
pytest >= 4.6.0 ; python_version < '3.10.0' and python_version >= '3.7.0' # Python 3.7-3.9
pytest >= 6.2.5 ; python_version >= '3.10.0' # Python 3.10+
pytest >= 4.6.0 ; python_version < '3.10.0' and python_version >= '3.7.0' # Python 3.7-3.9

pytest-cov >= 3.0.0 ; python_version >= '3.6.0' # Python 3.6+
pytest-cov >= 3.0.0 ; python_version >= '3.6.0' # Python 3.6+
Empty file modified setup.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/xdoctest/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Create the most singleton object ever to avoid reload issues
# this is based on ubelt.NoParam, which has more docs on how this works
class _NOT_EVAL_TYPE(object):
class _NOT_EVAL_TYPE:
"""
This is a singleton object used as a sentinel value. The value of
:data:`NoParam` is robust to reloading, pickling, and copying. See
Expand Down
2 changes: 1 addition & 1 deletion src/xdoctest/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def myfunc():
return 123


class MyClass(object):
class MyClass:
"""
Example:
>>> self = MyClass.demo()
Expand Down
2 changes: 1 addition & 1 deletion src/xdoctest/doctest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def getvalue(self, key, given=None):
return given


class DocTest(object):
class DocTest:
"""
Holds information necessary to execute and verify a doctest

Expand Down
2 changes: 1 addition & 1 deletion src/xdoctest/doctest_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""


class DoctestPart(object):
class DoctestPart:
"""
The result of parsing that represents a "logical block" of code.
If a want statement is defined, it is stored here.
Expand Down
4 changes: 2 additions & 2 deletions src/xdoctest/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IncompleteParseError(SyntaxError):
import _pytest.outcomes
except ImportError: # nocover
# Define dummy skipped exception if pytest is not available
class _pytest(object): # type: ignore
class outcomes(object):
class _pytest: # type: ignore
class outcomes:
class Skipped(Exception):
pass
Loading
Loading