[PATCH v3 4/4] .gitignore: ignore Python compiled bytecode

Mauro Carvalho Chehab posted 4 patches 7 months, 4 weeks ago
There is a newer version of this series
[PATCH v3 4/4] .gitignore: ignore Python compiled bytecode
Posted by Mauro Carvalho Chehab 7 months, 4 weeks ago
While the building system doesn't create any Python JIT bytecode,
if one manually runs kernel-doc.py or get_abi.py, Python will,
by default, create a bytecode and store it under scripts/lib/*.

This is normal, and not controlled by the Kernel itself. So,
add *.pyc as an extension to be ignored.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index f2f63e47fb88..2e01bc0b2d2a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,6 +39,7 @@
 *.mod.c
 *.o
 *.o.*
+*.pyc
 *.patch
 *.rmeta
 *.rpm
-- 
2.49.0
Re: [PATCH v3 4/4] .gitignore: ignore Python compiled bytecode
Posted by Miguel Ojeda 7 months, 4 weeks ago
On Sat, Apr 19, 2025 at 1:50 AM Mauro Carvalho Chehab
<mchehab+huawei@kernel.org> wrote:
>
> +*.pyc
>  *.patch

I think the list is intended to be sorted.

Should `*.pyo` be added as well?

Thanks!

Cheers,
Miguel
Re: [PATCH v3 4/4] .gitignore: ignore Python compiled bytecode
Posted by Andy Shevchenko 7 months, 4 weeks ago
On Sat, Apr 19, 2025 at 11:17:33AM +0200, Miguel Ojeda wrote:
> On Sat, Apr 19, 2025 at 1:50 AM Mauro Carvalho Chehab
> <mchehab+huawei@kernel.org> wrote:
> >
> > +*.pyc
> >  *.patch
> 
> I think the list is intended to be sorted.

+1, I told already twice, I dunno if my messages were seen.

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v3 4/4] .gitignore: ignore Python compiled bytecode
Posted by Miguel Ojeda 7 months, 4 weeks ago
On Sat, Apr 19, 2025 at 11:17 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Should `*.pyo` be added as well?

I think this one is a no, given even oldoldstable Debian ships new
enough Python.

Cheers,
Miguel