Skip to content

Commit

Permalink
Do not use pathlib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Clary committed Apr 6, 2022
1 parent a1c0a2c commit b980ccd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions py2app/recipes/black.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import os
from pkg_resources import get_distribution
from pathlib import Path


def check(cmd, mf):
m = mf.findNode("black")
if m is None or m.filename is None:
return None

egg = Path(get_distribution('black').egg_info)
top = egg / 'top_level.txt'
egg = get_distribution('black').egg_info
top = os.path.join(egg, 'top_level.txt')

# These cannot be in zip
packages = ["black", "blib2to3"]

# black may include optimized platform specific C extension which has
# unusual name, e.g. 610faff656c4cfcbb4a3__mypyc; best to determine it from
# the egg-info/top_level.txt
includes = set(top.read_text().strip().split('\n'))
with open(top, 'r') as f:
includes = set(f.read().strip().split('\n'))
includes = list(includes.difference(packages))

# Missed dependency
Expand Down

0 comments on commit b980ccd

Please sign in to comment.