Py2app - Filename too long

Recently tried to build a standalone app using PyQT5, ran into the issue of a recursive file name. The filename under the build directory keeps piling up. The build quits with an error "Filename too long"

So the fix was to not have the build and dist directories where the actual package code is i.e. it shouldn't be at the same level where file resides.

Here's a post detailing this:

So here's the final package hierarchy:

-- Directory
  -- SubDirectory
  -- dist
  -- build

The dist and build need to be outside. The code in the answer, is correct. I am copying it here so it's easy to understand what the file looks like:

    "py2app": {
         "bdist_base": os.path.join(str(Path(os.get_cwd()).parent), 'build'),
         "dist_dir": os.path.join(str(Path(os.get_cwd()).parent), 'dist'),

This should eliminate that particular error. Happy coding.