Skip to content

Perform 'blurb split' for master. #2719

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

Closed
wants to merge 13 commits into from
Closed

Perform 'blurb split' for master. #2719

wants to merge 13 commits into from

Conversation

larryhastings
Copy link
Contributor

No description provided.

Copy link
Member

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

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

A quick perusal of the output LGTM.

@brettcannon
Copy link
Member

It looks like Sphinx snuck in a new deprecation warning in Sphinx 1.6.3 which this is triggering. If you can easily fix it by replacing any use of sphinx.util.compat.Directive with docutils.parsers.rst.Directive (I think) then please do, else pin Sphinx to 1.6.2 in the Travis configuration.

@brettcannon
Copy link
Member

And I think the culprit might be

from sphinx.util.compat import Directive
, but that's just from a quick search for [Directive].

@ned-deily
Copy link
Member

For the deprecation warning, I documented the issue in bpo-30939 and PR #2721 (for master), also needed in other branches.

@ned-deily
Copy link
Member

LIke Brett, I didn't thoroughly review the changes but, in general, LGTM. One concern: as is, making this change will immediately break all doc builds of Doc/whatsnew/changelog.rst (for example, https://docs.python.org/dev/whatsnew/changelog.html). Are you planning to change Doc/Makefile to automatically do a 'blurb' run? I think we need to.

@ned-deily
Copy link
Member

I tried to restart the Travis doc build but it is now getting a 3/333 unused rules warning for make suspicious which is suspicious because I don't get that when doing a clean make suspicious locally.

@larryhastings
Copy link
Contributor Author

So... make suspicious is itself suspicious? GREAT SUCCESS

I experimented with having Doc/Makefile run blurb merge. That works fine, but it's a bit uncomfortable having the doc build process output a file in ../Misc. I propose to change the documentation so blurb merge outputs to build/NEWS and update the references (e.g. whatsnew/changelog.rst).

This does make the Doc build process dependent on blurb, which I hadn't anticipated. But that's a natural enough outcome of the process. And we can easily update the make venv target of the doc makefile to also install blurb. I don't think this is a big deal.

@larryhastings
Copy link
Contributor Author

@brettcannon: It looks to me like Travis built against an old version. Did I hit some sort of workflow bug?

