Initial import (#1036755)
This commit is contained in:
parent
bd2c0cced5
commit
2e8183c723
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
||||
/httpretty-0.8.3.tar.gz
|
41
0001-Replace-unicode-character-with-ASCII.patch
Normal file
41
0001-Replace-unicode-character-with-ASCII.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From dc0f584c88eb48d39479234a62b4fcabfbb4f661 Mon Sep 17 00:00:00 2001
|
||||
From: Jamie Lennox <jamielennox@redhat.com>
|
||||
Date: Mon, 28 Jul 2014 11:10:20 +1000
|
||||
Subject: [PATCH 1/4] Replace unicode character with ASCII
|
||||
|
||||
setuptools has a problem with unicode characters and as these files are
|
||||
now imported at setup time we need to remove them.
|
||||
---
|
||||
README.rst | 2 +-
|
||||
httpretty/__init__.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/README.rst b/README.rst
|
||||
index 6d615c0..1888500 100644
|
||||
--- a/README.rst
|
||||
+++ b/README.rst
|
||||
@@ -483,7 +483,7 @@ License
|
||||
::
|
||||
|
||||
<HTTPretty - HTTP client mock for Python>
|
||||
- Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org>
|
||||
+ Copyright (C) <2011-2013> Gabriel Falcao <gabriel@nacaolivre.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
diff --git a/httpretty/__init__.py b/httpretty/__init__.py
|
||||
index 7f3c4bf..b9ec739 100644
|
||||
--- a/httpretty/__init__.py
|
||||
+++ b/httpretty/__init__.py
|
||||
@@ -1,7 +1,7 @@
|
||||
# #!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# <HTTPretty - HTTP client mock for Python>
|
||||
-# Copyright (C) <2011-2013> Gabriel Falcão <gabriel@nacaolivre.org>
|
||||
+# Copyright (C) <2011-2013> Gabriel Falcao <gabriel@nacaolivre.org>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation
|
||||
--
|
||||
1.9.3
|
||||
|
46
0002-Un-pin-requirements.patch
Normal file
46
0002-Un-pin-requirements.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 4c03a41b9a50ee46490f631731e6a9bed60c0ad8 Mon Sep 17 00:00:00 2001
|
||||
From: Jamie Lennox <jamielennox@redhat.com>
|
||||
Date: Mon, 28 Jul 2014 11:16:00 +1000
|
||||
Subject: [PATCH 2/4] Un-pin requirements
|
||||
|
||||
This has previously been submitted upstream and has since been reverted.
|
||||
Pinning versions is not acceptable for distribution.
|
||||
|
||||
Removing coverage altogether as it shouldn't be needed for building.
|
||||
---
|
||||
requirements.txt | 2 +-
|
||||
test-requirements.txt | 11 +++++------
|
||||
2 files changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index e4d837f..a42590b 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -1 +1 @@
|
||||
-urllib3==1.7.1
|
||||
+urllib3
|
||||
diff --git a/test-requirements.txt b/test-requirements.txt
|
||||
index ceebf1a..4f2cfaa 100644
|
||||
--- a/test-requirements.txt
|
||||
+++ b/test-requirements.txt
|
||||
@@ -1,12 +1,11 @@
|
||||
# test runner
|
||||
-coverage==3.7.1
|
||||
-nose==1.3.0
|
||||
+nose
|
||||
|
||||
# testing utilities
|
||||
-mock==1.0.1
|
||||
-sure==1.2.3
|
||||
+mock
|
||||
+sure
|
||||
|
||||
# external frameworks tested against
|
||||
-httplib2==0.8
|
||||
+httplib2
|
||||
requests
|
||||
-tornado==3.2
|
||||
+tornado
|
||||
--
|
||||
1.9.3
|
||||
|
104
python-httpretty.spec
Normal file
104
python-httpretty.spec
Normal file
@ -0,0 +1,104 @@
|
||||
%global run_tests 0
|
||||
|
||||
Name: python-httpretty
|
||||
Version: 0.8.3
|
||||
Release: 1%{?dist}
|
||||
Summary: HTTP request mock tool for Python
|
||||
|
||||
License: MIT
|
||||
URL: http://falcao.it/HTTPretty/
|
||||
Source0: https://pypi.python.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
|
||||
|
||||
# something about setuptools fails when it loads files with unicode characters
|
||||
# in a non-unicode environment (like packaging build servers). Remove the
|
||||
# unicode characters.
|
||||
Patch0: 0001-Replace-unicode-character-with-ASCII.patch
|
||||
|
||||
# Part of https://github.com/gabrielfalcao/HTTPretty/pull/180
|
||||
# however will likely still be needed for test-requirements in future.
|
||||
Patch1: 0002-Un-pin-requirements.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
Requires: python-urllib3
|
||||
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python-setuptools
|
||||
|
||||
%description
|
||||
Once upon a time a python developer wanted to use a RESTful API, everything was
|
||||
fine but until the day he needed to test the code that hits the RESTful API:
|
||||
what if the API server is down? What if its content has changed?
|
||||
|
||||
Don't worry, HTTPretty is here for you.
|
||||
|
||||
%package -n python3-httpretty
|
||||
Summary: HTTP request mock tool for Python 3
|
||||
Requires: python3-urllib3
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
|
||||
%description -n python3-httpretty
|
||||
Once upon a time a python developer wanted to use a RESTful API, everything was
|
||||
fine but until the day he needed to test the code that hits the RESTful API:
|
||||
what if the API server is down? What if its content has changed?
|
||||
|
||||
Don't worry, HTTPretty is here for you.
|
||||
|
||||
%prep
|
||||
%setup -q -n httpretty-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
|
||||
|
||||
pushd %{py3dir}
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
||||
popd
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
popd
|
||||
|
||||
|
||||
%check
|
||||
# There are a number of problems with the tests upstream.
|
||||
# Interdependencies, only working on specific pinned versions, timing issues
|
||||
# across tests. They are disabled for now but should be reenabled when possible.
|
||||
%if %{run_tests}
|
||||
%{__python2} setup.py test
|
||||
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py test
|
||||
popd
|
||||
%endif
|
||||
|
||||
|
||||
%files
|
||||
%doc COPYING README.md
|
||||
%{python_sitelib}/httpretty
|
||||
%{python_sitelib}/httpretty-%{version}-py2.?.egg-info
|
||||
|
||||
%files -n python3-httpretty
|
||||
%doc COPYING README.md
|
||||
%{python3_sitelib}/httpretty
|
||||
%{python3_sitelib}/httpretty-%{version}-py3.?.egg-info
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 28 2014 Jamie Lennox <jamielennox@redhat.com> - 0.8.3-1
|
||||
- Updated to new version.
|
||||
- Removed check, there are simply too many problems upstream.
|
||||
|
||||
* Mon Mar 10 2014 Jamie Lennox <jamielennox@redhat.com> - 0.8.0-1
|
||||
- Initial package.
|
||||
|
Loading…
Reference in New Issue
Block a user