[python-parse_type] Initial import of the package after the package review.

Matej Cepl mcepl at fedoraproject.org
Mon Jul 21 15:34:29 UTC 2014


commit 5eb4bfabf425cd71285cd538898c3712bb6bf37c
Author: Matěj Cepl <mcepl at redhat.com>
Date:   Mon Jul 21 17:34:06 2014 +0200

    Initial import of the package after the package review.

 .gitignore             |    1 +
 parse_type-build.patch |   63 ++++++++++++++++++++++++
 python-parse_type.spec |  123 ++++++++++++++++++++++++++++++++++++++++++++++++
 sources                |    1 +
 4 files changed, 188 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..1540e4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/parse_type-0.3.4.tar.gz
diff --git a/parse_type-build.patch b/parse_type-build.patch
new file mode 100644
index 0000000..898419f
--- /dev/null
+++ b/parse_type-build.patch
@@ -0,0 +1,63 @@
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,6 +1,6 @@
+ [aliases]
+ docs = build_sphinx
+-test = ptr
++#test = ptr
+
+ [build_sphinx]
+ source-dir = docs/
+--- a/pytest.ini
++++ /dev/null
+@@ -1,22 +0,0 @@
+-# ============================================================================
+-# PYTEST CONFIGURATION FILE: pytest.ini
+-# ============================================================================
+-# SEE ALSO:
+-#  * http://pytest.org/
+-#  * http://pytest.org/customize.html
+-#  * http://pytest.org/example/pythoncollection.html#change-naming-conventions
+-# ============================================================================
+-# MORE OPTIONS:
+-#  addopts =
+-#  python_classes=*Test
+-#  python_functions=test
+-# ============================================================================
+-
+-[pytest]
+-minversion   = 2.3
+-norecursedirs= .git .tox build dist tmp* _*
+-python_files = test_*.py
+-
+-# usefixtures  = tmpdir
+-# markers =
+-#    xxx: mark an experimental test.
+--- a/setup.py
++++ b/setup.py
+@@ -53,8 +53,7 @@ extra = dict(
+     extras_require = {
+         'docs':    ["sphinx>=1.1"],
+         'develop': [
+-            "coverage", "pytest", "pytest-cov",
+-            "pytest-runner",
++            "coverage",
+             "tox",
+         ],
+     },
+@@ -70,15 +69,6 @@ if python_version < 2.7:
+ if python_version >= 3.0:
+     extra["use_2to3"] = True
+
+-# -- NICE-TO-HAVE:
+-# # FILE: setup.cfg -- Use pytest-runner (ptr) as test runner.
+-# [aliases]
+-# test = ptr
+-USE_PYTEST_RUNNER = os.environ.get("PYSETUP_TEST", "pytest") == "pytest"
+-if USE_PYTEST_RUNNER:
+-    extra["tests_require"].extend(["pytest", "pytest-runner"])
+-
+-
+ # -----------------------------------------------------------------------------
+ # SETUP:
+ # -----------------------------------------------------------------------------
diff --git a/python-parse_type.spec b/python-parse_type.spec
new file mode 100644
index 0000000..c76acb9
--- /dev/null
+++ b/python-parse_type.spec
@@ -0,0 +1,123 @@
+%if 0%{?fedora} >= 11
+%bcond_without python3
+%else
+%bcond_with python3
+%endif
+
+%global modname parse_type
+
+Name:               python-%{modname}
+Version:            0.3.4
+Release:            1%{?dist}
+Summary:            Simplifies to build parse types based on the parse module
+
+Group:              Development/Libraries
+License:            BSD
+URL:                http://pypi.python.org/pypi/parse_type
+Source0:            http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz
+Patch0:             parse_type-build.patch
+
+BuildArch:          noarch
+BuildRequires:      python2-devel, python-setuptools
+BuildRequires:      python-six, python-parse >= 1.6
+BuildRequires:      python-sphinx >= 1.1
+%if 0%{?rhel} <= 6
+BuildRequires:      python-unittest2
+%endif
+BuildRequires:      python-enum34
+
+%if %{with python3}
+BuildRequires:      python3-devel
+BuildRequires:      python3-six, python3-parse >= 1.6, python3-enum34
+BuildRequires:      python3-sphinx >= 1.1, python3-setuptools, python3-enum34
+%endif
+Requires:           python-six, python-parse >= 1.6, python-enum34
+
+%description
+`parse_type`_ extends the `parse`_ module (opposite of
+`string.format()`_) with the following features:
+
+    * build type converters for common use cases (enum/mapping, choice)
+    * build a type converter with a cardinality constraint (0..1,
+      0..*, 1..*) from the type converter with cardinality=1.
+    * compose a type converter from other type converters
+    * an extended parser that supports the CardinalityField naming
+      schema and creates missing type variants (0..1, 0..*, 1..*) from
+      the primary type converter
+
+
+%if %{with python3}
+%package -n python3-parse_type
+Summary:            Simplifies to build parse types based on the parse module
+Group:              Development/Libraries
+Requires:           python3-six, python3-parse >= 1.6, python3-enum34
+
+%description -n python3-parse_type
+`parse_type`_ extends the `parse`_ module (opposite of
+`string.format()`_) with the following features:
+
+    * build type converters for common use cases (enum/mapping, choice)
+    * build a type converter with a cardinality constraint (0..1,
+      0..*, 1..*) from the type converter with cardinality=1.
+    * compose a type converter from other type converters
+    * an extended parser that supports the CardinalityField naming
+      schema and creates missing type variants (0..1, 0..*, 1..*) from
+      the primary type converter
+
+This is the python3 version of the package.
+%endif
+
+%prep
+%setup -q -n %{modname}-%{version}
+%patch0 -p1
+
+# Remove bundled egg-info in case it exists
+rm -rf %{modname}.egg-info
+%if %{with python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
+%build
+%{__python} setup.py build
+%if %{with python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
+
+
+%install
+export PYSETUP_TEST="no"
+%if %{with python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
+popd
+%endif
+%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
+
+%check
+%{__python} setup.py test
+%if %{with python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
+
+%files
+%doc README.rst LICENSE
+%{python_sitelib}/%{modname}/
+%{python_sitelib}/%{modname}-%{version}*
+%{python_sitelib}/_paver_ext/
+
+%if %{with python3}
+%files -n python3-parse_type
+%doc README.rst LICENSE
+%{python3_sitelib}/%{modname}/
+%{python3_sitelib}/%{modname}-%{version}-*
+%{python3_sitelib}/_paver_ext/
+%endif
+
+%changelog
+* Thu Jun 19 2014 Matěj Cepl <mcepl at redhat.com> - 0.3.4-1
+- initial package for Fedora
diff --git a/sources b/sources
index e69de29..95c9aab 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+00ba70bc5ca67624207b0dfced01dc8a  parse_type-0.3.4.tar.gz


More information about the scm-commits mailing list