I changed Doc/Makefile and pushed. This was local revision dc85bd9, which AFAICT was auto-merged on GitHub to revision 8163ffa44849 . This kicked off Travis CI build 7463 ( https://travis-ci.org/python/cpython/builds/254150043 ).

The build didn't work because I had to fix .travis.yaml too. So I pushed a second change, which on my side is revision a8f8d57 . That kicked off Travis CI build 7464 ( https://travis-ci.org/python/cpython/builds/254151401 ). But Travis build 7464 was run against 8163ffa44849 ! Both Travis builds 7463 and 7464 were based on the same revision.

What's strange is that on Travis's "requests" dashboard: https://travis-ci.org/python/cpython/requests
it shows the latest checkin comment for build 7464. But both builds were clearly based on the same revision. It even shows you that in the requests dashboard.

What's going on?

I may try to fool Travis into running another build by uploading a no-op revision.

@vstinner
Copy link
Member

The docs job fails on Travis CI because this job only clones the last 50 commits:

git clone --depth=50 https://github.com/python/cpython.git python/cpython

whereas blurb looks for a specific commit:

run("git log -r 7f777ed95a19224294949e1b4ce56bbffcb1fe9f")

I don't think that we can change how Travis CI clones a Git repository, so we should change how blurb checks if if's running in a Git repository. Maybe it should catch subprocess.SubprocessError on:

git_dir = run("git rev-parse --git-dir").strip()

To check if it's running in Git or not?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@brettcannon
Copy link
Member

Looks like @Haypo spotted why the revision check is failing. A bit annoying but understandable since Travis doesn't want to pay the CPU/network costs of downloading the entire CPython repo.

As for having the build process depend on blurb, that's just life and I have no issue with it since we already depend on sphinx. If it becomes a really serious problem we can talk about just putting blurb into the cpython repo to essentially vendor blurb in Python itself.

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

Not surprisingly, trying to add blurb into the doc build has twisty little passages. I ran into two major problems reviewing and testing this:

  1. At the moment, the most recent version of blurb that is published on PyPI and the first one that works as expected was published as 1.0.2.dev1. Because it's a dev version, by default pip won't try to install it and falls back to the last "production" release 1.0.1.post1 which has bugs. I think the best solution is to specify a version >=1.0.2dev1 with Travis (not tested) and pip.
  2. Installing blurb into the venv produced by make venv is good except that the rest of the Doc Makefile does not use the venv by default. The (undocumented, other than in the original checkin message d5ea39d) intended use was to then explicitly pass the venv Python into Doc makefile targets by setting the PYTHON variable, in part, because trying to use venv activate in Makefile recipes can be problematic. But even then, the blurb command isn't found because using PYTHON= doesn't put the venv bin directory (where the blurb script is installed) on the process PATH. I've suggested one way around it which is to invoke blurb via $(PYTHON) -m blurb; that way, the lack of blurb sort of fails the same way the lack of sphinx-build will. It might be nice to fail with a more informative message. I think it mandatory to document the venv target in Doc/README.rst and something about the need to use PYTHON=venv/bin/python when using venv. BTW, it appears that the 2.7 Doc/Makefile doesn't have a venv target so that will have to be backported for the 2.7 PR.

.travis.yml Outdated
@@ -42,6 +42,7 @@ matrix:
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
# (Updating the version is fine as long as no warnings are raised by doing so.)
- python -m pip install sphinx~=1.6.1
- python -m pip install blurb
Copy link
Member

Choose a reason for hiding this comment

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

Suggest something like:
- python -m pip install 'blurb>=1.0.2dev1'

Copy link
Member

Choose a reason for hiding this comment

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

@larryhastings did you push this version? If so, was keeping the dev version on purpose or an accident? If the latter we can just fix the version number and do another release as 1.0.2 so the dependency can be >=1.0.2.

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 pushed this version. I don't remember what I changed. I didn't keep the "dev" version on purpose, but then again it is still a little bit under development.

Copy link
Member

@brettcannon brettcannon Jul 22, 2017

Choose a reason for hiding this comment

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

Blurb is under development but is the 1.0.2 release specifically under development? My assumption is you mean the former and not the latter, which means I can push a 1.0.2 release so that the changes in that bugfix release go public because right now no one is getting access since pip considers a dev release unusable without opting in.

Doc/Makefile Outdated
@@ -38,6 +38,8 @@ help:
@echo " serve to serve the documentation on the localhost (8000)"

build:
-mkdir build
Copy link
Member

Choose a reason for hiding this comment

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

A more common idiom for this is mkdir -p build. That has the advantage of not producing any messages if the directory already exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Doc/Makefile Outdated
@@ -38,6 +38,8 @@ help:
@echo " serve to serve the documentation on the localhost (8000)"

build:
-mkdir build
blurb merge -f build/NEWS
Copy link
Member

Choose a reason for hiding this comment

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

To get around the PATH problem, suggest:

  1. Adding
    BLURB = $(PYTHON) -m blurb
    after line 8 (SPHINXBUILD = sphinx-build) in the definitions at the top of the file and then
  2. changing the line above to:
    $(BLURB) merge -f build/NEWS
    That way, if users do a make venv ; make html PYTHON=venv/bin/python, blurb will be found there but, if they need to use a different version of blurb, they can override it: make html BLURB=/usr/local/bin/blurb.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Doc/Makefile Outdated
@@ -107,7 +109,7 @@ clean:

venv:
$(PYTHON) -m venv venv
./venv/bin/python3 -m pip install -U Sphinx
./venv/bin/python3 -m pip install -U Sphinx blurb
Copy link
Member

Choose a reason for hiding this comment

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

As above, suggest setting a version requirement here:
./venv/bin/python3 -m pip install -U Sphinx 'blurb>=1.0.2dev1'
That should be future-proof.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@brettcannon
Copy link
Member

I suspect @larryhastings did a release on Sunday of blurb and simply forgot to bump the version number to 1.0.2 (i.e. drop the dev1 part). Once that's confirmed it wasn't on purpose Larry or me can quickly fix the version number and do a non-dev release.

@larryhastings
Copy link
Contributor Author

Booyah! We now pass CI testing in a post-blurb world. @ned-deily, care to review again?

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes. Other than the spurious change noted, I still think we need to document how to use make venv and the need to add PYTHON=venv/bin/python to the doc make steps. And I need to update the mac installer build accordingly.

@@ -959,3 +959,4 @@ PyObject_ClearWeakRefs(PyObject *object)
PyErr_Restore(err_type, err_value, err_tb);
}
}

Copy link
Member

Choose a reason for hiding this comment

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

This seems spurious.

@brettcannon
Copy link
Member

@ned-deily where are you suggesting to document the use of make venv? https://devguide.python.org/docquality/#helping-with-the-developer-s-guide ?

@ned-deily
Copy link
Member

@brettcannon The primary documentation for Doc builds is Doc/README.rst. All of the make targets should be described there. Adding something to that section of the devguide would be good, too.

@brettcannon
Copy link
Member

I created GH-2953 to document make venv to help keep this moving forward.

@larryhastings larryhastings deleted the blurb-split-master branch September 4, 2017 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants