Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed TAHRI committed Mar 18, 2024
2 parents a8ef611 + 5c068f8 commit 19e75df
Show file tree
Hide file tree
Showing 28 changed files with 330 additions and 346 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
- '3.7'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,17 @@ test-dist: test-sdist test-bdist-wheel

test-sdist: clean venv
@echo $(H1)Testing sdist build an installation$(H1END)
$(VENV_PYTHON) setup.py sdist
$(VENV_PIP) install build
$(VENV_PYTHON) -m build --sdist
$(VENV_PIP) install --force-reinstall --upgrade dist/*.gz
$(VENV_BIN)/http --version
@echo


test-bdist-wheel: clean venv
@echo $(H1)Testing wheel build an installation$(H1END)
$(VENV_PIP) install wheel
$(VENV_PYTHON) setup.py bdist_wheel
$(VENV_PIP) install build
$(VENV_PYTHON) -m build --wheel
$(VENV_PIP) install --force-reinstall --upgrade dist/*.whl
$(VENV_BIN)/http --version
@echo
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<div align="center">

[![HTTPie for Desktop](https://img.shields.io/static/v1?label=HTTPie&message=for%20Desktop&color=4B78E6)](https://httpie.io/product)
[![](https://img.shields.io/static/v1?label=HTTPie&message=for%20Web%20%26%20Mobile&color=73DC8C)](https://httpie.io/app)
[![](https://img.shields.io/static/v1?label=HTTPie&message=for%20Terminal&color=FA9BFA)](https://httpie.io/cli)
[![HTTPie for Desktop](https://img.shields.io/static/v1?label=HTTPie&message=Desktop&color=4B78E6)](https://httpie.io/product)
[![](https://img.shields.io/static/v1?label=HTTPie&message=Web%20%26%20Mobile&color=73DC8C)](https://httpie.io/app)
[![](https://img.shields.io/static/v1?label=HTTPie&message=CLI&color=FA9BFA)](https://httpie.io/cli)
[![Twitter](https://img.shields.io/twitter/follow/httpie?style=flat&color=%234B78E6&logoColor=%234B78E6)](https://twitter.com/httpie)
[![Chat](https://img.shields.io/discord/725351238698270761?style=flat&label=Chat%20on%20Discord&color=%23FA9BFA)](https://httpie.io/discord)

Expand All @@ -23,6 +23,7 @@
[![Latest version](https://img.shields.io/pypi/v/httpie.svg?style=flat&label=Latest&color=%234B78E6&logo=&logoColor=white)](https://pypi.python.org/pypi/httpie)
[![Build](https://img.shields.io/github/actions/workflow/status/httpie/cli/tests.yml?branch=master&color=%23FA9BFA&label=Build)](https://github.com/httpie/cli/actions)
[![Coverage](https://img.shields.io/codecov/c/github/httpie/cli?style=flat&label=Coverage&color=%2373DC8C)](https://codecov.io/gh/httpie/cli)
[![PyPi downloads](https://img.shields.io/pepy/dt/httpie?style=flat&label=Downloads%20from%20PyPi%20only&color=4B78E6)](https://www.pepy.tech/projects/httpie)

</div>

Expand Down Expand Up @@ -82,7 +83,7 @@ Custom [HTTP method](https://httpie.io/docs#http-method), [HTTP headers](https:/
http PUT pie.dev/put X-API-Token:123 name=John
```

Build and print a request without sending it using [offline mode](https://httpie.io/docs#offline-mode):
Build and print a request without sending it using [offline mode](https://httpie.io/docs/cli/offline-mode):

```bash
http --offline pie.dev/post hello=offline
Expand Down
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Also works for other Debian-derived distributions like MX Linux, Linux Mint, dee
```bash
# Install httpie
$ curl -SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg
$ sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" > /etc/apt/sources.list.d/httpie.list
$ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" | sudo tee /etc/apt/sources.list.d/httpie.list > /dev/null
$ sudo apt update
$ sudo apt install httpie
```
Expand Down Expand Up @@ -477,7 +477,7 @@ $ http pie.dev/get text==@files/text.txt
### URL shortcuts for `localhost`
Additionally, curl-like shorthand for localhost is supported.
This means that, for example, `:3000` would expand to `http://localhost:3000`
This means that, for example, `:3000` would expand to `http://localhost:3000`.
If the port is omitted, then port 80 is assumed.
```bash
Expand Down Expand Up @@ -530,7 +530,7 @@ $ http-unix %2Fvar%2Frun%2Fdocker.sock/info
### `--path-as-is`
The standard behavior of HTTP clients is to normalize the path portion of URLs by squashing dot segments as a typically filesystem would:
The standard behavior of HTTP clients is to normalize the path portion of URLs by squashing dot segments as a typical filesystem would:
```bash
$ http -v example.org/./../../etc/password
Expand Down Expand Up @@ -583,7 +583,7 @@ Note that the structured data fields aren’t the only way to specify request da
### File based separators
Using file contents as values for specific fields is a very common use case, which can be achieved through adding the `@` suffix to
the operators above. For example instead of using a static string as the value for some header, you can use `:@` operator
the operators above. For example, instead of using a static string as the value for some header, you can use `:@` operator
to pass the desired value from a file.
```bash
Expand Down Expand Up @@ -749,7 +749,7 @@ $ http --offline --print=B pie.dev/post \
In the example above, the `search[type]` is an instruction for creating an object called `search`, and setting the `type` field of it to the given value (`"id"`).
Also note that, just as the regular syntax, you can use the `:=` operator to directly pass raw JSON values (e.g, numbers in the case above).
Also note that, just as the regular syntax, you can use the `:=` operator to directly pass raw JSON values (e.g., numbers in the case above).
```json
{
Expand Down Expand Up @@ -1235,7 +1235,7 @@ by individual commands when sending a request instead of being joined together.
### Limiting response headers
The `--max-headers=n` options allows you to control the number of headers HTTPie reads before giving up (the default `0`, i.e., there’s no limit).
The `--max-headers=n` option allows you to control the number of headers HTTPie reads before giving up (the default `0`, i.e., there’s no limit).
```bash
$ http --max-headers=100 pie.dev/get
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/methods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tools:
install:
- curl -SsL https://packages.httpie.io/deb/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/httpie.gpg
# - curl -SsL -o /etc/apt/sources.list.d/httpie.list https://packages.httpie.io/deb/httpie.list
- sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" > /etc/apt/sources.list.d/httpie.list
- echo "deb [arch=amd64 signed-by=/usr/share/keyrings/httpie.gpg] https://packages.httpie.io/deb ./" | sudo tee /etc/apt/sources.list.d/httpie.list > /dev/null
- sudo apt update
- sudo apt install httpie
upgrade:
Expand Down
2 changes: 2 additions & 0 deletions httpie/internal/update_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def _fetch_updates(env: Environment) -> str:
file = env.config.version_info_file
data = _read_data_error_free(file)

print("fetch update...?")

response = niquests.get(PACKAGE_INDEX_LINK, verify=False)
response.raise_for_status()

Expand Down
89 changes: 89 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,97 @@ filterwarnings =
ignore:Passing msg=\.\. is deprecated:DeprecationWarning
ignore:Unverified HTTPS request is being made to host:urllib3.exceptions.InsecureRequestWarning

[metadata]
name = httpie
version = attr: httpie.__version__
author = Jakub Roztocil
author_email = [email protected]
license = BSD
description = HTTPie: modern, user-friendly command-line HTTP client for the API era.
url = https://httpie.io/
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Environment :: Console
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: BSD License
Topic :: Internet :: WWW/HTTP
Topic :: Software Development
Topic :: System :: Networking
Topic :: Terminals
Topic :: Text Processing
Topic :: Utilities
project_urls =
GitHub = https://github.com/httpie/cli
Twitter = https://twitter.com/httpie
Discord = https://httpie.io/discord
Documentation = https://httpie.io/docs
Online Demo = https://httpie.io/run


[options]
packages = find:
install_requires =
pip
charset_normalizer>=2.0.0
defusedxml>=0.6.0
niquests[socks]>=3
Pygments>=2.5.2
setuptools
importlib-metadata>=1.4.0; python_version<"3.8"
rich>=9.10.0
colorama>=0.2.4; sys_platform=="win32"
python_requires = >=3.7


[flake8]
# <https://flake8.pycqa.org/en/latest/user/error-codes.html>
# E501 - line too long
# W503 - line break before binary operator
ignore = E501,W503

[options.packages.find]
include =
httpie
httpie.*

[options.entry_points]
console_scripts =
http = httpie.__main__:main
https = httpie.__main__:main
httpie = httpie.manager.__main__:main

[options.extras_require]
dev =
pytest
pytest-httpbin>=0.0.6
responses
pytest-mock
werkzeug<2.1.0
flake8
flake8-comprehensions
flake8-deprecated
flake8-mutable
flake8-tuple
pyopenssl
pytest-cov
pyyaml
twine
wheel
Jinja2
test =
pytest
pytest-httpbin>=0.0.6
responses
pytest-mock
werkzeug<2.1.0

[options.data_files]
share/man/man1 =
extras/man/http.1
extras/man/https.1
extras/man/httpie.1
121 changes: 2 additions & 119 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,120 +1,3 @@
# This is purely the result of trial and error.
from setuptools import setup

import sys

from setuptools import setup, find_packages

import httpie


# Note: keep requirements here to ease distributions packaging
tests_require = [
'pytest<8',
'pytest-httpbin>=0.0.6',
'pytest-lazy-fixture>=0.0.6',
'responses',
'pytest-mock',
'werkzeug<2.1.0',
'flaky',
]
dev_require = [
*tests_require,
'flake8',
'flake8-comprehensions',
'flake8-deprecated',
'flake8-mutable',
'flake8-tuple',
'pytest-cov',
'pyyaml',
'twine',
'wheel',
'Jinja2'
]
install_requires = [
'pip',
'charset_normalizer>=2.0.0',
'defusedxml>=0.6.0',
'niquests[socks]>=3.4.0,<4',
'Pygments>=2.5.2',
'setuptools',
'importlib-metadata>=1.4.0; python_version < "3.8"',
'rich>=9.10.0',
]
install_requires_win_only = [
'colorama>=0.2.4',
]

# Conditional dependencies:

# sdist
if 'bdist_wheel' not in sys.argv:

if 'win32' in str(sys.platform).lower():
# Terminal colors for Windows
install_requires.extend(install_requires_win_only)


# bdist_wheel
extras_require = {
'dev': dev_require,
'test': tests_require,
# https://wheel.readthedocs.io/en/latest/#defining-conditional-dependencies
':sys_platform == "win32"': install_requires_win_only,
}


def long_description():
with open('README.md', encoding='utf-8') as f:
return f.read()


setup(
name='httpie',
version=httpie.__version__,
description=httpie.__doc__.strip(),
long_description=long_description(),
long_description_content_type='text/markdown',
url='https://httpie.io/',
download_url=f'https://github.com/httpie/cli/archive/{httpie.__version__}.tar.gz',
author=httpie.__author__,
author_email='[email protected]',
license=httpie.__licence__,
packages=find_packages(include=['httpie', 'httpie.*']),
entry_points={
'console_scripts': [
'http = httpie.__main__:main',
'https = httpie.__main__:main',
'httpie = httpie.manager.__main__:main',
],
},
python_requires='>=3.7',
extras_require=extras_require,
install_requires=install_requires,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development',
'Topic :: System :: Networking',
'Topic :: Terminals',
'Topic :: Text Processing',
'Topic :: Utilities'
],
project_urls={
'GitHub': 'https://github.com/httpie/cli',
'Twitter': 'https://twitter.com/httpie',
'Discord': 'https://httpie.io/discord',
'Documentation': 'https://httpie.io/docs',
'Online Demo': 'https://httpie.io/run',
},
data_files=[
('share/man/man1', ['extras/man/http.1']),
('share/man/man1', ['extras/man/https.1']),
('share/man/man1', ['extras/man/httpie.1']),
]
)
setup()
11 changes: 8 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@

import pytest
from pytest_httpbin import certs
from pytest_httpbin.serve import Server as PyTestHttpBinServer

from .utils import ( # noqa
from .utils import ( # noqa
HTTPBIN_WITH_CHUNKED_SUPPORT_DOMAIN,
HTTPBIN_WITH_CHUNKED_SUPPORT,
REMOTE_HTTPBIN_DOMAIN,
mock_env
)
from .utils.plugins_cli import ( # noqa
from .utils.plugins_cli import ( # noqa
broken_plugin,
dummy_plugin,
dummy_plugins,
httpie_plugins,
httpie_plugins_success,
interface,
)
from .utils.http_server import http_server, localhost_http_server # noqa
from .utils.http_server import http_server, localhost_http_server # noqa


# Patch to support `url = str(server)` in addition to `url = server + '/foo'`.
PyTestHttpBinServer.__str__ = lambda self: self.url

from sys import modules

Expand Down
Loading

0 comments on commit 19e75df

Please sign in to comment.