Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 10/03/2021 20:57, Mats Wichmann wrote: On 3/10/21 11:56 AM, Thomas Jollans wrote: On 10/03/2021 18:42, Marco Sulla wrote: On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: Why are you doing this? If all you want is for it to be possible to install the package from source on a system tha

Re: How to create both a c extension and a pure python package

2021-03-10 Thread MichaƂ Jaworski
I was dealing with a very similar problem a long time ago. I wanted to provide built wheels of my Cython extension for various OSes (Windows, macOS, Linux) and various Python versions (from 2.7 up to 3.9) but I also wanted to have a sdist package for all the variations that I didn't cover at the ti

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Mats Wichmann
On 3/10/21 11:56 AM, Thomas Jollans wrote: On 10/03/2021 18:42, Marco Sulla wrote: On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: Why are you doing this? If all you want is for it to be possible to install the package from source on a system that can't use the C part, you could just decl

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 10/03/2021 18:42, Marco Sulla wrote: On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: Why are you doing this? If all you want is for it to be possible to install the package from source on a system that can't use the C part, you could just declare your extension modules optional Because

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Marco Sulla
On Wed, 10 Mar 2021 at 16:45, Thomas Jollans wrote: > Why are you doing this? > > If all you want is for it to be possible to install the package from > source on a system that can't use the C part, you could just declare > your extension modules optional Because I want to provide (at least) two

Re: How to create both a c extension and a pure python package

2021-03-10 Thread Thomas Jollans
On 09/03/2021 23:42, Marco Sulla wrote: As title. Currently I ended up using this trick in my setup.py: if len(argv) > 1 and argv[1] == "c": sys.argv = [sys.argv[0]] + sys.argv[2:] setuptools.setup(ext_modules = ext_modules, **common_setup_args) else: setuptools.setup(**common_se

How to create both a c extension and a pure python package

2021-03-09 Thread Marco Sulla
As title. Currently I ended up using this trick in my setup.py: if len(argv) > 1 and argv[1] == "c": sys.argv = [sys.argv[0]] + sys.argv[2:] setuptools.setup(ext_modules = ext_modules, **common_setup_args) else: setuptools.setup(**common_setup_args) So if I pass "c" as the first arg