bitly / bitly-api-python

python library to the bitly api
http://github.com/bitly/bitly-api-python
Other
244 stars 92 forks source link

Username/AccessToken provided via Environment variables #13

Closed ianozsvald closed 11 years ago

ianozsvald commented 11 years ago

Username and AccessToken are imported using environment variables. If they're missing then a useful error is raised. README updated to explain how to set this up, doc added in test_bitly_api.py to explain how to run the test.

One test changed in test_bitly_api as the 'test1' key is a valid bitly key, maybe this entered the keyspace? I've added a longer random string, I don't know if this keeps the same meaning to the test (this needs validation).

jehiah commented 11 years ago

awesome. changes look good.

before merging, we prefer to squash changes down to a single commit. Would you mind doing that here?

ianozsvald commented 11 years ago

You're welcome to try on my behalf, this is beyond my git-fu. I tried this https://github.com/ginatrapani/todo.txt-touch/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit and now I have HEAD, develop and two other branches, all in broken states. You're welcome to take my changes and merge them under your own user if that's easier.

jehiah commented 11 years ago

sorry, yeah, squashing is annoying sometimes.

The workflow I normally use to squash is

# add bitly as a remote (if you don't have it already)
$ git remote add bitly https://github.com/bitly/bitly-api-python.git
$ git fetch bitly
# interactive rebase; leaving the first commit with 'pick' and switching the rest to 'squash'
$ git rebase --interactive bitly/master

Then after a successful squash, it obviously requires a force push up to github because history has changed.

If you want to try again after restting hard to your remote (git reset --hard origin/master) go ahead, otherwise i'll be happy to push a squashed commit to your branch and we can close this out.

ianozsvald commented 11 years ago

Ok, I tried: $ mv bitly-api-python bitly-api-python-bitbarfed # push old out of the way $ git clone git@github.com:ianozsvald/bitly-api-python.git # get fresh copy $ git rebase -i HEAD~5 # following https://github.com/ginatrapani/todo.txt-touch/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit pick 499454a testExpand required a new key (test1 existed in bitly)\, all 4 methods now use get_connection to fetch user credentials from environment variables squash aeb9e42 updated doc to include notes on running the tests squash 090bff9 updated doc to include notes on running the tests squash b7a2db4 removed unnecessary username squash 6dd6a47 pep8 pedantry I changed the last 4 from 'pick' to 'squash' $ $ git push origin master --force # force it up (I missed this step before)

It looks like it works, please confirm?

jehiah commented 11 years ago

that did it. thanks for the contribution!