fix pip cli finally?

master
Laura Liberda 2020-12-04 01:09:25 +01:00
parent 357d20d99e
commit 3b6c51200d
3 changed files with 25 additions and 5 deletions

6
bin/librefi Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python
import librefi
if __name__ == '__main__':
librefi.main()

View File

@ -27,5 +27,4 @@ def main(argv=None):
__all__ = [
'LibreFi',
'main',
'_real_main',
]

View File

@ -6,7 +6,13 @@ import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
try:
from setuptools import setup, Command
setuptools_available = True
except ImportError:
from distutils.core import setup, Command
setuptools_available = False
NAME = 'librefi'
DESCRIPTION = 'LibreFi logs into public Wi-Fis without user interaction. Just access the network!'
@ -35,6 +41,12 @@ try:
except FileNotFoundError:
long_description = DESCRIPTION
params = {}
if setuptools_available:
params['entry_points'] = {'console_scripts': ['librefi = librefi:main']}
else:
params['scripts'] = ['bin/librefi']
class UploadCommand(Command):
"""Support setup.py upload."""
@ -84,10 +96,12 @@ setup(
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=[
'librefi',
'librefi.connectors',
'librefi.fxckers',
],
py_modules=['librefi'],
entry_points={
'console_scripts': ['librefi=librefi:main'],
},
install_requires=REQUIRED,
extras_require=EXTRAS,
include_package_data=True,
@ -112,4 +126,5 @@ setup(
cmdclass={
'upload': UploadCommand,
},
**params,
)