diff --git a/CHANGELOG.md b/CHANGELOG.md index 9087db2..12233c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.1.2 (2020-8-14) + +* Fixed the script's entrypoint (PyPi installs work again) + ## 2.1.1 (2020-07-14) * Fixed the long argument names which had underscores intead of hyphens diff --git a/README.md b/README.md index b17afe0..02951bc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A powerful script to concurrently clone your entire GitHub instance or save it a [![Pypi](https://img.shields.io/pypi/v/github-archive)](https://pypi.org/project/github-archive) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) - +Showcase @@ -62,7 +62,7 @@ Basic Usage: Advanced Usage: GITHUB_ARCHIVE_TOKEN=123... GITHUB_ARCHIVE_ORGS="org1, org2" GITHUB_ARCHIVE_LOCATION="~/custom_location" \ - github_archive -uc -up -gc -gp -oc -op -b develop + github-archive -uc -up -gc -gp -oc -op -b develop Options: -uc, --user-clone Clone personal repos (default: on) diff --git a/githubarchive/__init__.py b/githubarchive/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/githubarchive/github_archive.py b/githubarchive/github_archive.py index 0727aa9..7cfb704 100644 --- a/githubarchive/github_archive.py +++ b/githubarchive/github_archive.py @@ -11,25 +11,54 @@ class Archive(): - """All GitHub Archive methods""" - # Setup arguments + """All GitHub Archive methods + """ parser = argparse.ArgumentParser( - description='A powerful script to concurrently clone your entire' + - 'GitHub instance or save it as an archive.') - parser.add_argument('-uc', '--user-clone', action='store_true', - help='Clone personal repos.') - parser.add_argument('-up', '--user-pull', action='store_true', - help='Pull personal repos') - parser.add_argument('-gc', '--gists-clone', action='store_true', - help='Clone personal gists') - parser.add_argument('-gp', '--gists-pull', action='store_true', - help='Pull personal gists.') - parser.add_argument('-oc', '--orgs-clone', action='store_true', - help='Clone organization repos.') - parser.add_argument('-op', '--orgs-pull', action='store_true', - help='Pull organization repos.') - parser.add_argument('-b', '--branch', default='master', - help='Which branch to pull from.') + description=('A powerful script to concurrently clone your entire' + ' GitHub instance or save it as an archive.') + ) + parser.add_argument( + '-uc', + '--user-clone', + action='store_true', + help='Clone personal repos.', + ) + parser.add_argument( + '-up', + '--user-pull', + action='store_true', + help='Pull personal repos', + ) + parser.add_argument( + '-gc', + '--gists-clone', + action='store_true', + help='Clone personal gists', + ) + parser.add_argument( + '-gp', + '--gists-pull', + action='store_true', + help='Pull personal gists.', + ) + parser.add_argument( + '-oc', + '--orgs-clone', + action='store_true', + help='Clone organization repos.', + ) + parser.add_argument( + '-op', + '--orgs-pull', + action='store_true', + help='Pull organization repos.', + ) + parser.add_argument( + '-b', + '--branch', + default='master', + help='Which branch to pull from.', + ) args = parser.parse_args() # Environment variables @@ -37,7 +66,8 @@ class Archive(): ORG_LIST = os.getenv('GITHUB_ARCHIVE_ORGS', '') ORGS = ORG_LIST.split(', ') LOCATION = os.path.expanduser( - os.getenv('GITHUB_ARCHIVE_LOCATION', '~/github-archive')) + os.getenv('GITHUB_ARCHIVE_LOCATION', '~/github-archive') + ) # Reusable variables USER = Github(TOKEN) @@ -50,7 +80,8 @@ class Archive(): @classmethod def clone_repos(cls, repo, path): - """Clone repos that don't exist""" + """Clone repos that don't exist + """ if not os.path.exists(path): try: git = subprocess.check_output( @@ -73,7 +104,8 @@ def clone_repos(cls, repo, path): @classmethod def pull_repos(cls, repo, path): - """Pull changes for projects that are cloned""" + """Pull changes for projects that are cloned + """ try: git = subprocess.check_output( f'cd {path} && git pull --ff-only', @@ -90,7 +122,8 @@ def pull_repos(cls, repo, path): @classmethod def clone_gists(cls, gist, path): - """Clone gists""" + """Clone gists + """ if not os.path.exists(os.path.join(Archive.LOCATION, 'gists')): os.makedirs(os.path.join(Archive.LOCATION, 'gists')) if not os.path.exists(path): @@ -114,7 +147,8 @@ def clone_gists(cls, gist, path): @classmethod def pull_gists(cls, gist, path): - """Pull Gists""" + """Pull Gists + """ if not os.path.exists(os.path.join(Archive.LOCATION, 'gists')): os.makedirs(os.path.join(Archive.LOCATION, 'gists')) try: @@ -133,7 +167,8 @@ def pull_gists(cls, gist, path): @classmethod def logs(cls, data): - """Write output to a log""" + """Write output to a log + """ if not os.path.exists(Archive.LOG_PATH): os.makedirs(Archive.LOG_PATH) with open(Archive.LOG_FILE, 'a') as log: @@ -141,7 +176,8 @@ def logs(cls, data): def main(): - """Run the based on configuration script""" + """Run the based on configuration script + """ if not os.path.exists(Archive.LOCATION): os.makedirs(Archive.LOCATION) if not Archive.TOKEN: diff --git a/setup.py b/setup.py index ab9073c..b4c269a 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name='github-archive', - version='2.1.1', + version='2.1.2', description='A powerful script to concurrently clone your entire GitHub instance or save it as an archive.', long_description=long_description, long_description_content_type="text/markdown", @@ -31,7 +31,7 @@ }, entry_points={ 'console_scripts': [ - 'github_archive=githubarchive.github_archive:main' + 'github-archive=githubarchive.github_archive:main' ] }, python_requires='>=3.6',