Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve argument parsing, fix style #3

Merged
merged 35 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3f8f8c3
style: Move dictionary of commands into global scope
jcfr Feb 1, 2017
6ab010e
style: Change handle_http_error into a decorator
jcfr Feb 1, 2017
2d47a82
Add backward compatible support for argument parsing. See #2
jcfr Feb 1, 2017
a5a1da7
style: Use "print()" function
jcfr Feb 1, 2017
cbeb5c4
style: Introduce flake8 settings and fix style
jcfr Feb 1, 2017
17969dc
style: Update .gitignore to exclude .idea
jcfr Feb 2, 2017
f552a6e
style: README: Fix typo upload url
jcfr Feb 2, 2017
2f87c6f
style: README: Format commands and filenames using fixed font
jcfr Feb 2, 2017
29af5ae
Add support for GITHUB_TOKEN in addition of netrc setting file
jcfr Feb 2, 2017
1fbd978
Add support for single command-line supporting both "release" and "as…
jcfr Feb 2, 2017
bb65a29
release_create: Gracefully terminate if release already exists
jcfr Feb 2, 2017
988f1e6
asset_upload: Display a message if no file matching 'pattern' was found
jcfr Feb 2, 2017
6a6d561
style: Associate command parameter descriptions with type
jcfr Feb 2, 2017
27c6010
release_create: Support optional parameter "--publish"
jcfr Feb 2, 2017
62e1dfe
release_create: Support optional parameter "--prerelease"
jcfr Feb 9, 2017
c6de401
parser: Add support for parameter with dashes
jcfr Feb 9, 2017
ff8bdb7
asset_upload, asset_erase: Add support for "--dry-run" optional param…
jcfr Feb 9, 2017
75aa1d9
asset_erase: Add support for optional argument "--keep-pattern"
jcfr Feb 9, 2017
0c5fdf4
print_release_info: Display "prerelease" status
jcfr Feb 9, 2017
b491397
gh_release_publish/unpublish: Support additional parameter "--prerele…
jcfr Feb 9, 2017
6f00274
gh_release_create: Support optional parameter "target_commitish"
jcfr Feb 9, 2017
1d42bfe
parser: Add support for setting default parameter values
jcfr Feb 9, 2017
461436d
Add support for release "edit"
jcfr Feb 9, 2017
fae3ab1
Add support for listing/creating/deleting references
jcfr Feb 9, 2017
84ad574
gh_release_delete: Support pattern, keep_pattern, dry_run and verbose…
jcfr Feb 9, 2017
133448e
gh_asset_erase: Tweak function description
jcfr Feb 9, 2017
d95bfa0
style: Refactor code introducing "_gh_parse_arguments" function
jcfr Feb 9, 2017
82a034c
style: Add comments to separate group of functions
jcfr Feb 9, 2017
54bce9b
style: Update "gh_release_edit" to print summary of changes
jcfr Feb 10, 2017
678d4ce
gh_release_edit: Support updates of tag_name and target_commitish
jcfr Feb 10, 2017
85a3397
gh_release_edit: Support "dry-run" parameter
jcfr Feb 10, 2017
dc0a70b
style: Introduce GITHUB_API global variable
jcfr Feb 10, 2017
13e3d36
style: Set "upload_url" from release metadata returned GitHub
jcfr Feb 10, 2017
32c4b15
style: Move release/asset/reference print functions in their own group
jcfr Feb 10, 2017
bd546a2
style: Fix indent and set line-length back to 80
jcfr Feb 10, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
max-line-length: 80
# Whether to display the pep8 instructions on failure (can be quite verbose)
show-pep8: False
# Whether to show source code for each failure
show-source: True
# Maximum cyclomatic complexity allowed
max-complexity: 14
format: pylint
exclude: .git,.idea,.eggs,__pycache__,.tox
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Python
env
build
dist
*.egg-info
*.pyc

# IDE junk
.idea/*
*.swp
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,38 @@ Done!

## configuring

Generate a new token in [application settings][1]. It should have the repo scope.
First, [generate a new token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). It should have
the repo scope.

Put the key in ~/.netrc, which should have mode 0600 (`-rw-------`):
Then, there are two options:

* Set the `GITHUB_TOKEN` environment variable:

```bash
export GITHUB_TOKEN=...
/path/to/command

# or

GITHUB_TOKEN=... /path/to/command
```


* Put the key in `~/.netrc`, which should have mode 0600 (`-rw-------`):

```
machine api.github.com
login [TOKEN]
password x-oauth-basic

machine upload.github.com
machine uploads.github.com
login [TOKEN]
password x-oauth-basic
```

Done!

[1]: https://github.com/settings/applications

## installed scripts

The package installs two scripts, github-release and github-asset
The package installs two scripts, `github-release` and `github-asset`

### github-release

Expand Down Expand Up @@ -94,5 +105,3 @@ $ github-asset octocat/example-project download 1.4
$ # download all files from example-project
# github-asset octocat/example-project download
```


Loading