Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation fails when c extensions unvailable #4

Closed
michael-basil opened this issue Mar 7, 2016 · 6 comments
Closed

installation fails when c extensions unvailable #4

michael-basil opened this issue Mar 7, 2016 · 6 comments

Comments

@michael-basil
Copy link

Can the setup.py be adjusted to fallback to a python only install? Similar to how simplejson does it:

https://github.com/simplejson/simplejson/blob/master/setup.py

@ndparker
Copy link
Owner

ndparker commented Mar 9, 2016

I think, having a clear error is actually better. You should be able to disable the compilation with the --without-c-extensions argument to setup.py install.

@michael-basil
Copy link
Author

That solution doesn't work well. I'm forced to call out the use of rjsmin and rcssmin (instead of respecting the natural dependency chain) because they require special handling. It makes our Kudo auto deployment scripts brittle and hard (for anyone else in my organization) to maintain.

A reasonable alternate solution would be to provide the wheels if this type of hard error approach is desired.

Quite frankly, it does not work well on the Azure App Service whereas every other dependency of wagtail / django / django-compressor work fine. Microsoft is (now) making a concerted effort to support and empower open source initiatives. Meeting them halfway would seem appropriate.

mb

@ndparker
Copy link
Owner

ndparker commented Mar 9, 2016

I'll think about turning the option around (i.e. provide a force option that fails).

However, I'm not really getting, what that means, what you said. First I don't know, what kudo is. And second: how can someone support and empower open source and not provide a compiler for that source? Apparently I'm missing something here.

@michael-basil
Copy link
Author

Sorry about that ... let me take a step back.

Here's some info on Kudu: https://github.com/projectkudu/kudu

Regarding Microsoft ... they're making sure all the Azure and AD libraries are supported in Python (by them). They are have also re-written .Net, IIS, Windows Server (Nano), and SQL Server (supports Linux). They now support the Linux community as a first class citizen (it was hard for me to believe this at first, but after a couple of years I'm convinced).

The top level leadership has changed, though I understand that information has not permeated throughout the technology community yet. Read about the CTO of Azure (Mark Russinovich) and you'll get an idea about what I'm talking about.

Microsoft does provide free compilers. However, the Azure App Service (Kudu) does not include it in it's runtime environment. As their PaaS environment moves to Windows Server 2016 (IIS via container) I imagine things getting lighter, not heavier, so I'm not sure it will exist there in the long term either.

I'm a NoOps / DevOps / Cloud Architect ... so when I have to do thinks like the following in a deploy script it makes me nervous for maintainability.

env\scripts\pip install rjsmin --upgrade --install-option="--without-c-extensions"
env\scripts\pip install rcssmin --upgrade --install-option="--without-c-extensions"
env\scripts\pip install -r requirements.txt --upgrade

Maybe I"m missing something, but we had a vendor (developer) lose several days messing around with requirements.txt to no avail. Developers tend not to want to admit failure, so they kept this information from us until it was getting very late in the project. I've observed this behavior numerous times over the years when there is too much complexity involved in a setup.

This is how a requirements file should look (in my opinion):

Django>=1.8,<1.9
wagtail>=1.3,<1.4

I shouldn't need to know that Django depends on django-compressor, and django-compressor 2.0 moved from cssmin to rcssmin which doesn't have a Windows 32 wheel and no fallback ... even though at runtime it would work. The reality is that the average developer loses time trying to pick this apart. See what I mean?

mb

@MMeent
Copy link

MMeent commented Sep 23, 2016

I recently started a project using django-compressor too, and using 2 installs of requirements-files seems to do the trick:

# requirements-windows.txt
rcssmin --install-option="--without-c-extensions"
rcjsmin --install-option="--without-c-extensions"

# requirements.txt
... the rest

The problem here is that the package(s, if rjsmin is included) requires special attention upon usage, which is annoying, and that we have to rely on undocumented behavior (pip doesn't officially support the --install-option-flag.

If you (the author) could fix this issue by setting the --without-c-extentions flag as a default install option on windows, then that'd be very nice.

@ndparker
Copy link
Owner

Fixed (controlled by env now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants