On Fri, 26 Apr 2019, Orion Poplawski wrote:

It appears that in at least some situations pytest will create -PYTEST.pyc files, and sometimes (always?) with weird permissions:

-rw-------. 1 root root 1614 Jul 13 2018 /usr/lib64/python3.7/site-packages/cytoolz/__pycache__/utils_test.cpython-37-PYTEST.pyc

I've noticed the following packages have them:

pytest-4.4.1-1.fc31.src.rpm
python-astropy-healpix-0.4-1.fc31.src.rpm
python-cytoolz-0.9.0.1-3.fc30.src.rpm
python-healpy-1.12.9-1.fc31.src.rpm
python-pytest-repeat-0.8.0-1.fc31.src.rpm
python-pytest-rerunfailures-6.0-1.fc31.src.rpm
python-pytest-shutil-1.6.0-2.fc31.src.rpm
python-reproject-0.4-6.fc30.src.rpm
python3-pytest-asyncio-0.10.0-1.fc31.src.rpm
scipy-1.2.1-1.fc31.src.rpm

These can be prevented by setting PYTHONDONTWRITEBYTECODE=1 when run pytest.

Can anyone else shed more light on this? Should we add this to the guidelines? (Possibly not since there do not appear to be many packages like this). I suspect it comes in when has to set PYTHONPATH=%{buildroot}%{python3_sitearch} due to needing to load compiled modules.

I usually just run tests with PYTHONDONTWRITEBYTECODE=1 to prevent pytest from creating its bytecode files as I don't want them to be packaged and it seems a bit easier than deleting them all after the fact.

Scott
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org

Reply via email to