Quero criar um comando no terminal linux eu criei um programa simples ( atualizar a distro linux ) com Python e publiquei na PyPI mas quanto e baixei e digitei o nome dele não foi executado pior disse que não existia um comando com esse nome fiz várias tentativas e não consegui.
Queria que executasse como estivesse no meu ambiente mas não está funcionando.
main do programa:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from subprocess import check_output, call
def process():
print('UPDATE')
update = check_output('sudo apt update', shell=True)
call('clear', shell=True)
print('UPGRADE')
upgrade = check_output('sudo apt upgrade', shell=True)
call('clear', shell=True)
if (update or upgrade == True):
call('clear', shell=True)
print('Your system is up to date')
else:
call('clear', shell=True)
print('Erro')
process()
setup.py:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
import os
import re
with open('README.md', 'rb') as f:
readme = f.read().decode('utf-8')
with open(os.path.join('__init__.py'), 'rb') as f:
init_py = f.read().decode('utf-8')
version = re.search(
'^__version__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
author = re.search(
'^__author__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
email = re.search(
'^__email__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
setup(
name='upug',
packages=find_packages(),
version=version,
description='Update linux systems',
long_description=readme,
long_description_content_type="text/markdown",
author=author,
author_email=email,
url='https://github.com/ward910/UpUg',
install_requires=[],
license='MIT',
keywords=['GNU/linux', 'linux', 'python3'],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
],
)