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

John Villalovos openstack.org at sodarock.com
Fri Sep 30 17:57:28 UTC 2016


Projects may want to add to their tox.ini something like this:

https://github.com/openstack/ironic/blob/c445c19285c2f3ee6a099f9f7473dd6fe087116b/tox.ini#L10

Basically add:
PYTHONDONTWRITEBYTECODE = 1

On Fri, Sep 30, 2016 at 7:20 AM, Ihar Hrachyshka <ihrachys at redhat.com> wrote:
> Michał Dulko <michal.dulko at intel.com> wrote:
>
>> On 09/30/2016 04:06 PM, Ihar Hrachyshka wrote:
>>>
>>> Ihar Hrachyshka <ihrachys at redhat.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> today we landed https://review.openstack.org/#/c/269658/ (huge!) that
>>>> removed neutron/objects/network/ directory and replaced it with
>>>> neutron/objects/network.py file. Though it makes python that sees old
>>>> .pyc files sad:
>>>>
>>>> Failed to import test module: neutron.tests.unit.objects.test_network
>>>> Traceback (most recent call last):
>>>>   File
>>>>
>>>> "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py",
>>>> line 456, in _find_test_path
>>>>     module = self._get_module_from_name(name)
>>>>   File
>>>>
>>>> "/home/vagrant/git/neutron/.tox/py27/lib/python2.7/site-packages/unittest2/loader.py",
>>>> line 395, in _get_module_from_name
>>>>     __import__(name)
>>>>   File "neutron/tests/unit/objects/test_network.py", line 23, in
>>>> <module>
>>>>     obj_test_base.BaseObjectIfaceTestCase):
>>>>   File "neutron/tests/unit/objects/test_network.py", line 24, in
>>>> NetworkPortSecurityIfaceObjTestCase
>>>>     _test_class = network.NetworkPortSecurity
>>>> AttributeError: 'module' object has no attribute 'NetworkPortSecurity'
>>>> The test run didn't actually run any tests
>>>>
>>>> Please run git clean -f -x in your checkout to remove all .pyc files.
>>>> This should solve any import issues you may experience due to the new
>>>> patch.
>>>
>>>
>>> I hear that -f -x is not enough. Please add -d too:
>>>
>>> $ git clean -f -x -d
>>>
>>> Ihar
>>
>>
>> Isn't ``find . -name \*.pyc -delete`` enough? That way you won't remove
>> anything else. In Cinder we have that in tox.ini [1].
>>
>> [1]
>>
>> https://github.com/openstack/cinder/blob/792108f771607b75a25e9c4cfaaa26e5039d1748/tox.ini#L21-L21
>
>
> Actually not, because empty directories won’t be cleaned by the command you
> suggested.
>
> Ihar
>
>
> __________________________________________________________________________
> 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