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

Fix UnboundLocalError when building changes (1.8) #6135

Merged
merged 1 commit into from Mar 9, 2019

Conversation

bz2
Copy link
Contributor

@bz2 bz2 commented Mar 4, 2019

Split testing of changes builder to its own test file and root. Improve coverage a little, and add case that fails if a module directive is included in the rst source.

Correctly handle changesets with a module declared.

Ignore coverage annotations files in git.

Fixes #6134 for the 1.8 branch.

Same change basically applies for master, can propose that separately or whatever the process is for landing on multiple branches.

@codecov
Copy link

codecov bot commented Mar 4, 2019

Codecov Report

Merging #6135 into 1.8 will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##              1.8    #6135     +/-   ##
=========================================
+ Coverage   82.14%   82.25%   +0.1%     
=========================================
  Files         307      308      +1     
  Lines       40663    40678     +15     
  Branches     6285     6284      -1     
=========================================
+ Hits        33403    33459     +56     
+ Misses       5872     5832     -40     
+ Partials     1388     1387      -1
Impacted Files Coverage Δ
tests/test_build.py 94.93% <ø> (ø) ⬆️
tests/test_build_changes.py 100% <100%> (ø)
sphinx/builders/changes.py 83.65% <100%> (+12.22%) ⬆️
sphinx/builders/html.py 82.95% <0%> (+0.09%) ⬆️
sphinx/directives/code.py 86.08% <0%> (+0.73%) ⬆️
sphinx/domains/changeset.py 90.24% <0%> (+4.87%) ⬆️
sphinx/domains/c.py 66.85% <0%> (+11.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f97fd4...71dec3b. Read the comment docs.

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits

.gitignore Outdated
@@ -2,6 +2,7 @@
*.egg
*.so
*.swp
*,cover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran:

tox -e coverage
coverage annotate

Which gave me a pile of these mixed in with my changes, but I guess maybe it's more useful to be able to git clean -f without -x.

tests/test_build_changes.py Show resolved Hide resolved
@tk0miya tk0miya modified the milestones: 2.0.0, 1.8.5 Mar 5, 2019
.gitignore Outdated
@@ -2,7 +2,6 @@
*.egg
*.so
*.swp
*,cover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. I don't know about "coverage annotate".

@@ -34,10 +34,10 @@ def test_build(app):


@pytest.mark.sphinx(
'changes', testroot='changes', srcdir='changes-none',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explanation. Indeed, this is needed.

@bz2
Copy link
Contributor Author

bz2 commented Mar 7, 2019

@tk0miya I think this can land in current state? Would be good to improve the testing later but that can be a separate change.

@tk0miya
Copy link
Member

tk0miya commented Mar 8, 2019

@bz2 I think the srcdir parameter for test_no_changes is necessary. So I'd like to revert it. Then I'll merge this ASAP.

Split testing of changes builder to its own test file and root.
Improve coverage a little, and add case that fails if a module
directive is included in the rst source.

Correctly handle changesets with a module declared.

Fixes sphinx-doc#6134
@bz2
Copy link
Contributor Author

bz2 commented Mar 8, 2019

@tk0miya Amended.

Would you like me to also put up a branch for master, or is your process merging forwards from the 1.8 branch anyway?

@tk0miya
Copy link
Member

tk0miya commented Mar 9, 2019

Thank you for updating! I'm merging this into 1.8 branch. And it will be merged into master branch later.

@tk0miya tk0miya merged commit 7c50f8f into sphinx-doc:1.8 Mar 9, 2019
tk0miya added a commit that referenced this pull request Mar 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants