diff mbox series

[v6,23/25] python: add .gitignore

Message ID 20210512231241.2816122-24-jsnow@redhat.com (mailing list archive)
State New, archived
Headers show
Series python: create installable package | expand

Commit Message

John Snow May 12, 2021, 11:12 p.m. UTC
Ignore *Python* build and package output (build, dist, qemu.egg-info);
these files are not created as part of a QEMU build.

Ignore miscellaneous cached python confetti (__pycache__, *.pyc,
.mypy_cache).

Ignore .idea (pycharm) .vscode, and .venv (pipenv et al).

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/.gitignore | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 python/.gitignore

Comments

Cleber Rosa May 25, 2021, 7:36 p.m. UTC | #1
On Wed, May 12, 2021 at 07:12:39PM -0400, John Snow wrote:
> Ignore *Python* build and package output (build, dist, qemu.egg-info);
> these files are not created as part of a QEMU build.
> 
> Ignore miscellaneous cached python confetti (__pycache__, *.pyc,
> .mypy_cache).
> 
> Ignore .idea (pycharm) .vscode, and .venv (pipenv et al).
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/.gitignore | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 python/.gitignore
> 
> diff --git a/python/.gitignore b/python/.gitignore
> new file mode 100644
> index 00000000000..e27c99e009c
> --- /dev/null
> +++ b/python/.gitignore
> @@ -0,0 +1,19 @@
> +# python bytecode cache
> +*.pyc

This is a duplicate from the parent .gitignore, so I would avoid it.

> +__pycache__/

And this one is interesting because, the only thing that *should* be
in __pycache__ dirs is .pyc files (covered by the parent .gitignore
file).

So, I get the same behavior without these two entries here, so I would
skip them.  Let me know if you have any reason for explicitly
including them.

- Cleber.
John Snow May 25, 2021, 8:10 p.m. UTC | #2
On 5/25/21 3:36 PM, Cleber Rosa wrote:
> On Wed, May 12, 2021 at 07:12:39PM -0400, John Snow wrote:
>> Ignore *Python* build and package output (build, dist, qemu.egg-info);
>> these files are not created as part of a QEMU build.
>>
>> Ignore miscellaneous cached python confetti (__pycache__, *.pyc,
>> .mypy_cache).
>>
>> Ignore .idea (pycharm) .vscode, and .venv (pipenv et al).
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>   python/.gitignore | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>   create mode 100644 python/.gitignore
>>
>> diff --git a/python/.gitignore b/python/.gitignore
>> new file mode 100644
>> index 00000000000..e27c99e009c
>> --- /dev/null
>> +++ b/python/.gitignore
>> @@ -0,0 +1,19 @@
>> +# python bytecode cache
>> +*.pyc
> 
> This is a duplicate from the parent .gitignore, so I would avoid it.
> 
>> +__pycache__/
> 
> And this one is interesting because, the only thing that *should* be
> in __pycache__ dirs is .pyc files (covered by the parent .gitignore
> file).
> 
> So, I get the same behavior without these two entries here, so I would
> skip them.  Let me know if you have any reason for explicitly
> including them.
> 
> - Cleber.
> 

Hm, not really ... Just completeness, I suppose, since this directory is 
becoming increasingly separate from the rest of the tree.

It isn't crucial, it just seemed like a weird omission if they weren't 
listed here. *shrug*

