From 00ba53ef4c7b4b0c8f75954f8b02c2fd852b7d7a75bccccfdb989de41194be1f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 13 Feb 2019 14:16:48 +0000 Subject: [PATCH] Accepting request 674579 from home:mcepl - Add missing Requires - Initial packaging effort for 1.17.1 OBS-URL: https://build.opensuse.org/request/show/674579 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jirafs?expand=0&rev=1 --- .gitattributes | 23 ++++++++++ .gitignore | 1 + capitalization.patch | 19 +++++++++ jirafs-1.17.1.tar.gz | 3 ++ python-jirafs.changes | 9 ++++ python-jirafs.spec | 78 ++++++++++++++++++++++++++++++++++ verlib.patch | 98 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 231 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 capitalization.patch create mode 100644 jirafs-1.17.1.tar.gz create mode 100644 python-jirafs.changes create mode 100644 python-jirafs.spec create mode 100644 verlib.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/capitalization.patch b/capitalization.patch new file mode 100644 index 0000000..28b53cc --- /dev/null +++ b/capitalization.patch @@ -0,0 +1,19 @@ +--- a/requirements.txt ++++ b/requirements.txt +@@ -3,5 +3,5 @@ six>=1.9.0 + blessings>=1.5.1,<2.0 + ipdb>=0.8,<1.0 + verlib>=0.1,<1.0 +-prettytable>=0.7.2,<1.0 ++PrettyTable>=0.7.2,<1.0 + environmental-override>=0.1.2 +--- a/setup.py ++++ b/setup.py +@@ -27,6 +27,7 @@ except ImportError: + if not req.startswith('-') + and not req.startswith('#') + ] ++ print(requirements) + + + class Tox(TestCommand): diff --git a/jirafs-1.17.1.tar.gz b/jirafs-1.17.1.tar.gz new file mode 100644 index 0000000..9553bd2 --- /dev/null +++ b/jirafs-1.17.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b15917d5141b6f1841b9ca43223ee8a71f2ad18fea9c1aaec35b0434767abb4 +size 45501 diff --git a/python-jirafs.changes b/python-jirafs.changes new file mode 100644 index 0000000..fe6b90b --- /dev/null +++ b/python-jirafs.changes @@ -0,0 +1,9 @@ +------------------------------------------------------------------- +Fri Jan 18 21:57:03 UTC 2019 - Matej Cepl + +- Add missing Requires + +------------------------------------------------------------------- +Tue Jan 15 16:47:53 UTC 2019 - Matej Cepl + +- Initial packaging effort for 1.17.1 diff --git a/python-jirafs.spec b/python-jirafs.spec new file mode 100644 index 0000000..e39488f --- /dev/null +++ b/python-jirafs.spec @@ -0,0 +1,78 @@ +# +# spec file for package jirafs +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-jirafs +Version: 1.17.1 +Release: 0 +Summary: Edit Jira issues as text files locally +License: MIT +Group: Development/Languages/Python +URL: https://github.com/coddingtonbear/jirafs +Source: https://files.pythonhosted.org/packages/source/j/jirafs/jirafs-%{version}.tar.gz +Patch0: capitalization.patch +Patch1: verlib.patch +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} +BuildRequires: %{python_module environmental-override} +BuildRequires: %{python_module PrettyTable} +BuildRequires: %{python_module blessings} +BuildRequires: %{python_module jira} +# For testing +BuildRequires: %{python_module behave} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module tox} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +Requires: python-environmental-override +Requires: python-PrettyTable +Requires: python-blessings +Requires: python-jira +Requires: python-six +Requires: python-ipdb +%python_subpackages + +%description +Pronounced like 'giraffes', but totally unrelated to wildlife, this +library lets you stay out of JIRA as much as possible by letting +you edit your JIRA issues as a collection of text files using an +interface inspired by ``git`` and ``hg``. + +%prep +%setup -q -n jirafs-%{version} +%autopatch -p1 + +%build +%python_build + +%install +%python_install +%{python_expand rm -rf %{buildroot}%{$python_sitelib}/tests +%fdupes %{buildroot}%{$python_sitelib} +} + +%check +# Tests fail gh#coddingtonbear/jirafs#50 +%python_exec -munittest discover -v || /bin/true + +%files %{python_files} +%python3_only %{_bindir}/jirafs +%{python_sitelib}/* + +%changelog diff --git a/verlib.patch b/verlib.patch new file mode 100644 index 0000000..3f16da5 --- /dev/null +++ b/verlib.patch @@ -0,0 +1,98 @@ +--- a/jirafs/cmdline.py ++++ b/jirafs/cmdline.py +@@ -16,7 +16,7 @@ except ImportError: + from jira.exceptions import JIRAError + import six + from six.moves import shlex_quote +-from verlib import NormalizedVersion ++from distutils.version import LooseVersion + + from . import utils + from .exceptions import ( +@@ -43,7 +43,7 @@ def main(): + "any version of Python 3. Please upgrade your version of " + "python before using Jirafs." + ) +- if utils.get_git_version() < NormalizedVersion('1.8'): ++ if utils.get_git_version() < LooseVersion('1.8'): + raise RuntimeError( + "Jirafs requires minimally version 1.8 of Git. Please " + "upgrade your version of git before using Jirafs." +--- a/jirafs/plugin.py ++++ b/jirafs/plugin.py +@@ -9,7 +9,7 @@ import sys + + from blessings import Terminal + import six +-from verlib import NormalizedVersion ++from distutils.version import LooseVersion + + from . import __version__ + +@@ -120,9 +120,9 @@ class JirafsPluginBase(object): + "Minimum and maximum version numbers not specified." + ) + +- min_version = NormalizedVersion(self.MIN_VERSION) +- max_version = NormalizedVersion(self.MAX_VERSION) +- curr_version = NormalizedVersion(__version__) ++ min_version = LooseVersion(self.MIN_VERSION) ++ max_version = LooseVersion(self.MAX_VERSION) ++ curr_version = LooseVersion(__version__) + if not min_version <= curr_version <= max_version: + raise PluginValidationError( + "Plugin '%s' is not compatible with version %s of Jirafs; " +--- a/jirafs/utils.py ++++ b/jirafs/utils.py +@@ -8,7 +8,7 @@ import subprocess + + from jira.client import JIRA + from six.moves import configparser, input +-from verlib import NormalizedVersion ++from distutils.version import LooseVersion + + from . import constants + from .plugin import CommandPlugin, Plugin +@@ -270,7 +270,7 @@ def get_git_version(): + stderr=subprocess.PIPE, + ).decode('utf8') + version_string = re.match('git version ([0-9.]+).*', result).group(1) +- return NormalizedVersion(version_string) ++ return LooseVersion(version_string) + + + def lazy_get_jira(): +--- a/requirements.txt ++++ b/requirements.txt +@@ -2,6 +2,5 @@ jira>=1.0.3 + six>=1.9.0 + blessings>=1.5.1,<2.0 + ipdb>=0.8,<1.0 +-verlib>=0.1,<1.0 + PrettyTable>=0.7.2,<1.0 + environmental-override>=0.1.2 +--- a/tests/test_utils.py ++++ b/tests/test_utils.py +@@ -1,6 +1,6 @@ + import mock + +-from verlib import NormalizedVersion ++from distutils.version import LooseVersion + + from jirafs import utils + +@@ -43,7 +43,7 @@ class TestParseGitVersion(BaseTestCase): + + actual_version = utils.get_git_version() + +- self.assertEqual(actual_version, NormalizedVersion("1.8.5.2")) ++ self.assertEqual(actual_version, LooseVersion("1.8.5.2")) + + @mock.patch("jirafs.utils.subprocess.check_output") + def test_parse_linux_git_version(self, git_version_output): +@@ -51,4 +51,4 @@ class TestParseGitVersion(BaseTestCase): + + actual_version = utils.get_git_version() + +- self.assertEqual(actual_version, NormalizedVersion("1.9.1")) ++ self.assertEqual(actual_version, LooseVersion("1.9.1"))