Python 2.7 via Homebrew

I missed the memo, but back in January Homebrew announced that as of version 1.5, python would be upgraded to use Python 3.x. This change went live on March 1, and I noticed it over the weekend while tinkering with Homebridge.

While I was rebuilding Homebridge with the latest version of Node.js, I kept banging into node-gyp errors having to do with using Python 3.x. I’m not alone, though there is already a pull request to fix this issue.

For the time being, I’ve made two changes to please node-gyp:

  1. Forced a link of the new python@2 keg1:

    brew link python@2 -f
  2. Added the following to my ~/.bash_profile, so that python will point at python2:

    export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"

I think I’ll revert the second change once the node-gyp issue is resolved, to begin forcing myself to use Python 3.x.


Yesterday, I lamented the limitations of BBEdit’s Dropbox sync:

I wish there was a way to sync language-specific settings for BBEdit via Dropbox.

Specifically, I wanted to sync my soft-wrap settings for Markdown files. My main need for this is in editing the text files that drive this blog1. Yes, this is a trivial problem; it’s one checkbox in BBEdit’s Preferences Pane. It would be easy to recreate on both of my computers. It would be easier still if the preference would sync.

@daiwei replied on with an interesting idea:

If you know where the settings you want to synchronise are stored, simply copy that file(s) to where you want them on Dropbox, and symlink it/them?

I haven’t tried this, and I’m afraid of what might happen if I were to have BBEdit open on both computers at the same time. Maybe I’d just end up with conflicted copy files from Dropbox, but BBEdit’s release notes specifically call this out as unsupported:

The system does not support relocation of the core preferences data file (~/Library/Preferences/com.barebones.bbedit.plist), so you won’t be able to synchronize preference settings.

The BBEdit support team replied to me on Twitter, and offered a solution I was completely unfamiliar with:

Apparently, BBEdit natively supports EditorConfig files. EditorConfig files are used to enforce consistent configurations across editors for a given project, and they’re fairly widely supported. While soft-wrap settings aren’t part of the core properties, BBEdit has defined BBEdit-specific keys, including x-soft-wrap-text, x-soft-wrap-mode, and x-soft-wrap-limit.

Based on this, I created an .editorconfig file in the root directory of the files for this blog, that only contains one key:

# EditorConfig is awesome:

# top-most EditorConfig file
root = true

# Soft-wrap every markdown file (in BBEdit only)
x-soft-wrap-text: 1

Now, if I ever forget to enable soft-wrap as a language-specific setting in BBEdit on a new machine, this file will override the global setting and enable soft-wrapping. I’ll still have to deal with this for files in other directories, but this will cover 90% of my use cases.

  1. I’m still publishing this site using Dr. Drang’s WP-MD tools.