python: setup.py: how NOT to install C extensions used only by tests

2022-11-30 Thread Bartosz Golaszewski
kages argument. Even though none of the python sources from the tests/ directory gets installed when running setup.py install, the extension binary (and nothing else) is installed into site-packages/tests/. How can I prohibit setuptools from doing it? Best Regards, Bartosz Golaszewski -- https://mai

Re: Defining a Python enum in a C extension - am I doing this right?

2021-08-08 Thread Bartosz Golaszewski
On Fri, Aug 6, 2021 at 9:02 PM Serhiy Storchaka wrote: > > 03.08.21 13:03, Bartosz Golaszewski пише: > > Just a follow-up: this is how I did it eventually: > > I think it can be simpler. > > 1. No need to create the __main__ module. You can just create a dict. If > s

Re: Defining a Python enum in a C extension - am I doing this right?

2021-08-03 Thread Bartosz Golaszewski
On Sat, Jul 31, 2021 at 3:01 PM Bartosz Golaszewski wrote: > > On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > > > 23.07.21 11:20, Bartosz Golaszewski пише: > > > I'm working on a Python C extension and I would like to expose a > > > cu

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-31 Thread Bartosz Golaszewski
On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > 23.07.21 11:20, Bartosz Golaszewski пише: > > I'm working on a Python C extension and I would like to expose a > > custom enum (as in: a class inheriting from enum.Enum) that would be > > entirely defined in

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-26 Thread Bartosz Golaszewski
On Sat, Jul 24, 2021 at 6:55 AM Dan Stromberg wrote: > > > On Fri, Jul 23, 2021 at 1:20 AM Bartosz Golaszewski wrote: >> >> Hi! >> >> I'm working on a Python C extension and I would like to expose a >> custom enum (as in: a class inheriting from enum.

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
On Fri, Jul 23, 2021 at 5:08 PM MRAB wrote: > > On 2021-07-23 09:20, Bartosz Golaszewski wrote: > > Hi! > > > > I'm working on a Python C extension and I would like to expose a > > custom enum (as in: a class inheriting from enum.Enum) that would be > >

Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
thod directly to create a correct classdict and then I call the PyType_Type object too to create the sub-type. This works and AFAICT results in a class that behaves exactly as expected, but... am I doing this right? Any feedback is appreciated. I want to use this in a real project, namely the v2 of l

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-24 13:30 GMT+02:00 Bartosz Golaszewski : > 2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski : >> 2018-07-23 21:51 GMT+02:00 Thomas Jollans : >>> On 23/07/18 20:02, Bartosz Golaszewski wrote: >>>> Hi! >>> >>> Hey! >>> >>>> A

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski : > 2018-07-23 21:51 GMT+02:00 Thomas Jollans : >> On 23/07/18 20:02, Bartosz Golaszewski wrote: >>> Hi! >> >> Hey! >> >>> A user recently reported a memory leak in python bindings (C extension >>&g

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-24 Thread Bartosz Golaszewski
2018-07-23 21:51 GMT+02:00 Thomas Jollans : > On 23/07/18 20:02, Bartosz Golaszewski wrote: >> Hi! > > Hey! > >> A user recently reported a memory leak in python bindings (C extension >> module) to a C library[1] I wrote. I've been trying to fix it since >&

Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-23 Thread Bartosz Golaszewski
== 432' but the breakpoint was never triggered. I tried the same for PyObject_Malloc and still nothing. How do I use the info produced by PYTHONMALLOCSTATS do get to the culprit of the leak? Is there anything wrong in my reasoning here? Best regards, Bartosz Golaszewski [1] https://git.ke