Skip to content

Formatting Not Working - M1 Macs (darwin/arm64) Unsupported #95

Description

@JHumphreyJr

For M1 Macs, the issue is the new Darwin architecture is missing. The architecture directory on this repository has not been updated in 7 years so I will also include a workaround:

  1. Run pip3 install pyastyle in your favorite pyenv. I have not confirmed the compatibility between the latest version of pyastyle and the one used in this 7 year old library so YMMV.
  2. Open the plugin's pyastyle directory:
    open "~/Library/Application Support/Sublime Text/Packages/SublimeAStyleFormatter/pyastyle/python3"
    
  3. Create a new directory named _darwin.
  4. Create an empty __init__.py in the new _darwin directory.
  5. Link or Copy & Rename the darwin binary installed in step 1 to _darwin with the name pyastyle.so. If you pip3 installed this globally, this might be located in a path similar to: ~/Library/Python/3.8/lib/python/site-packages/pyastyle.cpython-38-darwin.so
  6. Modify "~/Library/Application Support/Sublime Text/Packages/SublimeAStyleFormatter/pyastyle/python3/__init__.py" to only include the following:
    try:
        from ._darwin.pyastyle import *
        platform = "MacOS X Darwin"
    except ImportError:
        raise ImportError("Could not find a suitable pyastyle binary for your platform and architecture.")
    

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions