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>pull/217/head
parent
7ceb213f04
commit
4ff15cd422
@ -1,8 +1,21 @@
|
||||
from setuptools import setup
|
||||
import os
|
||||
for f in ['git-filter-repo', 'git_filter_repo.py', 'README.md']:
|
||||
|
||||
|
||||
def link_parent(src, target=None):
|
||||
if target is None:
|
||||
target = src
|
||||
try:
|
||||
os.symlink("../"+f, f)
|
||||
os.symlink(os.path.join("..", src), target)
|
||||
except FileExistsError:
|
||||
pass
|
||||
setup(use_scm_version=dict(root="..", relative_to=__file__))
|
||||
|
||||
|
||||
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']})
|
||||
|
Loading…
Reference in New Issue