Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarktaylor committed Sep 6, 2024
2 parents f00c99e + bd3642f commit dbb63b9
Show file tree
Hide file tree
Showing 56 changed files with 99 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
builddist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Windows Venv
Expand Down Expand Up @@ -58,9 +58,9 @@ jobs:
matrix:
python-version: [ "pypy-3.10", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
needs: versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install phmutest
Expand All @@ -107,12 +107,9 @@ jobs:
isort -
- name: Formatting
# Show reformatting changes.
# Make the changes.
# Subsequent steps run with the modified files.
# Don't run black on the generated test files.
run: |
black **/*.py --check --force-exclude="tests/py"
black **/*.py --force-exclude="tests/py"
black **/*.py --diff --force-exclude="tests/py"
continue-on-error: true
- name: Code Style
run: |
Expand All @@ -130,7 +127,7 @@ jobs:
python docs/premkdocs.py
mkdocs build
- name: Upload mkdocs site
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: site
path: site
Expand All @@ -141,10 +138,10 @@ jobs:
needs: inspect
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
id: setuppython
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install phmutest
Expand All @@ -167,7 +164,7 @@ jobs:
continue-on-error: true

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml # optional
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.x
id: setuppython
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install phmutest
Expand All @@ -40,7 +40,7 @@ jobs:
continue-on-error: true

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml # optional
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:
workflow_dispatch:

env:
ref: v0.0.3
ref: v0.0.4

jobs:
builddist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

Expand All @@ -27,7 +27,7 @@ jobs:
python -m pip hash dist/*
- name: Upload dist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist-${{ env.ref }}
path: dist/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:

env:
project: phmutest
version: 0.0.3
version: 0.0.4
command: phmutest

jobs:
pypi-install:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Mark Taylor
Copyright (c) 2024 Mark Taylor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# phmutest 0.0.3
# phmutest 0.0.4

## Detect broken Python examples in Markdown

Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tool API for phmutest version 0.0.3
# Tool API for phmutest version 0.0.4

## API - phmutest.tool

Expand Down
3 changes: 2 additions & 1 deletion docs/fixture_py.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# src/phmutest/fixture.py

```python
"""v0.0.3 Keyword arguments passed to --fixture function and return type Fixture.
"""v0.0.4 Keyword arguments passed to --fixture function and return type Fixture.
These are passed to the fixture function as keyword arguments:
Expand All @@ -21,6 +21,7 @@ is_replmode
Python bool. True when commandline argument --replmode is present.
"""

from dataclasses import dataclass
from typing import Callable, MutableMapping, Optional

Expand Down
1 change: 1 addition & 0 deletions docs/generated_project_py.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from phmutest.skip import sys_tool as _phm_sys

_phm_globals = None
_phm_testcase = unittest.TestCase()
_phm_testcase.maxDiff = None
_phm_log = []


Expand Down
1 change: 1 addition & 0 deletions docs/generated_share_demo_py.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from phmutest.skip import sys_tool as _phm_sys

_phm_globals = None
_phm_testcase = unittest.TestCase()
_phm_testcase.maxDiff = None
_phm_log = []


Expand Down
1 change: 1 addition & 0 deletions docs/make_wrapped_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create Markdown wrappers around the project's example .py files."""

from pathlib import Path

top = "# <put filename here>\n\n```python\n"
Expand Down
1 change: 1 addition & 0 deletions docs/premkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- enter Ctrl-C to discontinue watching and shut down the mkdocs server
Suggest adding the mkdocs.yml docs_dir to .gitignore.
"""

import subprocess
import sys
from multiprocessing import Process
Expand Down
6 changes: 6 additions & 0 deletions docs/recent_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
0.0.3 - 2023-09-24

- Add test_importer.py. Cleanups

0.0.4 - 2024-09-05

- Bugfix- Issue- The generated expected output check in code mode
asserts if the FCB length is greater than a fairly small value.
- Python source formatting updates per Black 24.3.0.
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: phmutest 0.0.3
site_name: phmutest 0.0.4
site_description: Detect broken Python examples in Markdown
copyright: Copyright (c) 2023 Mark Taylor
copyright: Copyright (c) 2024 Mark Taylor
docs_dir: _mkdocsin
theme: readthedocs
nav:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license_files = LICENSE

# https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html
name = phmutest
version = 0.0.3
version = 0.0.4
author = Mark Taylor
author_email = [email protected]
description = Detect broken Python examples in Markdown.
Expand Down
2 changes: 1 addition & 1 deletion src/phmutest/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3"
__version__ = "0.0.4"
26 changes: 14 additions & 12 deletions src/phmutest/cases.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate test cases as a unittest test file."""

import argparse
from pathlib import Path

Expand Down Expand Up @@ -75,12 +76,12 @@ def render_setup_module(
replacements["shareid"] = shareid
replacements["setupblocks"] = deindented_setup_blocks
if args.progress:
replacements[
"showprogressenter"
] = '_phm_sys.stderr_printer("setUpModule()...")'
replacements[
"showprogressexit"
] = '_phm_sys.stderr_printer("leaving setUpModule.")'
replacements["showprogressenter"] = (
'_phm_sys.stderr_printer("setUpModule()...")'
)
replacements["showprogressexit"] = (
'_phm_sys.stderr_printer("leaving setUpModule.")'
)

if args.fixture:
replacements["userfixtureglobs"] = phmutest.subtest.justify(
Expand Down Expand Up @@ -128,12 +129,12 @@ def render_teardown_module(
replacements["teardownblocks"] = deindented_teardown_blocks

if args.progress:
replacements[
"showprogressenter"
] = '_phm_sys.stderr_printer("tearDownModule()...")'
replacements[
"showprogressexit"
] = '_phm_sys.stderr_printer("leaving tearDownModule.")'
replacements["showprogressenter"] = (
'_phm_sys.stderr_printer("tearDownModule()...")'
)
replacements["showprogressexit"] = (
'_phm_sys.stderr_printer("leaving tearDownModule.")'
)

return phmutest.subtest.fill_in(
teardown_module_form,
Expand Down Expand Up @@ -319,6 +320,7 @@ def markdown_file(
$callfixture
_phm_globals = None
_phm_testcase = unittest.TestCase()
_phm_testcase.maxDiff = None
_phm_log = []
$setupmodule
$teardownmodule
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/code.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run the generated unittest source file with unittest.main."""

import argparse
import copy
import importlib
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
--generate, --progress, --sharing,
--log, --summary, --report
"""

import argparse
from pathlib import Path
from typing import List
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/direct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Find phmutest Directives in HTML comment Nodes."""

import re
from dataclasses import dataclass
from enum import Enum, auto
Expand Down
3 changes: 2 additions & 1 deletion src/phmutest/fixture.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""v0.0.3 Keyword arguments passed to --fixture function and return type Fixture.
"""v0.0.4 Keyword arguments passed to --fixture function and return type Fixture.
These are passed to the fixture function as keyword arguments:
Expand All @@ -18,6 +18,7 @@
Python bool. True when commandline argument --replmode is present.
"""

from dataclasses import dataclass
from typing import Callable, MutableMapping, Optional

Expand Down
1 change: 1 addition & 0 deletions src/phmutest/globs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Imported by the generated test file to manage test module globals."""

import inspect
import sys
import types
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/importer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Import user's fixture function given the relative dotted path."""

import importlib.util
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command line parsing, main entry point, and top level operations."""

import argparse
import pathlib
import sys
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/printer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Context manager to print and log entry and exit status of a code block run."""

import contextlib
import io
import sys
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/select.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Identify/select/deselect FCBs per info string, test groups and directives."""

import argparse
from dataclasses import dataclass
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/phmutest/session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generate and run docstests for Python interactive session FCBs."""

import argparse
import doctest
import itertools
Expand Down
Loading

0 comments on commit dbb63b9

Please sign in to comment.