#6 Update to 1.0.3
Merged 2 years ago by mikelo2. Opened 2 years ago by mikelo2.
rpms/ mikelo2/httpie epel7-1.0.3  into  epel7

file modified
+1
@@ -6,3 +6,4 @@ 

  /httpie-0.9.2.tar.gz

  /httpie-0.9.3.tar.gz

  /httpie-0.9.4.tar.gz

+ /httpie-1.0.3.tar.gz

file modified
+27 -144
@@ -1,34 +1,21 @@ 

- %if 0%{?fedora}

- %global with_python3 1

- %endif

- 

  Name:           httpie

- Version:        0.9.4

+ Version:        1.0.3

  Release:        1%{?dist}

  Summary:        A Curl-like tool for humans

  

  Group:          Applications/Internet

  License:        BSD

- URL:            http://httpie.org/

- Source0:        http://pypi.python.org/packages/source/h/httpie/httpie-%{version}.tar.gz

+ URL:            https://httpie.org/

+ Source0:        https://github.com/httpie/httpie/archive/%{version}/%{name}-%{version}.tar.gz

  BuildArch:      noarch

+ Obsoletes:      python2-httpie < 0.9.5

  

- BuildRequires:  python2-devel

- 

- # Needed so we can build the manpage with help2man without fataling.

- BuildRequires:  python-pygments

- BuildRequires:  python-requests

- %if 0%{?fedora}

- BuildRequires:  help2man

- %endif

+ Requires:       python3

+ Requires:       python36-pygments

+ Requires:       python36-requests

  

- %if 0%{?with_python3}

  BuildRequires:  python3-devel

- 

- # Needed so we can build the manpage with help2man without fataling.

- BuildRequires:  python3-pygments

- BuildRequires:  python3-requests

- %endif

+ BuildRequires:  python3-setuptools

  

  %description

  HTTPie is a CLI HTTP utility built out of frustration with existing tools. The
@@ -39,145 +26,41 @@ 

  HTTP requests using a simple and natural syntax and displaying colorized

  responses.

  

- %package -n python2-httpie

- Summary:        A Curl-like tool for humans

- Group:          Applications/Internet

- %{?python_provide:%python_provide python2-httpie}

- %if 0%{?with_python3}

- # Then the python3 package below will provide "httpie"

- %else

- # Otherwise, the python2 package here will provide it.

- Provides:       httpie%{?_isa} = %{version}-%{release}

- Obsoletes:      httpie < 0.9.3-2

- %endif

- 

- Requires:       python2

- Requires:       python-pygments

- Requires:       python-requests

- 

- %description -n python2-httpie

- HTTPie is a CLI HTTP utility built out of frustration with existing tools. The

- goal is to make CLI interaction with HTTP-based services as human-friendly as

- possible.

- 

- HTTPie does so by providing an http command that allows for issuing arbitrary

- HTTP requests using a simple and natural syntax and displaying colorized

- responses.

- 

- 

- %if 0%{?with_python3}

- %package -n python3-httpie

- Summary:        A Curl-like tool for humans

- Group:          Applications/Internet

- %{?python_provide:%python_provide python3-httpie}

- Provides:       httpie%{?_isa} = %{version}-%{release}

- Obsoletes:      httpie < 0.9.3-2

- 

- Requires:       python3

- Requires:       python3-pygments

- Requires:       python3-requests

- 

- %description -n python3-httpie

- HTTPie is a CLI HTTP utility built out of frustration with existing tools. The

- goal is to make CLI interaction with HTTP-based services as human-friendly as

- possible.

- 

- HTTPie does so by providing an http command that allows for issuing arbitrary

- HTTP requests using a simple and natural syntax and displaying colorized

- responses.

- %endif

- 

  %prep

  %setup -q

  sed -i '/#!\/usr\/bin\/env/d' %{name}/__main__.py

  

- # RHEL ships version 1.4, which works fine here.

- sed -i 's/Pygments>=1.5/Pygments>=1.4/' setup.py

+ # RHEL7 ships version 2.2, which works fine here.

