Re: No more automagic Python bytecompilation: I'll mass push to your packages

2018-09-13 Thread Scott Talbert

On Thu, 13 Sep 2018, Miro Hrončok wrote:


Hello.

In line with
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompil 
ation_phase_2


I plan to mass push the following 3 lines on the top of your package spec:


I updated my packages to set _python_bytecompile_extra to 0, but for some
reason, python-pyqtgraph is still byte-compiling files under
/usr/share/doc/python-pyqtgraph-doc/ with Python 3.  Is this expected?


I've checked that brp-byte-compile script does recognize your 
_python_bytecompile_extra value and does not attempt to compile anything 
outside /usr/lib/python3.7/. It's something different that creates those 
bytecodes.


During the tests, the __pycache__ directory is created in ./examples/.

This is due to examples/test_examples.py being discovered and run by pytest 
(that's most likely useful).


The examples folder is later copied into /usr/share/doc/python-pyqtgraph-doc/ 
via %doc as a whole, including all the bytecode. Your package does not only 
ship regular bytecode, but also pytest bycode:


/usr/share/doc/python-pyqtgraph-doc/examples/__pycache__/test_examples.cpython-37-PYTEST.pyc

I suggest you do not block the bytecode creation here, but simply remove 
examples/__pycache__/ (and examples/*/__pycache__/) after pytest invocation 
in %check.



diff --git a/python-pyqtgraph.spec b/python-pyqtgraph.spec
index 4b86cdf..4c195ec 100644
--- a/python-pyqtgraph.spec
+++ b/python-pyqtgraph.spec
@@ -60,6 +60,9 @@ rm -f doc/build/html/objects.inv
%check
xvfb-run -a py.test-%{python3_version} -k "not (test_ImageItem or 
test_ImageItem_axisorder or test_PlotCurveItem or test_getArrayRegion or 
test_getArrayRegion_axisorder or test_PolyLineROI)"


+# examples/test_examples.py created bytecode we don't want to ship
+find examples -name __pycache__ -exec rm -r {} +
+
%files -n python3-%{srcname}
%license LICENSE.txt
%doc CHANGELOG README.md


Ah, I should have thought of the tests, as I've run into this before. 
Thanks!


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


Re: No more automagic Python bytecompilation: I'll mass push to your packages

2018-09-13 Thread Miro Hrončok

On 13.9.2018 05:27, Scott Talbert wrote:

On Wed, 12 Sep 2018, Miro Hrončok wrote:


Hello.

In line with
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompil 


ation_phase_2

I plan to mass push the following 3 lines on the top of your package 
spec:


I updated my packages to set _python_bytecompile_extra to 0, but for some
reason, python-pyqtgraph is still byte-compiling files under
/usr/share/doc/python-pyqtgraph-doc/ with Python 3.  Is this expected?


I've checked that brp-byte-compile script does recognize your 
_python_bytecompile_extra value and does not attempt to compile anything 
outside /usr/lib/python3.7/. It's something different that creates those 
bytecodes.


During the tests, the __pycache__ directory is created in ./examples/.

This is due to examples/test_examples.py being discovered and run by 
pytest (that's most likely useful).


The examples folder is later copied into 
/usr/share/doc/python-pyqtgraph-doc/ via %doc as a whole, including all 
the bytecode. Your package does not only ship regular bytecode, but also 
pytest bycode:


/usr/share/doc/python-pyqtgraph-doc/examples/__pycache__/test_examples.cpython-37-PYTEST.pyc

I suggest you do not block the bytecode creation here, but simply remove 
examples/__pycache__/ (and examples/*/__pycache__/) after pytest 
invocation in %check.



diff --git a/python-pyqtgraph.spec b/python-pyqtgraph.spec
index 4b86cdf..4c195ec 100644
--- a/python-pyqtgraph.spec
+++ b/python-pyqtgraph.spec
@@ -60,6 +60,9 @@ rm -f doc/build/html/objects.inv
 %check
 xvfb-run -a py.test-%{python3_version} -k "not (test_ImageItem or 
test_ImageItem_axisorder or test_PlotCurveItem or test_getArrayRegion or 
test_getArrayRegion_axisorder or test_PolyLineROI)"


+# examples/test_examples.py created bytecode we don't want to ship
+find examples -name __pycache__ -exec rm -r {} +
+
 %files -n python3-%{srcname}
 %license LICENSE.txt
 %doc CHANGELOG README.md


--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
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


Re: No more automagic Python bytecompilation: I'll mass push to your packages

2018-09-12 Thread Scott Talbert

On Wed, 12 Sep 2018, Miro Hrončok wrote:


Hello.

In line with
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompil
ation_phase_2

I plan to mass push the following 3 lines on the top of your package spec:


I updated my packages to set _python_bytecompile_extra to 0, but for some
reason, python-pyqtgraph is still byte-compiling files under
/usr/share/doc/python-pyqtgraph-doc/ with Python 3.  Is this expected?

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