Skip to content

Commit

Permalink
docs: Run doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 25, 2024
1 parent a1086d2 commit 13daea6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
env:
HATCH_ENV: all
HATCH_VERBOSE: "3"
strategy:
fail-fast: false
Expand Down Expand Up @@ -110,14 +111,14 @@ jobs:
run: |
pipx install hatch
- name: Run tests
env:
HATCH_ENV: all
run: |
hatch run +py=${{ matrix.python-version }} cov
- uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.os }}-${{ matrix.python-version }}
path: ".coverage.*"
- name: Run doctests
run: hatch run +py=${{ matrix.python-version }} doctest

coverage:
name: Coverage
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ matrix.python.env-vars = [
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
doctest = "pytest --doctest-modules {args:src/pep610}"
cov = "coverage run -m pytest {args:tests}"

[[tool.hatch.envs.all.matrix]]
Expand Down
12 changes: 12 additions & 0 deletions src/pep610/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ def is_editable(self: Self) -> bool:
Returns:
Whether the distribution is installed in editable mode.
>>> dir_info = DirInfo(editable=True)
>>> dir_info.is_editable()
True
>>> dir_info = DirInfo(editable=False)
>>> dir_info.is_editable()
False
>>> dir_info = DirInfo(editable=None)
>>> dir_info.is_editable()
False
"""
return self.editable is True

Expand Down

0 comments on commit 13daea6

Please sign in to comment.