mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-04 01:15:41 +02:00
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>
22 lines
487 B
Python
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']})
|