ionelmc / cookiecutter-pylibrary

Enhanced cookiecutter template for Python libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

c_extensions

joaomcteixeira opened this issue · comments

Hello @ionelmc

First of all thanks very much for all your effort to assemble this template and the associated blog posts.

I am trying your implementations because I am new to packaging, though I've been coding for a while I never actually operated a CI environment nor distributed a package as such.

While running the cookiecutter I found these options to request information for c_extensions while the option 'no' was selected for related options. I do not understand the whole of what is going on, but from the first sight I found strange querying for c_ related info when all the flags were set to false. May be you want to revisit this to make sure it has the behavior you desire.

My apologies for the poor issue description, I really cant go further at this point of knowledge :P

Select c_extension_support:
1 - no
2 - yes
3 - cffi
4 - cython
Choose from 1, 2, 3, 4 (1, 2, 3, 4) [1]: 
Select c_extension_optional:
1 - no
2 - yes
Choose from 1, 2 (1, 2) [1]: 
c_extension_module [_theproject]: 
c_extension_function [longest]: 
Select c_extension_test_pypi:
1 - no
2 - yes
Choose from 1, 2 (1, 2) [1]: 
c_extension_test_pypi_username [joaomcteixeira]: 

Unfortunately this is a limitation in cookiecutter - there's no way to hide options or have something like a wizzard. This is why many options in pylibrary have same prefix - so you know that if you select "no" for the first one the rest are irrelevant. Perhaps I could outline this somehow in the readme?

I understand, indeed the expected behavior would be that of a wizard.
You do have already some related outlines in the README, if you feel this can be further specified and elucidated with some small sentence, I am sure the community will really appreciate.
Thank you!

I guess one thing we could do for string asks would be to make the default option be "IGNORE THIS" if the previous selection indicates a given option is irrelevant.

    "c_extension_test_pypi_username": "{{ cookiecutter.repo_username if cookiecutter.c_extension_support != 'no' and cookiecutter.c_extension_test_pypi != 'no' else 'IGNORE THIS, THIS IS ONLY FOR C EXTENSIONS' }}",

Don't know what we could do with a binary choice like c_extension_test_pypi itself, though.

c_extension_test_* options are gone. They have been replaced with github actions producing and an artifacts.zip with all the wheels.