+ sed -i 's/Pygments>=2.3.1/Pygments>=2.2.0/' setup.py

  

- # RHEL ships version 2.6.0 which works fine here.

- sed -i 's/requests>=2.10.0/requests>=2.6.0/' setup.py

- 

- %if 0%{?with_python3}

- rm -rf %{py3dir}

- cp -a . %{py3dir}

- %endif

+ # RHEL7 ships version 2.6.0 which works fine here.

+ sed -i 's/requests>=2.21.0/requests>=2.6.0/' setup.py

  

  %build

- %{__python2} setup.py build

- 

- %if 0%{?with_python3}

- pushd %{py3dir}

- %{__python3} setup.py build

- popd

- %endif

+ export LANG=en_US.utf-8

+ %py3_build

  

  %install

- %if 0%{?with_python3}

- pushd %{py3dir}

- %{__python3} setup.py install --skip-build --root %{buildroot}

- mv %{buildroot}/%{_bindir}/http %{buildroot}/%{_bindir}/python3-http

- popd

- %endif

- 

- %{__python2} setup.py install --root %{buildroot}

- mv %{buildroot}/%{_bindir}/http %{buildroot}/%{_bindir}/python2-http

- 

- export PYTHONPATH=%{buildroot}%{python2_sitelib}

- 

- # Create a link to the default executable

- %if 0%{?with_python3}

- ln -s python3-http %{buildroot}/%{_bindir}/http

- %else

- ln -s python2-http %{buildroot}/%{_bindir}/http

- %endif

- 

- # Generate man pages for everything

- %if 0%{?fedora}

- mkdir -p %{buildroot}/%{_mandir}/man1

- help2man --no-discard-stderr %{buildroot}/%{_bindir}/http > %{buildroot}/%{_mandir}/man1/http.1

- help2man --no-discard-stderr %{buildroot}/%{_bindir}/python2-http > %{buildroot}/%{_mandir}/man1/python2-http.1

- %if 0%{?with_python3}

- help2man --no-discard-stderr %{buildroot}/%{_bindir}/python3-http > %{buildroot}/%{_mandir}/man1/python3-http.1

- %endif

- %endif

- 

- 

- %files -n python2-httpie

- %doc README.rst

- %license LICENSE

- %{python2_sitelib}/%{name}/

- %{python2_sitelib}/%{name}-%{version}*

- 

- %if 0%{?with_python3}

- %{_bindir}/python2-http

- %if 0%{?fedora}

- %{_mandir}/man1/python2-http.1*

- %endif

- %else

- %{_bindir}/http

- %{_bindir}/python2-http

- %if 0%{?fedora}

- %{_mandir}/man1/http.1*

- %{_mandir}/man1/python2-http.1*

- %endif

- %endif

- 

- %if 0%{?with_python3}

- %files -n python3-httpie

+ export LANG=en_US.utf-8

+ %py3_install

+ 

+ # pytest-httpbin is not available in EPEL7, can't run checks

+ #%%check

+ #%%pytest -v

+ 

+ %files

  %doc README.rst

  %license LICENSE

  %{python3_sitelib}/%{name}/

  %{python3_sitelib}/%{name}-%{version}*

- 

  %{_bindir}/http

- %{_bindir}/python3-http

- %if 0%{?fedora}

- %{_mandir}/man1/http.1*

- %{_mandir}/man1/python3-http.1*

- %endif

- %endif

  

  %changelog

+ * Mon Aug 09 2021 Mikel Olasagasti <mikel@olasagasti.info> - 1.0.3-1

+ - Update to latest possible version for EPEL7

+ - Remove Fedora bits

+ - Remove python2 bits

+ 

  * Tue Jul 05 2016 Ricky Elrod <relrod@redhat.com> - 0.9.4-1

  - Update to latest upstream.

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- 2b8e7497b0aa3b835b545e98126df378  httpie-0.9.4.tar.gz

+ SHA512 (httpie-1.0.3.tar.gz) = 80e540dcb92a55fb8b3c5dd56f380cb1795e4296827591853070a5b775c1f87cd881758d9dd0bdfeff383d06ce8ffafe68ec0269e3d269473e528952a769ecb7

  • 1.0.3 is last supported python2 version of httpie
  • Remove Fedora bits
  • Remove python3 bits

