-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update project and automatic dependency management
- Loading branch information
1 parent
fc04547
commit 0f47890
Showing
13 changed files
with
263 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# imports - module imports | ||
from pipupgrade.__attr__ import ( | ||
__name__, | ||
__version__ | ||
) | ||
from pipupgrade.__main__ import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# imports - module imports | ||
from pipupgrade.model.project import Project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# imports - standard imports | ||
import os.path as osp | ||
import glob | ||
|
||
class Project: | ||
def __init__(self, path): | ||
path = osp.realpath(path) | ||
|
||
if not osp.exists(path): | ||
raise ValueError("Path %s does not exist." % path) | ||
|
||
self.path = path | ||
self.requirements = self._get_requirements() | ||
|
||
def _get_requirements(self): | ||
# COLLECT ALL THE REQUIREMENTS FILES! | ||
path = self.path | ||
requirements = [ ] | ||
|
||
# Detect Requirements Files | ||
# Check requirements*.txt files in current directory. | ||
for requirement in glob.glob(osp.join(path, "requirements*.txt")): | ||
requirements.append(requirement) | ||
|
||
# Check if requirements is a directory | ||
if osp.isdir(osp.join(path, "requirements")): | ||
for requirement in glob.glob(osp.join(path, "requirements", "*.txt")): | ||
requirements.append(requirement) | ||
|
||
return requirements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.