--js
Cleber Rosa May 25, 2021, 8:42 p.m. UTC | #3
On Tue, May 25, 2021 at 04:10:55PM -0400, John Snow wrote:
> On 5/25/21 3:36 PM, Cleber Rosa wrote:
> > On Wed, May 12, 2021 at 07:12:39PM -0400, John Snow wrote:
> > > Ignore *Python* build and package output (build, dist, qemu.egg-info);
> > > these files are not created as part of a QEMU build.
> > > 
> > > Ignore miscellaneous cached python confetti (__pycache__, *.pyc,
> > > .mypy_cache).
> > > 
> > > Ignore .idea (pycharm) .vscode, and .venv (pipenv et al).
> > > 
> > > Signed-off-by: John Snow <jsnow@redhat.com>
> > > ---
> > >   python/.gitignore | 19 +++++++++++++++++++
> > >   1 file changed, 19 insertions(+)
> > >   create mode 100644 python/.gitignore
> > > 
> > > diff --git a/python/.gitignore b/python/.gitignore
> > > new file mode 100644
> > > index 00000000000..e27c99e009c
> > > --- /dev/null
> > > +++ b/python/.gitignore
> > > @@ -0,0 +1,19 @@
> > > +# python bytecode cache
> > > +*.pyc
> > 
> > This is a duplicate from the parent .gitignore, so I would avoid it.
> > 
> > > +__pycache__/
> > 
> > And this one is interesting because, the only thing that *should* be
> > in __pycache__ dirs is .pyc files (covered by the parent .gitignore
> > file).
> > 
> > So, I get the same behavior without these two entries here, so I would
> > skip them.  Let me know if you have any reason for explicitly
> > including them.
> > 
> > - Cleber.
> > 
> 
> Hm, not really ... Just completeness, I suppose, since this directory is
> becoming increasingly separate from the rest of the tree.
> 
> It isn't crucial, it just seemed like a weird omission if they weren't
> listed here. *shrug*
> 
> --js

And still, this dir is part of the overall tree.  Honestly, without
any change in behavior, I'd *not* add those two ignore rules.

Cheers,
- Cleber.
John Snow May 25, 2021, 11:54 p.m. UTC | #4
On 5/25/21 4:42 PM, Cleber Rosa wrote:
> On Tue, May 25, 2021 at 04:10:55PM -0400, John Snow wrote:
>> On 5/25/21 3:36 PM, Cleber Rosa wrote:
>>> On Wed, May 12, 2021 at 07:12:39PM -0400, John Snow wrote:
>>>> Ignore *Python* build and package output (build, dist, qemu.egg-info);
>>>> these files are not created as part of a QEMU build.
>>>>
>>>> Ignore miscellaneous cached python confetti (__pycache__, *.pyc,
>>>> .mypy_cache).
>>>>
>>>> Ignore .idea (pycharm) .vscode, and .venv (pipenv et al).
>>>>
>>>> Signed-off-by: John Snow <jsnow@redhat.com>
>>>> ---
>>>>    python/.gitignore | 19 +++++++++++++++++++
>>>>    1 file changed, 19 insertions(+)
>>>>    create mode 100644 python/.gitignore
>>>>
>>>> diff --git a/python/.gitignore b/python/.gitignore
>>>> new file mode 100644
>>>> index 00000000000..e27c99e009c
>>>> --- /dev/null
>>>> +++ b/python/.gitignore
>>>> @@ -0,0 +1,19 @@
>>>> +# python bytecode cache
>>>> +*.pyc
>>>
>>> This is a duplicate from the parent .gitignore, so I would avoid it.
>>>
>>>> +__pycache__/
>>>
>>> And this one is interesting because, the only thing that *should* be
>>> in __pycache__ dirs is .pyc files (covered by the parent .gitignore
>>> file).
>>>
>>> So, I get the same behavior without these two entries here, so I would
>>> skip them.  Let me know if you have any reason for explicitly
>>> including them.
>>>
>>> - Cleber.
>>>
>>
>> Hm, not really ... Just completeness, I suppose, since this directory is
>> becoming increasingly separate from the rest of the tree.
>>
>> It isn't crucial, it just seemed like a weird omission if they weren't
>> listed here. *shrug*
>>
>> --js
> 
> And still, this dir is part of the overall tree.

For now 
diff mbox series

Patch

diff --git a/python/.gitignore b/python/.gitignore
new file mode 100644
index 00000000000..e27c99e009c
--- /dev/null
+++ b/python/.gitignore
@@ -0,0 +1,19 @@ 
+# python bytecode cache
+*.pyc
+__pycache__/
+
+# linter/tooling cache
+.mypy_cache/
+.cache/
+
+# python packaging
+build/
+dist/
+qemu.egg-info/
+
+# editor config
+.idea/
+.vscode/
+
+# virtual environments (pipenv et al)
+.venv/