cygclass python-wheel setup.cfg-only projects
Libor Ukropec
ace@seznam.cz
Tue Dec 6 00:20:43 GMT 2022
Dne 04.12.2022 v 15:55 Jon Turney via Cygwin-apps napsal(a):
> On 02/12/2022 12:10, Jon Turney wrote:
>> On 01/12/2022 22:20, Libor Ukropec wrote:
>>> Hello,
>>>
>>> I have question to cygclass python-wheel. It seems that setup.py is being omited in
>>> some python packages (here I faced it in the python-fasteners) and as described here:
>>> https://setuptools.pypa.io/en/latest/setuptools.html , chapter "setup.cfg-only projects"
>>>
>>> > If setup.py is missing from the project directory when a PEP 517 build is invoked,
>>> > setuptools emulates a dummy setup.py file containing only a setuptools.setup() call.
>>>
>>> Currently the cyglass requires the setup.py being present, otherwise it throws error
>>> "No Python Distutils module detected"
>>>
>>> IMHO would be nice if the cygclass handle this case. Or should I create a patch that
>>> inserts empty setup.py module instead?
>>
>> Yeah, it seems this is definitely something that needs updating in cygport, so thanks
>> for pointing that out.
>>
>> It's fairly straightforward to drop the check at [1], or perhaps it's more appropriate
>> to change it to check for either setup.py or setup.cfg?
>>
>> But then we want to run 'python -msetuptools.launch setup.py bdist_wheel' to build the
>> wheel.
>>
>> In a very quick bit of research, it' seems the modern equivalent would be something like
>> 'python -m build --wheel', but we don't seem to have a python-build package?
>
> The other alternative seems to be 'pip wheel'
>
> Attached is a cygport patch which uses that for the setup.py-less case.
>
> (possibly we could use it in all cases, but I'm being conservative with this change)
>
>> I'm not very familiar with the evolving state of python packaging, so I think I may need
>> a bit of help getting this right!
Hi Jon,
definitely you did not need a help - I did a test on python-fasteners
before your patch:
$ cygport python-fasteners.cygport download all check
*** Warning: LICENSE not defined
>>> Preparing python-fasteners-0.17.3-1.noarch
>>> Unpacking source 0.17.3.tar.gz
>>> Preparing working source directory
>>> Compiling python-fasteners-0.17.3-1.noarch
*** ERROR: No Python Distutils module detected
applying your patch, all works fine:
[...]
>>> Creating source patches
0 files changed
>>> Creating source package
python-fasteners-0.17.3-1.src/
python-fasteners-0.17.3-1.src/0.17.3.tar.gz
python-fasteners-0.17.3-1.src/python-fasteners.cygport
>>> python36-fasteners requires: python36
>>> python37-fasteners requires: python37
>>> python38-fasteners requires: python38
>>> python39-fasteners requires: python39
>>> python3-fasteners requires: python39-fasteners
>>> Testing python-fasteners-0.17.3-1.noarch
*** Info: No testsuite detected.
Success :)
So I confirm it works at least for this one use case.
Regards,
Libor
More information about the Cygwin-apps
mailing list