-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cbad20
commit bcb45a2
Showing
9 changed files
with
89 additions
and
99 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
This file was deleted.
Oops, something went wrong.
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,14 +1,33 @@ | ||
import click | ||
import pkg_resources | ||
|
||
from . import _version | ||
from .commands import command_functions | ||
|
||
|
||
@click.group() | ||
@click.version_option(version=_version.get_versions()["version"]) | ||
def main() -> None: | ||
pass | ||
package_distribution = pkg_resources.get_distribution("rembg") | ||
|
||
for extra in package_distribution.extras: | ||
if extra == "cli": | ||
requirements = package_distribution.requires(extras=(extra,)) | ||
for requirement in requirements: | ||
try: | ||
pkg_resources.require(requirement.project_name) | ||
except pkg_resources.DistributionNotFound: | ||
print(f"Missing dependency: '{requirement.project_name}'") | ||
print( | ||
"Please, install rembg with the cli feature: pip install rembg[cli]" | ||
) | ||
exit(1) | ||
|
||
import click | ||
|
||
from . import _version | ||
from .commands import command_functions | ||
|
||
@click.group() | ||
@click.version_option(version=_version.get_versions()["version"]) | ||
def _main() -> None: | ||
pass | ||
|
||
for command in command_functions: | ||
_main.add_command(command) | ||
|
||
for command in command_functions: | ||
main.add_command(command) | ||
_main() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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