You've already forked httpie-cli
							
							
				mirror of
				https://github.com/httpie/cli.git
				synced 2025-10-30 23:47:52 +02:00 
			
		
		
		
	Added wheel support
Should make installation via pip work on OSX Mavericks (#148). Also added a nifty Makefile.
This commit is contained in:
		| @@ -5,10 +5,8 @@ python: | |||||||
|   - 2.7 |   - 2.7 | ||||||
|   - pypy |   - pypy | ||||||
|   - 3.3 |   - 3.3 | ||||||
| install: |  | ||||||
|   - pip install pytest pytest-cov python-coveralls --use-mirrors |  | ||||||
|   - pip install . --use-mirrors |  | ||||||
| script: | script: | ||||||
|   - py.test --cov ./httpie --cov ./tests --doctest-modules --verbose ./httpie ./tests |   - make | ||||||
| after_success: | after_success: | ||||||
|  |   - pip install python-coveralls | ||||||
|   - coveralls |   - coveralls | ||||||
|   | |||||||
| @@ -38,12 +38,9 @@ Development Environment | |||||||
|  |  | ||||||
|     # (Recommended: create a new virtualenv) |     # (Recommended: create a new virtualenv) | ||||||
|  |  | ||||||
|     # Install dev. requirements: |     # Install dev. requirements and also HTTPie (in editable mode | ||||||
|     pip install -r requirements-dev.txt |     # so that the `http' command will point to your working copy): | ||||||
|  |     make | ||||||
|     # Install HTTPie in editable mode |  | ||||||
|     # (the `http' command will point to your working copy): |  | ||||||
|     pip install --upgrade --force-reinstall --editable . |  | ||||||
|  |  | ||||||
|  |  | ||||||
| Making Changes | Making Changes | ||||||
| @@ -66,10 +63,13 @@ HTTPie uses `pytest`_ and `Tox`_. | |||||||
|     ### Running all tests: |     ### Running all tests: | ||||||
|  |  | ||||||
|     # Current Python |     # Current Python | ||||||
|     python setup.py test |     make test | ||||||
|  |  | ||||||
|     # All the supported and available  Pythons |     # Current Python with coverage | ||||||
|     tox |     make test-cover | ||||||
|  |  | ||||||
|  |     # All the supported and available Pythons via Tox | ||||||
|  |     make test-tox | ||||||
|  |  | ||||||
|     ### Running specific tests: |     ### Running specific tests: | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										67
									
								
								MakeFile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								MakeFile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,67 @@ | |||||||
|  | VERSION=$(shell grep __version__ httpie/__init__.py) | ||||||
|  | REQUIREMENTS="requirements-dev.txt" | ||||||
|  | TAG="\n\n\033[0;32m\#\#\# " | ||||||
|  | END=" \#\#\# \033[0m\n" | ||||||
|  |  | ||||||
|  | all: test | ||||||
|  |  | ||||||
|  | uninstall-httpie: | ||||||
|  | 	@echo $(TAG)Removing existing installation of HTTPie$(END) | ||||||
|  | 	- pip uninstall --yes httpie >/dev/null | ||||||
|  | 	! which http | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | uninstall-all: uninstall-httpie | ||||||
|  | 	- pip uninstall --yes -r $(REQUIREMENTS) | ||||||
|  |  | ||||||
|  | init: uninstall-httpie | ||||||
|  | 	@echo $(TAG)Installing dev requirements$(END) | ||||||
|  | 	pip install --upgrade -r $(REQUIREMENTS) | ||||||
|  | 	@echo $(TAG)Installing HTTPie$(END) | ||||||
|  | 	pip install --upgrade --editable . | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | test: init | ||||||
|  | 	@echo $(TAG)Running tests in on current Python in parallel and with coverage $(END) | ||||||
|  | 	py.test --cov ./httpie --cov ./tests -n 8 --doctest-modules --verbose ./httpie ./tests | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | test-tox: init | ||||||
|  | 	@echo $(TAG)Running tests on all Pythons via Tox$(END) | ||||||
|  | 	tox | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | test-dist: test-sdist test-bdist-wheel | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | test-sdist: clean uninstall-httpie | ||||||
|  | 	@echo $(TAG)Testing sdist build an installation$(END) | ||||||
|  | 	python setup.py sdist | ||||||
|  | 	pip install --force-reinstall --upgrade dist/*.gz | ||||||
|  | 	which http | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | test-bdist-wheel: clean uninstall-httpie | ||||||
|  | 	@echo $(TAG)Testing wheel build an installation$(END) | ||||||
|  | 	python setup.py bdist_wheel | ||||||
|  | 	pip install --force-reinstall --upgrade dist/*.whl | ||||||
|  | 	which http | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | # This tests everything, even this Makefile. | ||||||
|  | test-all: uninstall-all clean init test test-tox test-dist | ||||||
|  |  | ||||||
|  | publish: test-all | ||||||
|  | 	@echo $(TAG)Testing wheel build an installation$(END) | ||||||
|  | 	@echo "$(VERSION)" | ||||||
|  | 	@echo "$(VERSION)" | grep -q "dev"  && echo "!!!Not publishing dev version!!!" && exit 1 | ||||||
|  | 	python setup.py register | ||||||
|  | 	python setup.py sdist upload | ||||||
|  | 	python setup.py bdist_wheel upload | ||||||
|  | 	@echo | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	@echo $(TAG)Cleaning up$(END) | ||||||
|  | 	rm -rf .tox *.egg dist build .coverage | ||||||
|  | 	find . -name '__pycache__' -delete -print -o -name '*.pyc' -delete -print | ||||||
|  | 	@echo | ||||||
| @@ -1,4 +1,5 @@ | |||||||
| tox | tox | ||||||
| pytest | pytest | ||||||
| pytest-xdist | pytest-xdist | ||||||
|  | pytest-cov | ||||||
| docutils | docutils | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								setup.py
									
									
									
									
									
								
							| @@ -1,12 +1,14 @@ | |||||||
| import sys | import sys | ||||||
| import codecs | import codecs | ||||||
| from setuptools import setup | from setuptools import setup, find_packages | ||||||
| from setuptools.command.test import test as TestCommand | from setuptools.command.test import test as TestCommand | ||||||
|  |  | ||||||
| import httpie | import httpie | ||||||
|  |  | ||||||
|  |  | ||||||
| class PyTest(TestCommand): | class PyTest(TestCommand): | ||||||
|  |     # `$ python setup.py test' simply installs minimal requirements | ||||||
|  |     # and runs the tests with no fancy stuff like parallel execution. | ||||||
|     def finalize_options(self): |     def finalize_options(self): | ||||||
|         TestCommand.finalize_options(self) |         TestCommand.finalize_options(self) | ||||||
|         self.test_suite = True |         self.test_suite = True | ||||||
| @@ -45,7 +47,6 @@ def long_description(): | |||||||
|     with codecs.open('README.rst', encoding='utf8') as f: |     with codecs.open('README.rst', encoding='utf8') as f: | ||||||
|         return f.read() |         return f.read() | ||||||
|  |  | ||||||
|  |  | ||||||
| setup( | setup( | ||||||
|     name='httpie', |     name='httpie', | ||||||
|     version=httpie.__version__, |     version=httpie.__version__, | ||||||
| @@ -56,7 +57,7 @@ setup( | |||||||
|     author=httpie.__author__, |     author=httpie.__author__, | ||||||
|     author_email='jakub@roztocil.name', |     author_email='jakub@roztocil.name', | ||||||
|     license=httpie.__licence__, |     license=httpie.__licence__, | ||||||
|     packages=['httpie', 'httpie.plugins'], |     packages=find_packages(), | ||||||
|     entry_points={ |     entry_points={ | ||||||
|         'console_scripts': [ |         'console_scripts': [ | ||||||
|             'http = httpie.__main__:main', |             'http = httpie.__main__:main', | ||||||
| @@ -72,6 +73,8 @@ setup( | |||||||
|         'Programming Language :: Python :: 2.7', |         'Programming Language :: Python :: 2.7', | ||||||
|         'Programming Language :: Python :: 3.1', |         'Programming Language :: Python :: 3.1', | ||||||
|         'Programming Language :: Python :: 3.2', |         'Programming Language :: Python :: 3.2', | ||||||
|  |         'Programming Language :: Python :: 3.3', | ||||||
|  |         'Programming Language :: Python :: 3.4', | ||||||
|         'Environment :: Console', |         'Environment :: Console', | ||||||
|         'Intended Audience :: Developers', |         'Intended Audience :: Developers', | ||||||
|         'Intended Audience :: System Administrators', |         'Intended Audience :: System Administrators', | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ from httpie.output.processors.colors import get_lexer | |||||||
| from utils import TestEnvironment, http, httpbin, HTTP_OK, COLOR, CRLF | from utils import TestEnvironment, http, httpbin, HTTP_OK, COLOR, CRLF | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestVerboseFlag: | class TestVerboseFlag: | ||||||
|     def test_verbose(self): |     def test_verbose(self): | ||||||
|         r = http('--verbose', 'GET', httpbin('/get'), 'test-header:__test__') |         r = http('--verbose', 'GET', httpbin('/get'), 'test-header:__test__') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user