I'd prefer to use Python 3 on EPEL 7.

rebased onto a8a685e09cbcc86d9e7366f32f6a657731f53ab0

2 years ago

Switched to Python 3.

Maybe a newer release of the package can be pushed as python3 packages are newer, but I'll need more time to test and prefer to get this one for now.

+ /usr/bin/python3 setup.py build
Traceback (most recent call last):
  File "setup.py", line 111, in <module>
    'Topic :: Utilities'
  File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 128, in setup
    _install_setup_requires(attrs)
  File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 121, in _install_setup_requires
    dist.parse_config_files(ignore_option_errors=True)
  File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 492, in parse_config_files
    _Distribution.parse_config_files(self, filenames=filenames)
  File "/usr/lib64/python3.6/distutils/dist.py", line 395, in parse_config_files
    parser.read(filename)
  File "/usr/lib64/python3.6/configparser.py", line 697, in read
    self._read(fp, filename)
  File "/usr/lib64/python3.6/configparser.py", line 1015, in _read
    for lineno, line in enumerate(fp, start=1):
  File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 379: ordinal not in range(128)

Try setting LANG=en_US.utf-8

This is a diff from your epel8 specfile that builds on epel8:

diff --git a/httpie.spec b/httpie.spec
index bd0467d..4aaa32f 100644
--- a/httpie.spec
+++ b/httpie.spec
@@ -30,14 +30,19 @@ Patch5:         https://github.com/httpie/httpie/pull/1075.patch

 BuildArch:      noarch

-BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
-BuildRequires:  python3-pygments
-BuildRequires:  python3-requests
-BuildRequires:  python3-requests-toolbelt
+BuildRequires:  python36-devel
+BuildRequires:  python36-setuptools
+BuildRequires:  python36-pygments
+BuildRequires:  python36-requests
+BuildRequires:  python36-requests-toolbelt
 BuildRequires:  sed
 BuildRequires:  help2man

+Requires:       python36-setuptools
+Requires:       python36-pygments
+Requires:       python36-requests
+Requires:       python36-requests-toolbelt
+
 %description
 HTTPie is a CLI HTTP utility built out of frustration with existing tools. The
 goal is to make CLI interaction with HTTP-based services as human-friendly as
@@ -55,15 +60,19 @@ sed -i '/#!\/usr\/bin\/env/d' httpie/__main__.py
 # RHEL8 ships version 2.2, which works fine here.
 sed -i 's/Pygments>=2.5.2/Pygments>=2.2.0/' setup.py

+sed -i 's/requests-toolbelt>=0.9.1/requests-toolbelt>=0.8/' setup.py
+
 # RHEL8 ships version 2.22.0 which works fine here.
-sed -i 's/requests\[socks\]>=2.22.0/requests>=2.20.0/' setup.py
+sed -i 's/requests\[socks\]>=2.22.0/requests>=2.14.2/' setup.py


 %build
+export LANG=en_US.utf-8
 %py3_build


 %install
+export LANG=en_US.utf-8
 %py3_install

 # Bash completion

Sorry Miro, where did it fail that required the LANG export?

i did a scratch-build an is working fine https://koji.fedoraproject.org/koji/taskinfo?taskID=73587049

Here in the Fedora CI - scratch build job.

The sha512sum of the source tarball here is 80e540dcb92a55fb8b3c5dd56f380cb1795e4296827591853070a5b775c1f87cd881758d9dd0bdfeff383d06ce8ffafe68ec0269e3d269473e528952a769ecb7

The sha512sum of the source tarball from your scratchbuild is b51779e0ec8f24108ee3f4bf690dc9dfddafff42509d1aa3d13ac12d65a93e02aad9644dc10134ebdbebf949b250cb288650a4dad3d382143e9ad3b9b0ac8c16

Your scratchbould only works because it uses a tarball that is missing some of the non-ASCII characters.

rebased onto ff2b3d96b7816e4881e7efff76f01afd7425e684

