Bug 1205170 - python 3 package for python-uri-templates
Summary: python 3 package for python-uri-templates
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-uri-templates
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 989068
TreeView+ depends on / blocked
 
Reported: 2015-03-24 11:37 UTC by Oskari Saarenmaa
Modified: 2015-06-23 14:27 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-23 14:27:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
spec file with python3 support (2.05 KB, text/x-matlab)
2015-03-24 11:37 UTC, Oskari Saarenmaa
no flags Details
Updated spec file (2.26 KB, text/x-matlab)
2015-06-07 16:17 UTC, Michele Baldessari
no flags Details

Description Oskari Saarenmaa 2015-03-24 11:37:30 UTC
Created attachment 1005802 [details]
spec file with python3 support

Description of problem:
python-uri-templates doesn't have a python 3 version and the python 2 package uses a rather old version.

Version 0.6 which added support for Python 3 was released in 2013, please update to it and build a Python 3 package.  It's needed for the Google Python API client.

Attached the spec file I used to build a python 3 package myself.

Comment 1 Michele Baldessari 2015-06-07 16:17:35 UTC
Created attachment 1035973 [details]
Updated spec file

Here is an updated spec file. Here is the diff to the one currently in Fedora:
diff --git a/python-uri-templates.spec b/python-uri-templates.spec
index fdcd8014e190..fb99c8478fb4 100644
--- a/python-uri-templates.spec
+++ b/python-uri-templates.spec
@@ -1,36 +1,68 @@
-%global commit e947a8affa793f24cd3526a1d18f21e0729672da
-%global shortcommit %(c=%{commit}; echo ${c:0:7})
+%if 0%{?fedora}
+%bcond_without python3
+%else
+%bcond_with python3
+%endif
 
 Name:           python-uri-templates
-Version:        0.5.2
-Release:        2%{?dist}
-Summary:        A Python implementation of URI Template
+Version:        0.6
+Release:        1%{?dist}
+Summary:        A Python implementation of URI Templates
 
 License:        ASL 2.0
 URL:            https://github.com/uri-templates/uritemplate-py
-Source0:        https://github.com/uri-templates/uritemplate-py/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
+Source0:        https://github.com/uri-templates/uritemplate-py/archive/uri-template-py-%{version}.tar.gz
 
 BuildArch:      noarch
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
-Requires:  python-simplejson
+BuildRequires:  pytest
+%if %{with python3}
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-devel
+BuildRequires:  python3-pytest
+%endif
+
+Requires:       python-simplejson
 
 %description
 This is a Python implementation of RFC6570, URI Template, and can 
 expand templates up to and including Level 4 in that specification.
 
+%if %{with python3}
+%package -n python3-uri-templates
+Summary:        A Python 3 implementation of URI Templates
+
+Requires:       python3-simplejson
+
+%description -n python3-uri-templates
+This is a python 3 client module for accessing resources protected by OAuth 2.0
+%endif
+
 %prep
-%setup -q -n uritemplate-py-%{commit}
+%setup -q -n uritemplate-py-uri-template-py-%{version}
 
 # Remove shebang
-sed -i "1 d" uritemplate/uritemplate.py
+sed -i "1 d" uritemplate/__init__.py
 
 %build
-%{__python} setup.py build
+%{__python2} setup.py build
 
+%if %{with python3}
+%{__python3} setup.py build
+%endif
+
+%check
+%{__python2} -m pytest test/variables_test.py
+%if %{with python3}
+%{__python3} -m pytest test/variables_test.py
+%endif
 
 %install
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+%if %{with python3}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+%endif
 
 # tests are a separate repository?
  
@@ -39,8 +71,20 @@ sed -i "1 d" uritemplate/uritemplate.py
 %{python_sitelib}/uritemplate-%{version}-py?.?.egg-info
 %{python_sitelib}/uritemplate/
 
+%if %{with python3}
+%files -n python3-uri-templates
+%doc README.rst
+%{python3_sitelib}/uritemplate/
+%{python3_sitelib}/uritemplate-%{version}-py?.?.egg-info
+%endif
+
 
 %changelog
+* Sat Jun 06 2015 Michele Baldessari <michele> - 0.6-1
+- New upstream
+- Add python3 subpackage
+- Add check step
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng.org> - 0.5.2-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild


This passes fedora-review and rpmlint tests

Comment 2 Michele Baldessari 2015-06-23 14:27:12 UTC
Fixed in RAWHIDE


Note You need to log in before you can comment on or make changes to this bug.