14
0

- Update to 0.4.25:

- Support file 5.41. 
  - Support os.PathLike types 
  - Fix compat mode handling with empty mime string 
  - Cleanup library loading 
  - add py.typed sentinal per https://www.python.org/dev/peps/pep-0561/#p… 
  - Check for cookie attribute before trying to delete it
  - Revert "Fix bug in Magic when destructor called too early" 
  - Fix yet another import error
  - add more doc pointers for compat mode, and enable PendingDeprecationW…
  - restore python 2.7 to setup.py, to preserve back compat
  - document libmagic compat layer
  - prefix add_compat with an underscore to avoid namespace pollution
  - remove from_open_file, since its duplicative with from_descriptor and…
  - move typing stubs next to implementation
  - temorarily remove dropped support for python2
  - Revert "Remove Python2 from the tests"
  - Merge branch 'master' into redo-compat
  - Remove Python2 from the tests
  - Add support for Python 3.9
  - Added support for magic_descriptor routine
  - Handle undecodable characters in description
  - Handle libmagic versions that don't support MAGIC_EXTENSION 
  - MAGIC_EXTENSION support (file --extension)
  - support changed mime types in test
  - Fix tests with file 5.39
  - add docker tests for archlinux
  - Fallback to default behavior on setparam failure
  - Fix bug in Magic when destructor called too early
  - sheep Create basic stub file for magic.py

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-magic?expand=0&rev=19
This commit is contained in:
2022-02-16 18:13:57 +00:00
committed by Git OBS Bridge
parent 35a9daa942
commit c9f0ca09c5
8 changed files with 55 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-python-magic
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,30 +19,24 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name: python-python-magic
Version: 0.4.18
Version: 0.4.25
Release: 0
Summary: File type identification using libmagic
License: Python-2.0
Group: Development/Languages/Python
URL: https://github.com/ahupp/python-magic
Source: https://github.com/ahupp/python-magic/archive/%{version}.tar.gz
#PATCH-FIX-OPENSUSE fix-test.patch -- adapt file outputs to opensuse
Patch0: fix-test.patch
Patch1: fix-test-tumbleweed.patch
Patch2: fix-4-file-5.40.patch
Patch3: fix-support-file-5.41.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: file
BuildRequires: python-rpm-macros
Requires: file
# python-python-magic and python-magic use the same namespace (ie. filename)
# and have a very similar functionality but are incompatible to each other.
# https://github.com/ahupp/python-magic/issues/21
Conflicts: python-magic
Provides: python-magic
BuildArch: noarch
%ifpython2
Conflicts: %{oldpython}-magic
Provides: %{oldpython}-magic
%endif
%python_subpackages
@@ -53,25 +47,12 @@ supports both textual and MIME-type output.
%prep
%setup -q -n python-magic-%{version}
%if 0%{?suse_version} > 1500
# Tumbleweed
%patch1 -p1
%elif 0%{?sle_version} < 150300 && 0%{?is_opensuse}
# Leap 15.2 and older
%patch0 -p1
%endif
%if %{?pkg_vcmp:%{pkg_vcmp file >= 5.40}}%{!?pkg_vcmp:0}
%patch2 -p0
%endif
%if %{?pkg_vcmp:%{pkg_vcmp file >= 5.41}}%{!?pkg_vcmp:0}
%patch3 -p1
%endif
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -81,8 +62,7 @@ export LC_ALL=en_US.UTF-8
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/magic.py*
%pycache_only %{python_sitelib}/__pycache__/magic*.py*
%{python_sitelib}/python_magic-%{version}-py*.egg-info
%{python_sitelib}/magic
%{python_sitelib}/python_magic-%{version}*-info
%changelog