summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-enum.spec204
-rw-r--r--sources1
3 files changed, 206 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..8d54a99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/enum-0.4.7.tar.gz
diff --git a/python-enum.spec b/python-enum.spec
new file mode 100644
index 0000000..2dd68ff
--- /dev/null
+++ b/python-enum.spec
@@ -0,0 +1,204 @@
+%global _empty_manifest_terminate_build 0
+Name: python-enum
+Version: 0.4.7
+Release: 1
+Summary: Robust enumerated type support in Python.
+License: GPL-3.0+
+URL: https://pypi.org/project/enum/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/02/a0/32e1d5a21b703f600183e205aafc6773577e16429af5ad3c3f9b956b07ca/enum-0.4.7.tar.gz
+BuildArch: noarch
+
+
+%description
+.. Important:: Superseded by Python standard library.
+
+ Python 3 now has in its standard library an `enum`_
+ implementation (also available for older Python versions as
+ the third-party `enum34`_ distribution) that supersedes this
+ library.
+
+ .. _enum: https://docs.python.org/3/library/enum.html
+ .. _enum34: https://pypi.org/project/enum34/
+
+This package provides a module for robust enumerations in Python.
+
+An enumeration object is created with a sequence of string arguments
+to the Enum() constructor::
+
+ >>> from enum import Enum
+ >>> Colours = Enum('red', 'blue', 'green')
+ >>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')
+
+The return value is an immutable sequence object with a value for each
+of the string arguments. Each value is also available as an attribute
+named from the corresponding string argument::
+
+ >>> pizza_night = Weekdays[4]
+ >>> shirt_colour = Colours.green
+
+The values are constants that can be compared only with values from
+the same enumeration; comparison with other values will invoke
+Python's fallback comparisons::
+
+ >>> pizza_night == Weekdays.fri
+ True
+ >>> shirt_colour > Colours.red
+ True
+ >>> shirt_colour == "green"
+ False
+
+Each value from an enumeration exports its sequence index
+as an integer, and can be coerced to a simple string matching the
+original arguments used to create the enumeration::
+
+ >>> str(pizza_night)
+ 'fri'
+ >>> shirt_colour.index
+ 2
+
+%package -n python3-enum
+Summary: Robust enumerated type support in Python.
+Provides: python-enum
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-enum
+.. Important:: Superseded by Python standard library.
+
+ Python 3 now has in its standard library an `enum`_
+ implementation (also available for older Python versions as
+ the third-party `enum34`_ distribution) that supersedes this
+ library.
+
+ .. _enum: https://docs.python.org/3/library/enum.html
+ .. _enum34: https://pypi.org/project/enum34/
+
+This package provides a module for robust enumerations in Python.
+
+An enumeration object is created with a sequence of string arguments
+to the Enum() constructor::
+
+ >>> from enum import Enum
+ >>> Colours = Enum('red', 'blue', 'green')
+ >>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')
+
+The return value is an immutable sequence object with a value for each
+of the string arguments. Each value is also available as an attribute
+named from the corresponding string argument::
+
+ >>> pizza_night = Weekdays[4]
+ >>> shirt_colour = Colours.green
+
+The values are constants that can be compared only with values from
+the same enumeration; comparison with other values will invoke
+Python's fallback comparisons::
+
+ >>> pizza_night == Weekdays.fri
+ True
+ >>> shirt_colour > Colours.red
+ True
+ >>> shirt_colour == "green"
+ False
+
+Each value from an enumeration exports its sequence index
+as an integer, and can be coerced to a simple string matching the
+original arguments used to create the enumeration::
+
+ >>> str(pizza_night)
+ 'fri'
+ >>> shirt_colour.index
+ 2
+
+%package help
+Summary: Development documents and examples for enum
+Provides: python3-enum-doc
+%description help
+.. Important:: Superseded by Python standard library.
+
+ Python 3 now has in its standard library an `enum`_
+ implementation (also available for older Python versions as
+ the third-party `enum34`_ distribution) that supersedes this
+ library.
+
+ .. _enum: https://docs.python.org/3/library/enum.html
+ .. _enum34: https://pypi.org/project/enum34/
+
+This package provides a module for robust enumerations in Python.
+
+An enumeration object is created with a sequence of string arguments
+to the Enum() constructor::
+
+ >>> from enum import Enum
+ >>> Colours = Enum('red', 'blue', 'green')
+ >>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')
+
+The return value is an immutable sequence object with a value for each
+of the string arguments. Each value is also available as an attribute
+named from the corresponding string argument::
+
+ >>> pizza_night = Weekdays[4]
+ >>> shirt_colour = Colours.green
+
+The values are constants that can be compared only with values from
+the same enumeration; comparison with other values will invoke
+Python's fallback comparisons::
+
+ >>> pizza_night == Weekdays.fri
+ True
+ >>> shirt_colour > Colours.red
+ True
+ >>> shirt_colour == "green"
+ False
+
+Each value from an enumeration exports its sequence index
+as an integer, and can be coerced to a simple string matching the
+original arguments used to create the enumeration::
+
+ >>> str(pizza_night)
+ 'fri'
+ >>> shirt_colour.index
+ 2
+
+%prep
+%autosetup -n enum-0.4.7
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-enum -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.7-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..1c346be
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+e7d170e3f84435b77058de625c96ef58 enum-0.4.7.tar.gz