Skip to content

Commit

Permalink
Merge pull request #4 from alfonsocv12/fix/errorRequirements.txt
Browse files Browse the repository at this point in the history
Fix/error requirements.txt
  • Loading branch information
alfonsocv12 authored May 11, 2021
2 parents 965a5b6 + 1ce8e4c commit a648883
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mmp/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__='0.0.4a'
__version__='0.0.5a'
4 changes: 3 additions & 1 deletion mmp/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def __update_requirements(self, name: str, version=None, remove=False):
'''
Function dedicated to update requirements.txt with the new lib
'''
name = name.lower().strip(' ')
requirements = open('requirements.txt', 'r+')
requirements_read: list = requirements.readlines()
if remove:
Expand All @@ -244,8 +245,9 @@ def __update_requirements(self, name: str, version=None, remove=False):
f'{name}=={version}\n'
)
requirements_write = ''.join(sorted(requirements_read))
requirements.truncate(0)
requirements.seek(0)
requirements.write(requirements_write)
requirements.truncate()
requirements.close()

def __check_lib_installed(self, lib_name: str):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='mmp',
version='0.0.4',
version='0.0.5',
authro='Alfonso Villaobos',
author_email='[email protected]',
url='https://github.com/alfonsocv12/mmp',
Expand Down

0 comments on commit a648883

Please sign in to comment.