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

Add pep8, pyflakes, unit and integration tests to setup.py #26

Merged
merged 13 commits into from
Dec 3, 2013
Merged

Add pep8, pyflakes, unit and integration tests to setup.py #26

merged 13 commits into from
Dec 3, 2013

Conversation

diranged
Copy link
Contributor

Bump nd_service_registry to 0.3.0a1. Adds the following cleanup items:

  1. Pep8, Pyflakes, Unit and Integration Tests to setup.py
  2. Documentation cleanup
  3. Make TravisCI execute pep8, pyflakes and unit tests through setup.py
  4. Document how to use Vagrant to run integration tests

@diranged
Copy link
Contributor Author

The pep8/pyflakes requirements are put into requirements.test.txt in https://github.com/diranged/ndserviceregistry/commit/2a6772d9eae5054772f4015f75f5782fc3257fbd

No need to do the 'i for i in ...' code since
readlines() already returns a list.
@mrterry
Copy link
Contributor

mrterry commented Nov 30, 2013

looks good to me.

@diranged
Copy link
Contributor Author

diranged commented Dec 1, 2013

Last bugfix.. this fixes the final package so its actually installable.

Matts-MacBook-Pro:ndserviceregistry-diranged diranged$ python setup.py clean sdist
running clean
running sdist
running check
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'extras'
writing manifest file 'MANIFEST'
creating nd_service_registry-0.3.0a1
creating nd_service_registry-0.3.0a1/nd_service_registry
creating nd_service_registry-0.3.0a1/nd_service_registry/bin
creating nd_service_registry-0.3.0a1/nd_service_registry/bin/ndsr
making hard links in nd_service_registry-0.3.0a1...
hard linking README -> nd_service_registry-0.3.0a1
hard linking README.rst -> nd_service_registry-0.3.0a1
hard linking requirements.test.txt -> nd_service_registry-0.3.0a1
hard linking requirements.txt -> nd_service_registry-0.3.0a1
hard linking setup.py -> nd_service_registry-0.3.0a1
hard linking nd_service_registry/__init__.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/exceptions.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/funcs.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/funcs_tests.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/lock.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/lock_integration.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/registration.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/shims.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/version.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/watcher.py -> nd_service_registry-0.3.0a1/nd_service_registry
hard linking nd_service_registry/bin/__init__.py -> nd_service_registry-0.3.0a1/nd_service_registry/bin
hard linking nd_service_registry/bin/ndsr/__init__.py -> nd_service_registry-0.3.0a1/nd_service_registry/bin/ndsr
hard linking nd_service_registry/bin/ndsr/get.py -> nd_service_registry-0.3.0a1/nd_service_registry/bin/ndsr
hard linking nd_service_registry/bin/ndsr/get_tests.py -> nd_service_registry-0.3.0a1/nd_service_registry/bin/ndsr
hard linking nd_service_registry/bin/ndsr/ndsr.py -> nd_service_registry-0.3.0a1/nd_service_registry/bin/ndsr
creating dist
Creating tar archive
removing 'nd_service_registry-0.3.0a1' (and everything under it)

Matts-MacBook-Pro:ndserviceregistry-diranged diranged$ sudo pip install dist/nd_service_registry-0.3.0a1.tar.gz
Unpacking ./dist/nd_service_registry-0.3.0a1.tar.gz
  Running setup.py egg_info for package from file:///Users/diranged/git/ndserviceregistry-diranged/dist/nd_service_registry-0.3.0a1.tar.gz

Requirement already satisfied (use --upgrade to upgrade): kazoo>=1.1 in /Library/Python/2.7/site-packages (from nd-service-registry==0.3.0a1)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Library/Python/2.7/site-packages/setuptools-1.4.1-py2.7.egg (from nd-service-registry==0.3.0a1)
Requirement already satisfied (use --upgrade to upgrade): python-gflags in /Users/diranged/Library/Python/2.7/lib/python/site-packages (from nd-service-registry==0.3.0a1)
Requirement already satisfied (use --upgrade to upgrade): pyyaml in /Library/Python/2.7/site-packages (from nd-service-registry==0.3.0a1)
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.8.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from kazoo>=1.1->nd-service-registry==0.3.0a1)
Installing collected packages: nd-service-registry
  Running setup.py install for nd-service-registry

    Installing ndsr script to /usr/local/bin
Successfully installed nd-service-registry
Cleaning up...

Matts-MacBook-Pro:ndserviceregistry-diranged diranged$ ndsr
2013-12-01 10:05:24,666 - nd_service_registry.bin.ndsr.ndsr - INFO - Connecting to server localhost:2181
2013-12-01 10:05:24,666 - nd_service_registry - INFO - Initializing ServiceRegistry object
2013-12-01 10:05:24,666 - nd_service_registry - INFO - Connecting to Zookeeper Service (localhost:2181)
2013-12-01 10:05:24,668 - kazoo.client - WARNING - Connection dropped: socket connection error: Connection refused
2013-12-01 10:05:25,476 - kazoo.client - WARNING - Connection dropped: socket connection error: Connection refused

@@ -90,7 +90,7 @@ def decode(data):
elif s.startswith('{') and s.endswith('}'):
try:
data = json.loads(s)
except Exception, e:
except Exception:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little wary when I see statement like except Exception:
We should be more specific on what exception to accept.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spoke to Matt about this. He is going to insert the TODO to work on that on later days.
Once that's done, this change is approved.

diranged added a commit that referenced this pull request Dec 3, 2013
Add pep8, pyflakes, unit and integration tests to setup.py

(Approved by @dfujiwara)
@diranged diranged merged commit bcbb9c6 into Nextdoor:master Dec 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants