This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Showing
14 changed files
with
192 additions
and
20 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 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,43 @@ | ||
# built-in | ||
from argparse import ArgumentParser | ||
|
||
# app | ||
from ..actions import get_package, make_json | ||
from ..config import builders | ||
from ..repositories import WareHouseRepo | ||
from .base import BaseCommand | ||
|
||
|
||
class PackageReleasesCommand(BaseCommand): | ||
"""Show package releases. | ||
https://dephell.readthedocs.io/en/latest/cmd-package-releases.html | ||
""" | ||
@classmethod | ||
def get_parser(cls) -> ArgumentParser: | ||
parser = ArgumentParser( | ||
prog='dephell package releases', | ||
description=cls.__doc__, | ||
) | ||
builders.build_config(parser) | ||
builders.build_output(parser) | ||
builders.build_api(parser) | ||
builders.build_other(parser) | ||
parser.add_argument('name', help='package name') | ||
return parser | ||
|
||
def __call__(self) -> bool: | ||
dep = get_package(self.args.name) | ||
repo = WareHouseRepo() | ||
releases = repo.get_releases(dep) | ||
|
||
data = [] | ||
for release in releases: | ||
data.append(dict( | ||
date=str(release.time.date()), | ||
version=str(release.version), | ||
python=str(release.python) if release.python else '*', | ||
)) | ||
|
||
print(make_json(data=data, key=self.config.get('filter'))) | ||
return True |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# built-in | ||
from io import open | ||
from os import path | ||
|
||
# external | ||
from setuptools import setup | ||
|
||
|
||
here = path.abspath(path.dirname(__file__)) | ||
with open(path.join(here, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
|
||
# TODO: more info | ||
|
||
setup( | ||
name='dephell', | ||
version='0.2.0', | ||
description='Dependency resolution for Python', | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/orsinium/dephell', | ||
author='orsinium', | ||
|
||
packages=['dephell'], | ||
install_requires=[ | ||
'attrs', | ||
'cached_property', | ||
'packaging', | ||
'requests', | ||
], | ||
entry_points={ | ||
'console_scripts': ['dephell = dephell.cli:main'], | ||
}, | ||
) |