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

System sass #219

Merged
merged 14 commits into from Oct 11, 2017
Merged

System sass #219

merged 14 commits into from Oct 11, 2017

Conversation

ghost
Copy link

@ghost ghost commented Sep 22, 2017

This PR implements solution for using system-installed libsass library to build the python sass extension.
This will help to get rid of some hacks/downstream-patches in Fedora and other distributions' packaging.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still hesitant on taking something like this:

  • It complicates our (already significantly complicated!) setup.py
  • It is not a pathway we want to support as version mismatches cause lots of problems (and libsass itself is quite the moving target).

setup.py Outdated
@@ -141,14 +147,26 @@ def restore_cencode():
else:
link_flags = ['-fPIC', '-lstdc++']

if system_sass:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of three if system_sass: blocks, can you combine these?

setup.py Outdated
@@ -14,55 +14,60 @@

from setuptools import Extension, setup

LIBSASS_SOURCE_DIR = os.path.join('libsass', 'src')
system_sass = os.environ.get('SYSTEMSASS', False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like SYSTEMS ASS to me :), how about SYSTEM_SASS?

@asottile asottile dismissed their stale review September 25, 2017 14:46

This looks fine to me, curious to see what @dahlia says

@dahlia
Copy link
Member

dahlia commented Sep 25, 2017

It looks good to me. It's okay to merge if the builds succeed.

setup.py Outdated
@@ -149,9 +149,9 @@ def customize_compiler(compiler):
flags.append('-mmacosx-version-min=10.7',)
if tuple(
map(int, platform.mac_ver()[0].split('.'))
) >= (10, 9):
) >= (10, 9):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the correct response to this lint is to indent the map line by one more space instead of the paren

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or save width a simpler and cleaner way:

                  macver = tuple(map(int, platform.mac_ver()[0].split('.')))
                  if macver >= (10, 9):

setup.py Outdated
@@ -148,8 +148,8 @@ def customize_compiler(compiler):
if platform.system() == 'Darwin':
flags.append('-mmacosx-version-min=10.7',)
if tuple(
map(int, platform.mac_ver()[0].split('.'))
) >= (10, 9):
map(int, platform.mac_ver()[0].split('.'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be indented 8 more spaces

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.python.org/dev/peps/pep-0008/#indentation

notably the part where it says:
"More indentation included to distinguish this from the rest."

@asottile asottile merged commit bcdafc3 into sass:master Oct 11, 2017
@asottile
Copy link
Member

Thanks!

@asottile
Copy link
Member

This has been released as part of 0.13.3!

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

Successfully merging this pull request may close these issues.

None yet

3 participants