mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
Adjust setup procedure
This commit is contained in:
parent
49364ce95c
commit
ffa403b9dd
53
setup.py
53
setup.py
@ -23,6 +23,27 @@ with open('requirements.txt') as requirements_file:
|
|||||||
with open('dev-requirements.txt') as dev_requirements_file:
|
with open('dev-requirements.txt') as dev_requirements_file:
|
||||||
dev_requirements = [req for req in dev_requirements_file.readlines()]
|
dev_requirements = [req for req in dev_requirements_file.readlines()]
|
||||||
|
|
||||||
|
pipcommand = "sudo pip3 install --upgrade"
|
||||||
|
pipcommand += " --force-reinstall"
|
||||||
|
pipcommand += " git+https://github.com/sopel-irc/sopel@master"
|
||||||
|
|
||||||
|
print('Running {} '.format(pipcommand), file=sys.stderr)
|
||||||
|
for line in os.popen(pipcommand).read().split('\n'):
|
||||||
|
print(line, file=sys.stderr)
|
||||||
|
|
||||||
|
import sopel
|
||||||
|
|
||||||
|
# Remove stock modules, if present
|
||||||
|
main_sopel_dir = os.path.dirname(os.path.abspath(sopel.__file__))
|
||||||
|
modules_dir = os.path.join(main_sopel_dir, 'modules')
|
||||||
|
stockdir = os.path.join(modules_dir, "stock")
|
||||||
|
if not os.path.exists(stockdir) or not os.path.isdir(stockdir):
|
||||||
|
os.system("sudo mkdir " + stockdir)
|
||||||
|
for pathname in os.listdir(modules_dir):
|
||||||
|
path = os.path.join(modules_dir, pathname)
|
||||||
|
if (os.path.isfile(path) and path.endswith('.py') and not path.startswith('_')):
|
||||||
|
os.system("sudo mv " + path + " " + stockdir)
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='sopel_modules.SpiceBot',
|
name='sopel_modules.SpiceBot',
|
||||||
@ -40,35 +61,3 @@ setup(
|
|||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
license='Eiffel Forum License, version 2',
|
license='Eiffel Forum License, version 2',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def stock_modules_begone():
|
|
||||||
|
|
||||||
import sopel
|
|
||||||
|
|
||||||
# Remove stock modules, if present
|
|
||||||
main_sopel_dir = os.path.dirname(os.path.abspath(sopel.__file__))
|
|
||||||
modules_dir = os.path.join(main_sopel_dir, 'modules')
|
|
||||||
stockdir = os.path.join(modules_dir, "stock")
|
|
||||||
if not os.path.exists(stockdir) or not os.path.isdir(stockdir):
|
|
||||||
os.system("sudo mkdir " + stockdir)
|
|
||||||
for pathname in os.listdir(modules_dir):
|
|
||||||
path = os.path.join(modules_dir, pathname)
|
|
||||||
if (os.path.isfile(path) and path.endswith('.py') and not path.startswith('_')):
|
|
||||||
os.system("sudo mv " + path + " " + stockdir)
|
|
||||||
|
|
||||||
|
|
||||||
def sopel_master_install():
|
|
||||||
|
|
||||||
pipcommand = "sudo pip3 install --upgrade"
|
|
||||||
pipcommand += " --force-reinstall"
|
|
||||||
pipcommand += " git+https://github.com/sopel-irc/sopel@master"
|
|
||||||
|
|
||||||
print('Running {} '.format(pipcommand), file=sys.stderr)
|
|
||||||
for line in os.popen(pipcommand).read().split('\n'):
|
|
||||||
print(line, file=sys.stderr)
|
|
||||||
|
|
||||||
stock_modules_begone()
|
|
||||||
|
|
||||||
|
|
||||||
sopel_master_install()
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user