Skip to content

Commit

Permalink
generate_release: avoid removing dist-info dirs
Browse files Browse the repository at this point in the history
Avoid removing dist-info directories so fake-useragent can start, since
the module will call importlib.metadata on init.

Also use HEAD instead of master during archive copying step to allow
generate_release.py to run on branch other than master.
  • Loading branch information
alive4ever committed Nov 5, 2024
1 parent a20db73 commit 5276825
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def wine_run(command_parts):
# confused with working directory. I'm calling it the same thing so it will
# have that name when extracted from the final release zip archive)
log('Making copy of youtube-local files')
check(os.system('git archive --format tar master | 7z x -si -ttar -oyoutube-local'))
check(os.system('git archive --format tar HEAD | 7z x -si -ttar -oyoutube-local'))

if len(os.listdir('./youtube-local')) == 0:
raise Exception('Failed to copy youtube-local files')
Expand Down Expand Up @@ -217,10 +217,10 @@ def wine_run(command_parts):
log('Removing pyc files') # Have to do this because get-pip and some packages don't respect --no-compile
remove_files_with_extensions(r'./python', ['.pyc'])

log('Removing dist-info and __pycache__')
log('Removing __pycache__')
for root, dirs, files in os.walk(r'./python'):
for dir in dirs:
if dir == '__pycache__' or dir.endswith('.dist-info'):
if dir == '__pycache__':
shutil.rmtree(os.path.join(root, dir))


Expand Down

0 comments on commit 5276825

Please sign in to comment.