git-filter-repo/release/setup.py
Benjamin Motz 4ff15cd422 Use setup.py entry_points for installation
This should make the installation via pip more robust.

On Windows the usage of entry_points will install a wrapper executable
for the script that chooses the proper python executable. This
essentially makes the script run correctly when called via `git
filter-repo` (direct execution via `git-filter-repo` was already fine
before).

This fixes an issue on Windows, where the git-installation will choose a
different python executable than the one indicated by the installation
via `pip{x,3} install`.

Signed-off-by: Benjamin Motz <benjamin.motz@mailbox.org>
2021-06-10 18:33:26 +02:00

22 lines
487 B
Python

from setuptools import setup
import os
def link_parent(src, target=None):
if target is None:
target = src
try:
os.symlink(os.path.join("..", src), target)
except FileExistsError:
pass
for f in ['git-filter-repo', 'README.md']:
link_parent(f)
link_parent('git-filter-repo', 'git_filter_repo.py')
setup(use_scm_version=dict(root="..", relative_to=__file__),
entry_points={'console_scripts': ['git-filter-repo = git_filter_repo:main']})