[openstack-dev] [neutron] clean up your git checkout!

Amrith Kumar amrith at tesora.com
Sat Oct 1 01:57:18 UTC 2016


Thanks to John and Clark Boylan for their help as I tried this setting out and tried to propose a change in Trove for this.

In researching this some more, I found this[1] old email thread. I would like to submit to you the following set of comments from Mike Bayer, Doug Hellmann and Sean Dague.

Mike Mayer wrote (in part),

"Short answer: if you want this feature, put PYTHONDONTWRITEBYTECODE into *your* environment. Don't force it on our automated tests or on my environment. .pyc files make a difference in behavior, and if we banish them from all testing, then our code is never tested within the environment that it will normally be run in after shipment."

Doug Hellman wrote (in part),

"I have to agree with Mike here. Cleaning up our dev environments using a little automation is better than disabling a feature of the interpreter that may have unforeseen consequences in behavior or performance. The more we introduce unusual settings like this into our environments and tools, the more edge cases and weirdness we're going to find in those tools that keep us from doing the work we really want to be doing."

Doug Hellman wrote (in part),

"Adding a command to tox to remove the files would be less intrusive than disabling their creation.

We have had bad experiences mixing features to produce unusual dev environments that are different from the way the software really runs. All of the issues we had with namespace packages were caused by a bug in that implementation exposed because we were doing something unusual in devstack, for example.

Adding some variation of "find $(python setup.py --name) --name '*.pyc' | xargs rm -f" to tox.ini before running testr solves the problem you have identified without introducing any side-effects."

It was this argument that led Sean Dague to amend his patch to Nova[2] from one that set this environment variable PYTHONDONTWRITEBYTECODE, to instead use the command[3]:

	find . -type f -name "*.pyc" -delete

Sean wrote (in part),

"Ok, while I'm not actually convinced that PYTHONDONTWRITEBYTECODE=true is a problem (especially after looking at the actual source of the python interpreter, where it's pretty clear everything is abstracted through a set of AST classes regardless of whether these files are there or not), I changed my upstream proposal to just the same purge line we'd be using in Nova run_tests.sh forever before every tox run."

I submit to y'all that maybe the proposal provided in this email thread should be reconsidered in light of the discussion already had on the ML some years ago.

FWIW, after reading the old thread, and the comments from this email thread that I found, I don't believe I'll approve a change to include PYTHONDONTWRITEBYTECODE=1 in Trove.

Thanks,

-amrith


[1] http://openstack.markmail.org/thread/3tm4bco3mbu3hq4q
[2] https://review.openstack.org/#/c/121044/
[3] https://review.openstack.org/#/c/121044/5/tox.ini


> -----Original Message-----
> From: John Villalovos [mailto:openstack.org at sodarock.com]
> Sent: Friday, September 30, 2016 5:41 PM
> To: OpenStack Development Mailing List (not for usage questions)
> <openstack-dev at lists.openstack.org>
> Subject: Re: [openstack-dev] [neutron] clean up your git checkout!
> 
> On Fri, Sep 30, 2016 at 12:12 PM, Amrith Kumar <amrith at tesora.com> wrote:
> > :)
> >
> > Clark ...
> >
> > If I git clone a brand new repository and edit the tox.ini with the
> proposed change:
> >
> >> >     PYTHONDONTWRITEBYTECODE = 1
> >
> > I had assumed that no .pyc's would get created.
> 
> That is correct for 'tox' runs. Doing a: tox -e py27
> Should not generate any *.pyc files.
> 
> Feel free to post a paste.openstack.org of your modified tox.ini file.
> 
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list