This commit is contained in:
Jakub Roztocil 2020-01-12 10:50:57 +01:00
parent e4a3ce8b9d
commit 4b524e6a8c
5 changed files with 9 additions and 19 deletions

View File

@ -6,7 +6,7 @@ This document records all notable changes to `HTTPie <https://httpie.org>`_.
This project adheres to `Semantic Versioning <https://semver.org/>`_.
`2.0.0-dev`_ (unreleased)
`2.0.0`_ (2020-01-12)
-------------------------
* Removed Python 2.7 support (`EOL Jan 2020 <https://www.python.org/doc/sunset-python-2/>`_).
* Removed the default 30-second connection ``--timeout`` limit.
@ -408,4 +408,5 @@ This project adheres to `Semantic Versioning <https://semver.org/>`_.
.. _1.0.1: https://github.com/jakubroztocil/httpie/compare/1.0.0...1.0.1
.. _1.0.2: https://github.com/jakubroztocil/httpie/compare/1.0.1...1.0.2
.. _1.0.3: https://github.com/jakubroztocil/httpie/compare/1.0.2...1.0.3
.. _2.0.0-dev: https://github.com/jakubroztocil/httpie/compare/1.0.3...master
.. _2.0.0-dev: https://github.com/jakubroztocil/httpie/compare/1.0.3...2.0.0
.. _2.1.0-dev: https://github.com/jakubroztocil/httpie/compare/2.0.0...master

View File

@ -36,7 +36,7 @@ install: venv
clean:
@echo $(H1)Cleaning up$(H1END)
rm -rf $(VENV_ROOT)
# Symlink for virtualenvwrapper, if weve created one.
# Remove symlink for virtualenvwrapper, if weve created one.
[ -n "$(WORKON_HOME)" -a -L "$(WORKON_HOME)/httpie" -a -f "$(WORKON_HOME)/httpie" ] && rm $(WORKON_HOME)/httpie || true
rm -rf .tox *.egg dist build .coverage .cache .pytest_cache httpie.egg-info
find . -name '__pycache__' -delete -o -name '*.pyc' -delete

View File

@ -3,6 +3,6 @@ HTTPie - a CLI, cURL-like tool for humans.
"""
__version__ = '2.0.0-dev'
__version__ = '2.0.0'
__author__ = 'Jakub Roztocil'
__licence__ = 'BSD'

View File

@ -18,21 +18,19 @@ from httpie.utils import (get_content_type, load_json_preserve_order)
class RequestItems:
def __init__(self, as_form=False, chunked=False):
def __init__(self, as_form=False):
self.headers = RequestHeadersDict()
self.data = RequestDataDict() if as_form else RequestJSONDataDict()
self.files = RequestFilesDict()
self.params = RequestQueryParamsDict()
self.chunked = chunked
@classmethod
def from_args(
cls,
request_item_args: List[KeyValueArg],
as_form=False,
chunked=False
) -> 'RequestItems':
instance = cls(as_form=as_form, chunked=chunked)
instance = cls(as_form=as_form)
rules: Dict[str, Tuple[Callable, dict]] = {
SEPARATOR_HEADER: (
process_header_arg,
@ -110,15 +108,6 @@ def process_file_upload_arg(arg: KeyValueArg) -> Tuple[str, IO, str]:
)
def parse_file_item_chunked(arg: KeyValueArg):
fn = arg.value
try:
f = open(os.path.expanduser(fn), 'rb')
except IOError as e:
raise ParseError('"%s": %s' % (arg.orig, e))
return os.path.basename(fn), f, get_content_type(fn)
def process_data_item_arg(arg: KeyValueArg) -> str:
return arg.value

View File

@ -35,8 +35,8 @@ tests_require = [
install_requires = [
'requests>=2.21.0',
'Pygments>=2.3.1',
'requests>=2.22.0',
'Pygments>=2.5.2',
]