Skip to content

Commit

Permalink
Merge branch 'main' into unwrap-for-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman authored Apr 20, 2024
2 parents 78b2043 + ef0a8b5 commit 2248251
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
source venv/bin/activate
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade -r requirements/doc.txt
python -m pip install 'sphinx!=7.3.*'
python -m pip list
- save_cache:
key: pip-cache
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
os: [Ubuntu]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
sphinx-version:
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.2"]
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "'sphinx>=7.2,<7.3'"]
exclude:
- python-version: "3.8"
sphinx-version: "'sphinx>=7.2,<7.3'"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -84,6 +87,7 @@ jobs:
python -m pip install --upgrade pip wheel setuptools
python -m pip install --pre -r requirements/test.txt -r requirements/doc.txt
python -m pip install codecov
python -m pip install 'sphinx!=7.3.*'
python -m pip list
- name: Install
Expand Down
4 changes: 0 additions & 4 deletions numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,8 @@ def _parse(self):
sections = list(self._read_sections())
section_names = {section for section, content in sections}

has_returns = "Returns" in section_names
has_yields = "Yields" in section_names
# We could do more tests, but we are not. Arbitrarily.
if has_returns and has_yields:
msg = "Docstring contains both a Returns and Yields section."
raise ValueError(msg)
if not has_yields and "Receives" in section_names:
msg = "Docstring contains a Receives section but not Yields."
raise ValueError(msg)
Expand Down
4 changes: 3 additions & 1 deletion numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ def test_returnyield():
The number of bananas.
"""
assert_raises(ValueError, NumpyDocString, doc_text)
doc = NumpyDocString(doc_text)
assert len(doc["Returns"]) == 1
assert len(doc["Yields"]) == 2


def test_section_twice():
Expand Down

0 comments on commit 2248251

Please sign in to comment.