15
0

- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-filetype?expand=0&rev=15
This commit is contained in:
2025-06-17 04:18:56 +00:00
committed by Git OBS Bridge
commit a76a921612
5 changed files with 266 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
filetype-1.2.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:66b56cd6474bf41d8c54660347d37afcc3f7d1970648de365c102ef77548aadb
size 998020

169
python-filetype.changes Normal file
View File

@@ -0,0 +1,169 @@
-------------------------------------------------------------------
Tue Jun 17 04:13:58 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject macros.
-------------------------------------------------------------------
Tue Apr 22 12:17:31 UTC 2025 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
-------------------------------------------------------------------
Mon Nov 7 23:01:24 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to 1.2.0
* Merge pull request #147 from sayanarijit/fix-146
* Add tests for m4a
* Try matching audio before video
* Merge pull request #145 from RSabet/master
* update README to include avif
* added image filetype avif
* Update __init__.py
* Merge pull request #141 from ferstar/master
* test: remove unused imported(F401)
* refactor: duck-typing reading magic string and try to restore the reader position if possible
* test: fix E275 missing whitespace after keyword
* test: Use tox pipeline instead of pytest
* test: ignore E501 error for flake8 check
* fix: CLI params parser
* Merge pull request #137 from ferstar/master
* fix: guess ".docx" func and add another doc file test case
* fix: guess ".doc" func and add another doc file test case
* test: skip benchmark test in tox config
* fix: restore reader position after retrieving signature bytes
* Merge pull request #136 from ferstar/master
* test: no need to skip zstd test case
* Merge pull request #135 from ferstar/master
* fix: regression for file-like obj file type detection
* Merge pull request #134 from babenek/actions
* Merge pull request #129 from ferstar/master
- Update to 1.1.0
* Merge branch 'master' into master
* Merge pull request #133 from magbyr/master
* Merge pull request #131 from babenek/master
* CI workflow in github actions
* Changed to if statements in matching method
* Changed return method because of coverage calculation problems
* Apply suggestions from code review
* README changes
* Linter changes
* Added document filetypes for doc, docx, odt, xls, xlsx, ods, ppt, pptx and odp. Added tests and sample documents for document filetypes
* Fix undocumented exception
* style: Simplify binary to integer method
* feat: add zstd skippable frames support
* test: fix the tox config and missing test sample files
* test: fix the zst test sample file
* fix(readme): rst syntax wtf
- Update to 1.0.13
* feat(history): update changes
- Update to 1.0.12
* Merge pull request #127 from ferstar/master
* Merge pull request #123 from levrik/patch-1
* Merge pull request #126 from babenek/master
* docs: add zstd type
* fix: remove unnecessary duck-typing try
* feat: add zst(d) type
* chore: fix lint errors
* test: fix memoryview test cases
* BugFix for uncaught exceptions
* Support PDF with BOM
- Update to 1.0.11
* chore(version): bump patch
* chore(version): bump patch
* refactor(apng)
* refactor(apng)
* Merge pull request #120 from CatKasha/apng
* fix typo
* add APNG support (part 3)
* add APNG support (part 2)
* add APNG support (part 1)
* chore(history): version notes
* Merge branch 'master' of https://github.com/h2non/filetype.py
* feat: version bump
* Merge pull request #118 from smasty/woff-flavors-support
* fix(font): minimum length check (woff)
* Update __init__.py
* Update setup.py
* Merge pull request #109 from fraang/master
* Add support for more WOFF/WOFF2 flavors
* Merge pull request #114 from andersk/m4a
* fix(base): remove property decorator
* Use correct audio/mp4 type for m4a.
-------------------------------------------------------------------
Sat Mar 26 21:27:14 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 1.0.10:
* Merge pull request #113 from nottaw/master
* Use `==` for string comparisons
* Update __init__.py
* Merge pull request #111 from asfaltboy/patch-1
* Add python 3.9 to version classifiers
* Merge pull request #108 from hannesbraun/aiff-support
* Add AIFF support
* fix(Readme): rst syntax
-------------------------------------------------------------------
Mon Nov 22 17:51:22 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Restrict more which files are packaged.
-------------------------------------------------------------------
Mon Nov 22 13:19:36 UTC 2021 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- update to 1.0.8:
* docs: fix typos: s/againts/against
* Support special video/3gp file.
* fix: small error in docs
* Fix for PEP8 styles
* Fix version
* Add command line
* Fix linter error.
* Add xcf type.
* Add application abstraction and wasm type.
* Add rpm and dcm type.
* Add 3gp type.
* Add aac type.
* Add dwg type.
* Add brotli support.
* Fix avi matcher.
* Fix cr2 handling.
* Add py39 to test environment.
* Add clean and doc target to tox.
* Add docs to .gitignore
* Switch to tox in travis CI.
* Add lint and test target to tox.ini
* Clean up .gitignore
* Update Readme.
* Extend mp3 matcher
* Added support for lzop.
* Added support for lz4.
* Accept os.PathLike objects.
* Added support for elf
* setup.py: Exclude 'examples' from being installed as a global pkg
* Create LICENSE
* Add sample.jpg fixture
- Install new filetype command into %{_bindir}
- Enable update-alternatives mechanism for filetype command
-------------------------------------------------------------------
Thu Sep 17 06:46:46 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 1.0.7:
* python 3.8 support
-------------------------------------------------------------------
Thu Jan 2 07:33:43 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Do not install generic examples directory in sitelib
-------------------------------------------------------------------
Fri Dec 6 20:53:47 UTC 2019 - Erico Mendonca <erico.mendonca@suse.com>
- Initial version.

70
python-filetype.spec Normal file
View File

@@ -0,0 +1,70 @@
#
# spec file for package python-filetype
#
# Copyright (c) 2025 SUSE LLC
#
# 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/
#
%{?sle15_python_module_pythons}
Name: python-filetype
Version: 1.2.0
Release: 0
Summary: Infer file type and MIME type of any file/buffer. No external dependencies
License: MIT
URL: https://github.com/h2non/filetype.py
Source: https://files.pythonhosted.org/packages/source/f/filetype/filetype-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
Small and dependency free `Python`_ package to infer file type and MIME
type checking the `magic numbers`_ signature of a file or buffer.
This is a Python port from `filetype`_ Go package.
%prep
%setup -q -n filetype-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/filetype
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m unittest discover -v
%post
%python_install_alternative filetype
%postun
%python_uninstall_alternative filetype
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/filetype
%{python_sitelib}/filetype-%{version}.dist-info
%python_alternative %{_bindir}/filetype
%changelog