2 years ago

The sha512sum of the source tarball here is 80e540dcb92a55fb8b3c5dd56f380cb1795e4296827591853070a5b775c1f87cd881758d9dd0bdfeff383d06ce8ffafe68ec0269e3d269473e528952a769ecb7

The sha512sum of the source tarball from your scratchbuild is b51779e0ec8f24108ee3f4bf690dc9dfddafff42509d1aa3d13ac12d65a93e02aad9644dc10134ebdbebf949b250cb288650a4dad3d382143e9ad3b9b0ac8c16

It may be that I had the pypy version downloaded. It fails with the one from GitHub, so added the export LANG commands and is working now.

The package should be httpie and not python3-httpie and it needs to obsolete python2-httpie, otherwise the upgrade won't work.

rebased onto 49c56064e3f2395d8fc2c727a6a54581cc6a5921

2 years ago

The package should be httpie and not python3-httpie and it needs to obsolete python2-httpie, otherwise the upgrade won't work.

Added obsolete on python2-httpie, but not sure about the naming. I removed the python3 subpackage, so it's not python3-httpie anymore. You refer this way?

No need to obsolete httpie, this is httpie.

If you remove this mv...

...you don't need this ln -s.

I removed the python3 subpackage, so it's not python3-httpie anymore. You refer this way?

Yes, thanks!

rebased onto 321419c58084da732740ee32c2c4872404a87df6

2 years ago

rebased onto b971983cfadffee94be5b655a2b39b01bd282f35

2 years ago

With the following local changes:

diff --git a/httpie.spec b/httpie.spec
index 0b892b8..f543f97 100644
--- a/httpie.spec
+++ b/httpie.spec
@@ -13,6 +13,9 @@ Obsoletes:      python2-httpie < 0.9.5
 Requires:       python3
 Requires:       python36-pygments
 Requires:       python36-requests
+BuildRequires:       python36-pygments
+BuildRequires:       python36-requests
+BuildRequires:       python36-mock

 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
@@ -45,8 +48,13 @@ export LANG=en_US.utf-8
 %{__python3} setup.py install --root %{buildroot}

 # pytest-httpbin is not available in EPEL7, can't run checks
-#%%check
-#%%pytest -v
+%check
+rm build -rf
+export LANG=en_US.utf-8
+export PATH="%{buildroot}%{_bindir}:$PATH"
+export PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"
+export PYTHONDONTWRITEBYTECODE=1
+pytest -vvv

 %files
 %doc README.rst

And installing pytest + pytest-httpbin via pip, I get:

$ fedpkg --release epel7 mockbuild -N --enable-network
...
=========================== short test summary info ============================
FAILED tests/test_ssl.py::test_ssl_version[ssl3] - requests.exceptions.Connec...
FAILED tests/test_ssl.py::TestClientCert::test_cert_file_invalid - requests.e...
FAILED tests/test_ssl.py::TestClientCert::test_cert_ok_but_missing_key - requ...
FAILED tests/test_ssl.py::TestServerCert::test_self_signed_server_cert_by_default_raises_ssl_error
FAILED tests/test_ssl.py::TestServerCert::test_verify_custom_ca_bundle_invalid_bundle
============ 5 failed, 226 passed, 9 skipped, 3 warnings in 15.39s =============

Most of this is caused by:

----------------------------- Captured stdout call -----------------------------
pytest-httpbin server hit an exception serving request: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:877)
attempting to ignore so the rest of the tests can run
----------------------------- Captured stderr call -----------------------------

http: error: ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=44211): Max retries exceeded with url: /get (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),)) while doing GET request to URL: https://127.0.0.1:44211/get

Not sure how bad this is.

rebased onto 38d5093

2 years ago

The test_ssl_version[ssl3] fail is because httpbin doesn't support ssl3.

For the TestClientCert and TestServerCert I tested different ssl setups from badssl.com with 0.9.4 and 1.0.3 and I was not able to find anything broken in the new release. I would say they cover some corner cases that I'm sure 0.9.4 won't catch them either.

Pull-Request has been merged by mikelo2

2 years ago