[PATCH evemu 16/16] python: add all .pyc files to CLEANFILES

Benjamin Tissoires benjamin.tissoires at gmail.com
Tue Aug 12 10:49:06 PDT 2014


On Mon, Aug 11, 2014 at 9:34 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Splitting the python_sources into a separate variable. No functional change,
> just nicer to read than base_python_PYTHON in the CLEANFILES.
>
> Python2 and Python3 have different behaviors for the pyc files, in Python3
> they're inside a __pycache__ folder and named e.g. const.cpython-33.pyc.
> We can just delete the folder itself here, not worrying about the specific
> names.

I better wait for the rebase for this one too.

 Cheers,
Benjamin

>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  python/Makefile.am | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/python/Makefile.am b/python/Makefile.am
> index b529f1f..84dd7d4 100644
> --- a/python/Makefile.am
> +++ b/python/Makefile.am
> @@ -16,13 +16,15 @@
>  # You should have received a copy of the GNU General Public License along
>  # with this program.  If not, see <http://www.gnu.org/licenses/>.
>
> -nobase_python_PYTHON = \
> +python_sources = \
>         evemu/__init__.py \
>         evemu/base.py \
>         evemu/const.py \
>         evemu/exception.py \
>         evemu/event_names.py # generated!
>
> +nobase_python_PYTHON = $(python_sources)
> +
>  test_sources = \
>                evemu/testing/__init__.py \
>                evemu/testing/mocker.py \
> @@ -52,4 +54,12 @@ $(builddir)/evemu/event_names.py: Makefile $(srcdir)/evemu/make-event-names.py
>
>  BUILT_SOURCES = evemu-test-runner $(builddir)/evemu/event_names.py
>  EXTRA_DIST =  evemu-test-runner.in $(test_sources) $(srcdir)/evemu/make-event-names.py
> -CLEANFILES = $(BUILT_SOURCES)
> +
> +python3_pyc = \
> +               evemu/__pycache__/ \
> +               evemu/testing/__pycache__ \
> +               evemu/tests/__pycache
> +
> +python2_pyc = $(test_sources:.py=.pyc) $(python_sources:.py=.pyc)
> +
> +CLEANFILES = $(BUILT_SOURCES) $(python2_pyc) $(python3_pyc)
> --
> 1.9.3
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list