Commit Graph
100 Commits
Author SHA1 Message Date
Mickaël Schoentgen 0d9c8b88b3 Change Chocolatey owner 2021-10-25 17:18:53 +02:00
Mickaël Schoentgen e75e0a0565 Change Void Linux maintainer 2021-10-25 16:25:59 +02:00
Mickaël Schoentgen 19e48ba901 Update Spack metadata 2021-10-25 16:19:49 +02:00
Mickaël Schoentgen a9b8513f62 Update Gentoo metadata 2021-10-25 16:16:26 +02:00
Mickaël Schoentgen 7985cf60c8 Fix Gentoo example link 2021-10-25 16:15:27 +02:00
Mickaël Schoentgen 5dc4a26277 Remove myself from the HTTPie team 2021-10-25 14:55:45 +02:00
Mickaël Schoentgen 7775422afb Add contributors list update to the release process 2021-10-25 14:54:59 +02:00
Mickaël Schoentgen 3abc76f6d5 Tiny docstring clean-up 2021-10-19 10:24:01 +02:00
Mickaël Schoentgen 021eb651e0 Bump the version to 2.7.0.dev0 (#1188) 2021-10-19 10:21:45 +02:00
Mickaël Schoentgen 419427cfb6 Update downstream files for HTTPie 2.6.0 (#1186)
* Update Alpine package

* Add charset-normalizer deps for Alpine

It currently does not exist. We will need to add it ourselves.

* Update Gentoo package

* Update Brew formula

* Update MacPorts port

* Fix Gentoo deps

* Update examples

* Update Void Linux package

* Update Void Linux commands

* Update Chocolateur package

* Review DEbian packaging details

* Simplify Void Linux package

* Update more packages

* Update summary everywhere

* Remove temporary file

* Update Chocolatey package URL

* Updates

* Update Spack
2021-10-19 10:18:35 +02:00
Mickaël Schoentgen 3e414d731c Update the awesome contributors list to HTTPie 2.6.0 2021-10-14 17:17:14 +02:00
Mickaël Schoentgen d8f6a5fe52 Blank master_and_released_docs_differ_after 2021-10-14 11:30:13 +02:00
Mickaël Schoentgen cdab8e67cb Release workflow: fix 2021-10-14 10:56:13 +02:00
Mickaël Schoentgen 6c6093a46d Configure PyPi for the release workflow 2021-10-14 10:45:31 +02:00
Mickaël Schoentgen 42af2f786f v2.6.0 (#1182)
[skip ci]
2021-10-14 10:36:39 +02:00
Mickaël Schoentgen a65771e271 Add a script that lists all contributors to a release (#1181)
* Add a script that lists all contributors to a release

We will keep a contributors database (simple JSON file) where
each entry is a contributor (either a committer, either an issue reporter,
either both) with some nicknames (GitHub, and Twitter).
The file will be used to craft credits on our release blog posts and to ping
them on Twitter.

* Add templates

* Missing docstring

* Clean-up

* Tweak
2021-10-14 10:33:14 +02:00
Mickaël SchoentgenandJakub Roztocil a15fd6f966 Add --response=mime and --response=charset docs (#1179)
* Add the "display encoding" section in the docs

* Remove repetition

* `--response=mime` / `--response=charset` docs

* Cleanup

* Cleanup

* Cleanup

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-10-13 23:32:46 +02:00
Mickaël Schoentgen 19691bba68 Packaging documentation tweaks 2021-10-11 17:42:29 +02:00
Mickaël Schoentgen 344491ba8e Tweak the Chocolatey package installation file 2021-10-11 10:07:24 +02:00
Mickaël SchoentgenandJakub Roztocil ab8512f96c Add --compress documentation (#1173)
* Add --compress documentation

* Apply suggestions from code review

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>

* Update docs/README.md

* Update docs/README.md

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-10-08 18:38:40 +02:00
Mickaël Schoentgen 1b7f74c2b2 Add a workflow to control Snap publications (#1176) 2021-10-08 11:24:24 +02:00
Mickaël Schoentgen 50f57f8c82 Add help output for --chunked (#1174) 2021-10-07 17:37:06 +02:00
Mickaël Schoentgen 476eb4f0d9 Use HTTPie repository everywhere 2021-10-07 16:15:52 +02:00
Mickaël Schoentgen 3869c3ce99 Remove unused import 2021-10-07 14:41:03 +02:00
Mickaël Schoentgen 17f74f10f3 Add summary to Chocolatey metadata
It is strongly recommended to add a summary.
It will be effective for the next release though.
2021-10-07 14:34:33 +02:00
Mickaël Schoentgen 1e094d0a79 Fix Snapcraft and Spack anchors 2021-10-07 14:06:06 +02:00
Mickaël Schoentgen bd227c0364 Specify the API key to submit Chocolatey packages 2021-10-07 13:58:02 +02:00
Mickaël Schoentgen 9dda23a322 Add Chocolatey packaging information (#1172)
* Add Chocolatey packaging information

* Fix working directory

* Fix Python dependency

* Update icon URL

* Fix local installation

* Simplify links

* Remove the workflow, it adds no real value and th etime to fix is is not worth
2021-10-07 13:53:11 +02:00
Mickaël Schoentgen 80e83f0463 Ignore more venv folders and VS Code folder 2021-10-06 17:29:03 +02:00
Mickaël SchoentgenandJakub Roztocil 4f1c9441c5 Fix encoding error with non-prettified encoded responses (#1168)
* Fix encoding error with non-prettified encoded responses

Removed `--format-option response.as` an promote `--response-as`: using
the format option would be misleading as it is now also used by non-prettified
responses.

* Encoding refactoring

* split --response-as into --response-mime and --response-charset
* add support for Content-Type charset for requests printed to terminal
* add support charset detection for requests printed to terminal without a Content-Type charset
* etc.

* `test_unicode.py` → `test_encoding.py`

* Drop sequence length check

* Clean-up tests

* [skip ci] Tweaks

* Use the compatible release clause for `charset_normalizer` requirement

Cf. https://www.python.org/dev/peps/pep-0440/#version-specifiers

* Clean-up

* Partially revert d52a4833e4

* Changelog

* Tweak tests

* [skip ci] Better test name

* Cleanup tests and add request body charset detection

* More test suite cleanups

* Cleanup

* Fix code style in test

* Improve detect_encoding() docstring

* Uniformize pytest.mark.parametrize() calls

* [skip ci] Comment out TODOs (will be tackled in a specific PR)

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-10-06 17:27:07 +02:00
Mickaël Schoentgen 7989e438d2 Add documentation about our release process (#1159)
* Add documentation about our release process

* Fixes

* Add company-related tasks, enable back WIP pages

* Fix WIP links

* Add AOSC OS

* Add WIP for AOSC OS

* Tweak

* Remove maintainers email IDs

* Use GH nicknames

* Remove useless WIP for brew

* Tweaks
2021-10-06 16:45:44 +02:00
Mickaël Schoentgen 93114072c8 Fix looked path for workflow testing packages 2021-10-06 11:21:54 +02:00
Mickaël SchoentgenandJakub Roztocil 08751d3672 Add install/update instructions database (#1160)
* Add install/update instructions database

* Update the database

* Revert README changes

They will be overwritten later.

* Revert

* Tweak

* Tweaks

* Upgrade database

* Complete commands

Still not sure about Spack upgrades.

* Sort

* Doc generation script draft

* Remove OS names from tool names

* Fix Linuxbrew name

* `wheel` already installs `setuptools`

* Gen docs

* Update

* Tweak

* Add a GitHub workflow to check for outdated installation instructions

* Fix return value

* Test

* Delete test

* Rename the script

* Add `make doc-install-inst`

* Add missing dev requirement

* The first tool is the primary we want to display

Then they are simply sorted by `tool.title`.

* Sort OSes by name

* Refactoring, jinja template, etc.

* Add tool title uniqueness `assert`, fix platform list extra `\n`

* Rebuild docs

* Update generate.py

* Update README.md

* Update methods.yml

* Update distros derived, more assertions

* Tweaks

* Add workflow to auto-update the docs

* Do not hide the command

* Tweaks

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-10-06 11:18:27 +02:00
Mickaël Schoentgen 031b4b89e3 Fix docs formatting 2021-10-05 15:46:10 +02:00
Mickaël Schoentgen e1c08a3de5 Mention Snapcraft for unstable version installation 2021-10-05 15:45:34 +02:00
Mickaël Schoentgenandclaudiatd 71adcd97d0 Improve handling of prettified responses without correct content-type encoding (#1110)
* Improve handling of responses without correct content-type charset

* [skip ci] Minor tweaks in tests

* [skip ci] Add documentation

Co-authored-by: claudiatd <claudiatd@gmail.com>

* Improve unknown encoding test

[skip ci]

* Review mime and options retrieval

* Add full content-type example in help output

* Simplify decoder

* [skip ci] s/charset/encoding/

* Tweaks

* [skip ci] Fix type annotation

* [skip ci] s/charset/encoding/

* Tweaks

* Fix type annoation

* Improvement

* Introduce `codec.encode()`

* [skip ci] Tweak changelog

Co-authored-by: claudiatd <claudiatd@gmail.com>
2021-09-29 20:22:19 +02:00
Mickaël Schoentgen b50f9aa7e7 Use PYthon 3 documentation
[skip ci]
2021-09-28 12:54:16 +02:00
Mickaël Schoentgen fe96b2af20 Use httpie.io/docs everywhere
[skip ci]
2021-09-28 12:53:53 +02:00
Mickaël Schoentgen 727b8a2c05 Sort available style choices (#1166) 2021-09-27 16:55:10 +02:00
Mickaël SchoentgenandJakub Roztocil 9c89c703ae Allow to overwrite the response Content-Type from options (#1134)
* Allow to override the response `Content-Type` from options

* Apply suggestions from code review

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>

* Rename the option from `--response.content-type` to `--response-as`

* Update CHANGELOG.md

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-09-27 13:58:19 +02:00
Mickaël Schoentgen 8f8851f1db Remove trailing comma in test 2021-09-24 10:37:59 +02:00
Mickaël Schoentgen bce2b3a98e Sort changelog 2021-09-23 17:17:29 +02:00
Mickaël Schoentgen 474093acdf Include plugin info in --debug output (#1165)
* Include plugin info in `--debug` output

* Adapt issue number

* Fix docs
2021-09-23 17:15:14 +02:00
Mickaël Schoentgen cae83b3f9e Add FreeBSD installation instructions
Closes #761.
2021-09-23 10:46:06 +02:00
Mickaël Schoentgen 507514b795 Add workflow to test with pyOpenSSL active (#1164)
* Add workflow to test with pyOpenSSL active

Original patch by @gmelodie.

* Fix tests on Windows with Python 3.6
2021-09-23 10:37:23 +02:00
Mickaël Schoentgen d7ed45bbcd Fix duplicate keys preservation of JSON data (#1163)
* Fix duplicate keys preservation of JSON data

* Update issue number

* Fix type annotations

* Changes after review

* Rewording
2021-09-21 19:07:59 +02:00
Mickaël Schoentgen e6c5cd3e4b Improve JSON output when there is leading data before the actual JSON body (#1130)
In some special cases, to prevent against Cross Site Script Inclusion (XSSI)
attacks, the JSON response body starts with a magic prefix line that must be
stripped before feeding the rest of the response body to the JSON parser.
Such prefix is now simply ignored from the parser but still printed in the
terminal.

* Fix Windows tests
2021-09-21 11:15:43 +02:00
Mickaël Schoentgen 273134123a Bump the version to 2.6.0.dev0 (#1162)
[skip ci]
2021-09-21 10:40:09 +02:00
Mickaël Schoentgen 529aa78ee1 Expand the pytest configuration (#1161)
And rely on it to run tests.
2021-09-20 17:36:03 +02:00
Mickaël Schoentgen e2ba214ac0 [snap] Improve OS integration (#1157)
Get back read-write access to `$HOME/.config/httpie` and `$HOME/.httpie`.
2021-09-15 16:50:44 +02:00
Mickaël SchoentgenandJakub Roztocil 9dd0203bae Use HTTPie for the documentation build request (#1150)
Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-09-15 14:25:46 +02:00
Mickaël Schoentgen 8f7f4a6ef4 Remove some horizontal lines in the bug report
And add myself to assignees.
2021-09-13 12:36:01 +02:00
Mickaël Schoentgen 9984447f18 Reverse results in bug report temlpate
Ir seems weird to ask for the expected result before knowing the current one.
2021-09-13 12:33:32 +02:00
Mickaël Schoentgen 30c595b770 [snap] Comment out the problematic interface
It seems it just needs to be present for the snap to be rejected.
2021-09-10 11:04:57 +02:00
Mickaël Schoentgen b38352858f [snap] Remove personal-files interface
Use of the `personal-files` interface is reserved for vetted publishers.

The interface requires a validation, but we need to publish at least
one package first. So let's skip that part, release a version and ask
for the interface access in a second time.

Also add a workflow to build & test the snap package.
2021-09-10 10:30:44 +02:00
Mickaël Schoentgen a45b94fda6 Complete CentOS installation instructions 2021-09-09 16:38:36 +02:00
Mickaël Schoentgen 513e5080e4 Add the release workflow
It has to be triggered manually for now.
2021-09-09 16:13:13 +02:00
Mickaël Schoentgen 7c9f415107 Add a workflow to check documentations (#1151)
* Add a workflow to check documentations

* Fix markdown issues

* Install Ruby 2.7

* Finally, handle and fix GitHub templates

* Minor improvement in the feature request template

* Verbose mode to be sure all files are checked
2021-09-09 15:52:24 +02:00
Mickaël Schoentgen 4c8633c6e5 Split the monolithic workflow into specific ones (#1149)
* Split the monolithic workflow into specific ones

* Rename workflows, improve commands

* Update pip from the venv

* Fix Windows setup

* Lowercase macos-latest

* Fix Windows run, again
2021-09-08 16:41:55 +02:00
Mickaël Schoentgen 4d7d6b66cf Trigger official documentation build when documentation is updated here 2021-09-08 15:43:34 +02:00
Mickaël Schoentgen a586fca246 Update brew formula to 2.5.0 (#1144)
* Update brew formula to 2.5.0

* Can use `idna` 3.2

* Sort requirements to ease reproductible builds

And also to have the same output as `brew bump-formula-pr`.

* Sync `bottles` with official Formula

And keep the `high_sierra` one.

* Add a workflow to check the Formula
2021-09-08 11:01:27 +02:00
Mickaël Schoentgen 978258ec5b Add Alpine Linux installation instructions 2021-09-08 10:04:49 +02:00
Mickaël Schoentgen cf21790411 Add the Snap build file for general Linux packaging
Based on the work of @elopio and @chipaca.

- Added support for the `snapd` protocol URL.
- Packaged Unix socket transport plugin.
2021-09-07 16:45:57 +02:00
Mickaël Schoentgen 4eaa4d67c5 v2.5.0 (#1140)
[skip ci]
2021-09-06 20:23:14 +02:00
Mickaël Schoentgen 6039bd8582 Switch from reStructuredText to Markdown and add docs/ (#1139)
* Convert most of the documentation from the frontend `README.rst` to `docs/REAME.md`

Also converted all reStructuredText files to Markdown.

* Tell `mdformat` to use LF for end on lines

* `--check` is not needed in the help message

* Skip tests on GitHub Windows.

Those tests pass on a real Windows machine.
Let's revisit those failure later, if needed.

* Move `mdoformat` requirement from `test` to `dev` extra

To fix Fedora CI.
2021-09-06 17:36:13 +02:00
Mickaël Schoentgen a62391e789 Tiny clean-up in program() (#1135) 2021-09-02 16:47:01 +02:00
Mickaël Schoentgen 71008bbedb Move example URL in a global variable for XML tests 2021-09-01 16:56:23 +02:00
Mickaël Schoentgen 85110643e7 Move example URL in a global variable for tests 2021-09-01 16:52:10 +02:00
Mickaël Schoentgen fdd486415a Fix XML formatter tests 2021-09-01 10:28:03 +02:00
Mickaël Schoentgen d10e108b5f Added support for XML formatting (#1129)
As a side effect, XHTML responses will be pretty-printed too.
2021-08-31 22:49:53 +02:00
Mickaël Schoentgen dac0d716c1 Add the formatting options section in the docs (#1131)
It will ease future changes and should improve reading/finding information.
2021-08-24 17:11:40 +02:00
Mickaël Schoentgen 0340f8caf5 Fix missing links in the changelog
[skip ci]
2021-08-17 11:21:04 +02:00
Mickaël SchoentgenandJakub Roztocil d7caeaf372 Fix handling of session files with Cookie: followed by other headers (#1127)
* Fix the handling of cookies from session files

* Apply suggestions from code review

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>

* Fix test docstring formatting

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
2021-08-16 14:50:46 +02:00
Mickaël Schoentgen 54c8612452 Remove unused code in BasicConfig (#1123) 2021-08-06 18:04:08 +02:00
Mickaël Schoentgen 4ff22defe4 Rework __main__.py to follow best practices (#1124)
It also simplifies how the `main()` function could be tested.
2021-08-06 16:57:19 +02:00
Mickaël Schoentgen c50e287c57 CI: Run tests on Python 3.10 RC1 (#1121) 2021-08-06 13:11:21 +02:00
Mickaël Schoentgen 6bd6648545 Simplify get_content_type() (#1125)
We were using the potential `encoding` returned by `mimetypes.guess_type()`
to expand the `Content-Type` header.
According to the RFC-7231 [1] the `Content-Type` should contain a charset
and nothing more. But as stated in the `mimetypes.guess_type()` doc [2],
the `encoding` would be the name of the program used to encode (e.g. compress
or gzip) the payload. The `encoding` is suitable for use as a `Content-Encoding`
header. See [3] for potential `encoding`s, none is a IANA registered one [4], and
so a valid charset to be used by the `Content-Type` header.

[1] https://httpwg.org/specs/rfc7231.html#header.content-type
[2] https://docs.python.org/3/library/mimetypes.html#guess_type
[3] https://github.com/python/cpython/blob/938e84b4fa410f1a86f5e0708ebc3af6bb8efb0e/Lib/mimetypes.py#L416-L422
[4] https://www.iana.org/assignments/character-sets/character-sets.xhtml
2021-08-06 12:35:38 +02:00
Mickaël Schoentgen c6cbc7dfa5 Uniformize UTF-8 naming (#1115)
* Uniformize UTF-8 naming

Replace `utf8` -> `utf-8` everywhere.
It should have no impact, `utf8` is an alias of `utf-8` [1].

[1] https://github.com/python/cpython/blob/ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7/Lib/encodings/aliases.py#L534

* Always specify the encoding

Let's be explicit over implicit. And prevent future warnings from PEP-597 [1].

[1] https://www.python.org/dev/peps/pep-0597/#using-the-default-encoding-is-a-common-mistake

* Update `UTF8` constant (`utf-8` -> `utf_8`)

* Remove default argument from `str.encode()` and `bytes.decode()`

* Clean-up
2021-08-05 20:58:43 +02:00
Mickaël Schoentgen 11399dde76 Refine abstract methods and properties (#1118) 2021-08-05 20:57:23 +02:00
Mickaël Schoentgen da47e37c44 Use builtin open() in setup.py (#1120) 2021-08-05 20:56:59 +02:00
Mickaël Schoentgen a66af2497a Add converter plugin streaming tests (#1117)
Also fixed minor glitches here and there and re-enabled a unicode test.
2021-08-05 14:37:08 +02:00
Mickaël Schoentgen de13423839 --download: Use time.monotonic() and rework code to prevent ZeroDivisionError specific handling (#1113) 2021-07-29 16:05:56 +02:00
Mickaël Schoentgen 04d05a8abd Minor clean-up (#1112)
* Remove Python 2 clean-up misses

* Remove unused `Environment.devnull` setter

* Simplifies `get_filename_max_length()`
2021-07-26 23:56:38 +02:00
Mickaël Schoentgen 2f8d7f77bd Add more download tests (#1114) 2021-07-26 20:27:36 +02:00
Mickaël Schoentgen 64c31d554a Revert "Use http in the 'hello world' example to be consitent (#1109)"
This reverts commit 41c251ec7c.
2021-07-16 15:49:41 +02:00
Mickaël Schoentgen b7300c1096 Update Chocolatey command in the docs 2021-07-02 17:54:07 +02:00
Mickaël Schoentgen 5717fb1ad5 Normalize the version (#1101)
To fix that warning:

    setuptools/dist.py:473: UserWarning: Normalizing '2.5.0-dev' to '2.5.0.dev0'
2021-07-01 10:34:51 +02:00
Mickaël Schoentgen e5bda98ee7 Mention snap install http in the docs (#1097) 2021-06-28 12:28:21 +02:00
Mickaël Schoentgen 2d55c01c7e Fix printing redirected prepared request in verbose mode (#1088) 2021-06-15 13:39:46 +02:00
Mickaël Schoentgen 1470ca0c77 CI: Do not fail fast to have a real view of potential failures (#1090) 2021-06-11 20:55:51 +02:00
Mickaël Schoentgen 9857693ebf Use a more modern approach to run tests (#1089)
Running tests through `python setup.py test` is deprecated:

> WARNING: Testing via this command is deprecated and will be removed
> in a future version. Users looking for a generic test entry point
> independent of test runner are encouraged to use tox.

I am not in favor of moving back to `tox`, we should simply run tests
using `python -m pytest` (or `make test`) and that's it.

A new extra was added, `dev`, to install development requirements:

    $ python -m pip install --upgrade --editable '.[dev]'
2021-06-11 20:55:26 +02:00
Mickaël Schoentgen 61f1ffd0eb Prevent installation of test files (#1087)
(They’re still included in the package as per #182)
2021-06-09 17:14:27 +02:00
Mickaël Schoentgen 9792513c68 Add a reproduction test case for #1082 (#1085)
The fix may actually be slightly more complex than I expected.
We would need, at first sight, to loose the prepared requests + responses streaming.

A potential solution will come in a near future.
2021-06-09 09:43:06 +02:00
Mickaël Schoentgen 350f973f70 Switch from pycodestyle to flake8 for code style checks (#1083) 2021-06-02 11:06:46 +02:00
Mickaël Schoentgen 8d35a12d27 Fix several issues found with flake8 (#1081) 2021-06-01 14:46:58 +02:00
Mickaël Schoentgen 8374a9ed83 Review OSError exceptions handling (#1080)
- Replace obsolete `IOError` (Python 2) with `OSError`,
  cf https://docs.python.org/3/library/exceptions.html#OSError.
- Improve `OSError` catches at different places, simplifying
  the code.
2021-05-31 10:10:41 +02:00
Mickaël Schoentgen a61f9e1114 Minor clean-up (#1078)
- Remove default arguments to `open()`.
- Make use of `pytest` mechanisms for temporary folders.
2021-05-29 12:06:06 +02:00
Mickaël Schoentgen 611b278b63 Fix --style colors list help indentation (#1077) 2021-05-28 12:45:40 +02:00
Mickaël Schoentgen 464b5b4c1d Polish Python 2 removal (#1070) 2021-05-27 13:05:41 +02:00
Mickaël Schoentgen 264d45cdf5 Modernize the code base with f-strings in tests (#1069)
Simple concatenations were kept for readability purpose.
2021-05-26 14:09:38 +02:00