From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
Christoph Hellwig <hch@infradead.org>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
"linux-kernel@vger.kernel.org org List"
<linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
SeongJae Park <sj38.park@gmail.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [PATCH] changes.rst: explain the usage of virtual environment
Date: Mon, 19 Jun 2017 11:38:01 -0300 [thread overview]
Message-ID: <20170619113801.6b2f21dc@vento.lan> (raw)
In-Reply-To: <59B0A362-D044-4FA8-9286-6D955B8DB241@darmarit.de>
HI Markus,
Em Mon, 19 Jun 2017 16:11:56 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:
> > Am 19.06.2017 um 15:46 schrieb Jonathan Corbet <corbet@lwn.net>:
> >
> > On Mon, 19 Jun 2017 06:08:37 -0700
> > Christoph Hellwig <hch@infradead.org> wrote:
> >
> >> On Mon, Jun 19, 2017 at 08:24:10AM -0300, Mauro Carvalho Chehab wrote:
> >>> As the Sphinx build seems very fragile, specially for
> >>> PDF output, add a notice about how to use it on a virtual
> >>> environment.
> >>
> >> Please don't. python venv are good at one thing only, and that is
> >> making a mess of your python module path. Don't ever use them on a
> >> system that has proper package management.
> >
> > Well, they are also good for running specific versions of a given package
> > without disrupting the setup of your system as a whole, and when even a
> > system with proper package management may not offer the version you need.
> >
> > I guess my question with the patch is whether this text really belongs in
> > changes.rst, or whether it should be part of the doc-guide.
>
> Hi, here are my 5cents:
>
> Typically I have a PY_ENV target in my projects, building a virtualenv
> in a folder named ./local. E.g. in LinuxDoc [1] I use something like this:
>
>
> PY ?=3
> PYTHON ?= python$(PY)
> ..
> VIRTUALENV = virtualenv --python=$(PYTHON)
> VTENV_OPTS = "--no-site-packages"
> PY_ENV = ./local/py$(PY)
I would split the PATH name on a separate var. This way, if one would
like to have multiple Sphinx versions, all it would need would be to
change the directory.
I would prefer to call it as "./sphinx" (or something similar).
So, I would do:
PY_DIR = ./sphinx
PY_ENV = $(PY_DIR)/py$(PY)
Don't forget to add $PY_DIR directory to .gitignore on your patch.
> ..
> quiet_cmd_virtualenv = PYENV $@
> cmd_virtualenv = \
> if [ ! -d "./$(PY_ENV)" ];then \
> $(VIRTUALENV) $(VIRTUALENV_VERBOSE) $(VTENV_OPTS) $2; \
> else \
> echo "using virtualenv from $2"; \
> fi
> ...
> # to build *local* environment, python and virtualenv from the OS is needed!
> $(PY_ENV): virtualenv-exe python-exe
> $(call cmd,virtualenv,$(PY_ENV))
> @$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) -r requirements.txt
Shouldn't it be using "pip$(PY)" instead?
Also, better to seek for requirements on a file under Documentation/sphinx/
directory.
> ..
>
> And the sphinxbuild coammand is used from there::
>
> SPHINXBUILD ?= $(PY_ENV_BIN)/sphinx-build
>
> By this I can stick versions packages. E.g. to select last version of
> RTD theme and Sphinx version 1.5 or upper, I add the following lines to
> my reqierements.txt::
>
> Sphinx>=1.5
> sphinx_rtd_theme
>
> If you are interested, I can prepare a patch, to add such functionality
> (as option) to Documents/Makefile (which will be documented in the doc-guide).
Yeah, IMHO, it makes sense to have something like that at the main build,
as an optional feature, e. g. perhaps adding a new make target, like:
$ make sphinx_virtenv
That would create and populate PY_DIR. If $PY_DIR/bin/sphinx-build exists
and it is executable file, run it. Otherwise, use the system's sphinx,
if available.
>
> [1] https://github.com/return42/linuxdoc/blob/master/utils/makefile.python
>
> -- Markus --
>
>
>
>
>
>
> >
> > jon
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Thanks,
Mauro
next prev parent reply other threads:[~2017-06-19 14:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 11:24 [PATCH] changes.rst: explain the usage of virtual environment Mauro Carvalho Chehab
2017-06-19 13:08 ` Christoph Hellwig
2017-06-19 13:46 ` Jonathan Corbet
2017-06-19 14:11 ` Markus Heiser
2017-06-19 14:38 ` Mauro Carvalho Chehab [this message]
2017-06-19 15:13 ` Markus Heiser
2017-06-20 15:03 ` Markus Heiser
2017-06-19 14:21 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170619113801.6b2f21dc@vento.lan \
--to=mchehab@s-opensource.com \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jcmvbkbc@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
--cc=mchehab@infradead.org \
--cc=sj38.park@gmail.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox