Pebaz / nimporter

Compile Nim Extensions for Python On Import!
MIT License
829 stars 33 forks source link

Is `cookiecutter` needed at runtime by end-users? #85

Closed daylinmorgan closed 1 year ago

daylinmorgan commented 1 year ago

Is your feature request related to a problem? Please describe.

Cookiecutter doesn't seem to be needed at runtime.

Describe the solution you'd like

Use an extras dependency (i.e. pip install "nimporter[cli]") in pyproject.toml for library authors to access the functionality.

Describe alternatives you've considered

Alternative is leaving it as is which means extra dependencies for end-users. Though maybe there is some component outside the CLI that requires cookiecutter I'm missing.

Additional context

There is a non-trivial list of cookiecutter dependencies:

cookiecutter 2.1.1 A command-line utility that creates projects from project templates, e.g. creating a Python package project from a Python package project template.
├── binaryornot >=0.4.4
│   └── chardet >=3.0.2
├── click >=7.0,<9.0.0
│   ├── colorama *
│   └── importlib-metadata *
│       ├── typing-extensions >=3.6.4
│       └── zipp >=0.5
├── jinja2 >=2.7,<4.0.0
│   └── markupsafe >=2.0
├── jinja2-time >=0.2.0
│   ├── arrow *
│   │   ├── python-dateutil >=2.7.0
│   │   │   └── six >=1.5
│   │   └── typing-extensions *
│   └── jinja2 *
│       └── markupsafe >=2.0
├── python-slugify >=4.0.0
│   └── text-unidecode >=1.3
├── pyyaml >=5.3.1
└── requests >=2.23.0
    ├── certifi >=2017.4.17
    ├── charset-normalizer >=2,<4
    ├── idna >=2.5,<4
    └── urllib3 >=1.21.1,<1.27

Keeping nimporter deps slim may be inline with library authors wanting lightweight extension modules.

Thanks for the awesome work melding python and nim!

Pebaz commented 1 year ago

@SekouDiaoNlp this seems reasonable. If you have time, could you look into making this optional?

SekouDiaoNlp commented 1 year ago

@SekouDiaoNlp this seems reasonable. If you have time, could you look into making this optional?

Hey @Pebaz what's up? Yes it is indded reasonable, didn't realize cookiecutter was so fat lol.

I can look into it tomorrow.

Fyi, I setup a windows box on aws this weekend and will be able to investigate the windows build issue.

Cheers.

SekouDiaoNlp commented 1 year ago

Hi @daylinmorgan.

Thank you for reaching out and suggesting to move cookiecutter to an optional dependency.

The changes have been pushed to the version 2.0.0rc branch.

The stock install via pip install nimporter now leaves out cookie cutter and library authors can install the extra dependencies via pip install nimporter[cli].

Thanks again for your suggestion.

Cheers,

@SekouDiaoNlp.

daylinmorgan commented 1 year ago

Great! Thanks for taking care of this so quickly. I'll be sure to use the rc branch while exploring integrating it in my projects to see if I come across any other issues.