Skip to content

Commit

Permalink
Support installing dependencies from pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Feb 5, 2024
1 parent 1cd67b2 commit f3d4777
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions req_update/python.py
Expand Up @@ -198,6 +198,16 @@ def write_dependency_update_lines(
def install_updates(self) -> None:
"""Install requirements updates"""
for updated_file in self.updated_files:
command = ['pip', 'install', '-r', updated_file]
self.util.execute_shell(command, False)
if updated_file in REQUIREMENTS_FILES:
command = ['pip', 'install', '-r', updated_file]
self.util.execute_shell(command, False)
elif updated_file in PYPROJECT_FILES:
command = ['pip', 'install', '-e', '.']
self.util.execute_shell(command, False)
with open('pyproject.toml', 'rb') as handle:
data = tomllib.load(handle)
optionals = data['project']['optional-dependencies'].keys()
for optional in optionals:
command = ['pip', 'install', '-e', '.[%s]' % optional]
self.util.execute_shell(command, False)
self.util.log('Installing updated packages in %s' % updated_file)

0 comments on commit f3d4777

Please sign in to comment.