## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec Name: python-trimesh Version: 3.18.3 Release: %autorelease Summary: Import, export, process, analyze and view triangular meshes # The entire source is (SPDX) MIT, except: # - trimesh/transformations.py is BSD-3-Clause # - trimesh/exchange/openctm.py is Zlib # Additionally, the following are under the same (SPDX) MIT license as the # overall source, but with a different copyright statement: License: MIT AND BSD-3-Clause AND Zlib URL: https://trimsh.org Source0: https://github.com/mikedh/trimesh/archive/%{version}/trimesh-%{version}.tar.gz # The combination of an arched package with only noarch binary packages makes # it easier for us to detect arch-dependent test failures, since the tests will # always be run on every platform, and easier for us to skip failing tests if # necessary, since we can be sure that %%ifarch macros work as expected. # # Since the package still contains no compiled machine code, we still have no # debuginfo. %global debug_package %{nil} # Turn off automatic python byte-compilation. One .py file, # trimesh/resources/templates/blender_boolean.py, is actually a *template for a # Python source* rather than an *actual Python source*, and trying to # byte-compile it will break the build. We will byte-compile manually instead. %undefine __brp_python_bytecompile BuildRequires: python3-devel # See the definition of requirements_test, which corresponds to the “test” # extra, in setup.py; however, we do not generate BuildRequires from the “test” # extra because most of the dependencies are for linting or coverage and would # need to be patched out: # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters # # run all unit tests BuildRequires: python3dist(pytest) # use as a validator for exports BuildRequires: python3dist(ezdxf) # Run tests in parallel: BuildRequires: python3dist(pytest-xdist) # Command-line tools that are (optional) test dependencies: # # tests/test_export.py, tests/generic.py # Meshlab Server Does Not Work With XVFB # https://github.com/cnr-isti-vclab/meshlab/issues/237 # Upstream closed as WONTFIX #BuildRequires: /usr/bin/xvfb-run #BuildRequires: /usr/bin/meshlabserver # tests/test_gltf.py # Not yet packaged: https://github.com/KhronosGroup/glTF-Validator #BuildRequires: /usr/bin/gltf_validator %global _description %{expand: Trimesh is a pure Python library for loading and using triangular meshes with an emphasis on watertight meshes. The goal of the library is to provide a fully featured and well tested Trimesh object which allows for easy manipulation and analysis, in the style of the Polygon object in the Shapely library.} %description %{_description} %package -n python3-trimesh Summary: %{summary} BuildArch: noarch Recommends: python3-trimesh+easy = %{version}-%{release} Suggests: python3-trimesh+all = %{version}-%{release} # A number of external command-line executables provide optional functionality. # We choose to make these weak dependencies (Recommends). Hints (Suggests) # would also be justifiable—although it should be noted that dnf does not do # anything with hints. Any weak dependencies should also be BuildRequires so # that their satisfiability is verified at build time; some may also enable # additional tests. # # trimesh.exchange.binvox # Cannot be packaged (closed-source): https://www.patrickmin.com/binvox/ #BuildRequires: /usr/bin/binvox #Recommends: /usr/bin/binvox # trimesh.interfaces.blender %ifnarch %{ix86} BuildRequires: /usr/bin/blender Recommends: /usr/bin/blender %endif # trimesh.exchange.ply %ifnarch s390x # ExportTest.test_export fails with: # subprocess.CalledProcessError: Command '['/usr/bin/draco_encoder', '-qp', # '28', '-i', '/tmp/tmpd1uz557y.ply', '-o', '/tmp/tmpkbowi3es.drc']' died # with . # and stderr is: # terminate called after throwing an instance of 'std::bad_alloc' # what(): std::bad_alloc # See also: # gtest failure on s390x # https://bugzilla.redhat.com/show_bug.cgi?id=2165173 # We conclude that draco is not necessarily usable on this platform. BuildRequires: /usr/bin/draco_decoder Recommends: /usr/bin/draco_decoder BuildRequires: /usr/bin/draco_encoder Recommends: /usr/bin/draco_encoder %endif # “openscad”: trimesh.interfaces.scad # Library would also recognize “OpenSCAD” %ifnarch %{ix86} BuildRequires: /usr/bin/openscad Recommends: /usr/bin/openscad %endif # trimesh.interfaces.vhacd # Not yet packaged: https://github.com/kmammou/v-hacd # Library would also recognize “vhacd” or “testVHACD” #BuildRequires: /usr/bin/TestVHACD #Recommends: /usr/bin/TestVHACD # This probably should be in [easy] extra but isn’t in the metadata at all; see # README.rst and trimesh/ray/. However, it cannot be packaged until it supports # the current version (3.x) of embree # (https://github.com/scopatz/pyembree/issues/28). #Recommends: python3dist(pyembree) %description -n python3-trimesh %{_description} %if 0%{?fedora} > 38 %pyproject_extras_subpkg -n python3-trimesh easy all %else # We base these extras metapackages # (https://fedoraproject.org/wiki/Changes/PythonExtras#Extras_metapackages) # on the expansion of: # # %%pyproject_extras_subpkg -n python3-trimesh easy all # # but add Provides/Obsoletes for the corresponding old subpackages to provide a # clean upgrade path. %package -n python3-trimesh+easy Summary: Metapackage for python3-trimesh: easy extras BuildArch: noarch Requires: python3-trimesh = %{version}-%{release} Provides: python3-trimesh-easy = %{version}-%{release} Obsoletes: python3-trimesh-easy < 3.9.20-4 %description -n python3-trimesh+easy This is a metapackage bringing in easy extras requires for python3-trimesh. It makes sure the dependencies are installed. %files -n python3-trimesh+easy %ghost %{python3_sitelib}/*.dist-info %package -n python3-trimesh+all Summary: Metapackage for python3-trimesh: all extras BuildArch: noarch Requires: python3-trimesh = %{version}-%{release} Provides: python3-trimesh-all = %{version}-%{release} Obsoletes: python3-trimesh-all < 3.9.20-4 %description -n python3-trimesh+all This is a metapackage bringing in all extras requires for python3-trimesh. It makes sure the dependencies are installed. %files -n python3-trimesh+all %ghost %{python3_sitelib}/*.dist-info %endif # We elect not to build a documentation package, for the following reasons: # # 1. A (relatively simple) patch is required to build them offline without # pip-installing requirements from PyPI. # 2. The documentation includes notebooks translated to HTML from .ipynb # using nbconvert. # a. Some conversions fail (wholly or on a per-cell basis, if continuing # on errors is requested) in architecture-dependent ways. This means # that the contents of the documentation package would depend on the # builder architecture, and it could not be noarch—an undesirable # situation. # b. An “HTML-ified” notebook contains a blob of JavaScript and other # web assets that is exceptionally difficult (at best, tedious) to # account for under current bundling guidelines. # 3. Sphinx-generated HTML documentation is not suitable for packaging in # general—see https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for # discussion—and (because of the notebooks, if nothing else) the trimesh # documentation is not well-suited to building as a PDF instead of HTML. %prep %autosetup -n trimesh-%{version} -p1 # Patch out unavailable dependencies from “extras”: # # [all] # glooey: not yet packaged, https://github.com/kxgames/glooey; needs fonts # that are not currently packaged unbundled from its assets sed -r -i "/^[[:blank:]]*'glooey',/d" setup.py # meshio: not yet packaged, https://github.com/nschloe/meshio sed -r -i "/^[[:blank:]]*'meshio',/d" setup.py # python-fcl: not yet packaged; upstream is not compatible with the current # release of fcl, # https://github.com/BerkeleyAutomation/python-fcl/issues/19 sed -r -i "/^[[:blank:]]*'python-fcl',/d" setup.py # xatlas: not yet packaged, https://github.com/mworchel/xatlas-python; # depends on https://github.com/jpcy/xatlas, also not yet packaged sed -r -i "/^[[:blank:]]*'xatlas',/d" setup.py # Stub out unavailable pyinstrument test dependency; we don’t really need to do # profiling anyway. Note that this does mean that API function # trimesh.viewer.windowed.SceneViewer(…) will not work with “profile=True”. # # Packaging pyinstrument would be difficult due to a vue.js-based HTML # renderer. Since guidelines forbid pre-built minified or compiled JS or CSS, # this would have to be patched out, or the web asset pipeline would have to be # somehow executed in the RPM build environment. (Or, of course, we can # continue to do without pyinstrument.) mkdir -p _stub cat > _stub/pyinstrument.py <<'EOF' class Profiler(object): def __enter__(self, *args, **kwds): return self def __exit__(self, *args, **kwds): return False def output_text(self, *args, **kwds): return """ Profiling output would be here if pyinstrument were available. """ EOF sed -r -i "/'pyinstrument',/d" setup.py %generate_buildrequires %pyproject_buildrequires -x all %build %pyproject_wheel %install %pyproject_install # Manual byte-compile, to skip that one troublesome “.py” template file: find '%{buildroot}%{python3_sitelib}/trimesh' -type f \ -name '*.py' ! -name 'blender_boolean.py' | while read -r pyfile do %py_byte_compile %{__python3} "${pyfile}" done # Cannot handle skipping byte-compilation for blender_boolean.py: #pyproject_save_files trimesh %check while read -r t do k="${k-}${k+ and }not ($(sed -r 's/::/ and /' <<<"${t}"))" done < <(sed -r '/^[[:blank:]]*($|#)/d' <<'EOF' %ifnarch x86_64 # CacheTest.test_hash fails, or may fail, because xxhash is not faster than CRC # and/or MD5. # # This is not as intended, and upstream might or might not care, but it’s only # a performance defect, so we just skip the test here. CacheTest::test_hash %endif %ifarch s390x # Several test failures remain on s390x. For now, we choose to skip these tests # rather than excluding the architecture, even though they certainly represent # real defects. # # https://github.com/mikedh/trimesh/issues/1351 # https://github.com/mikedh/trimesh/files/7385479/test-failures.log GLTFTest::test_export_custom_attributes OBJTest::test_vertex_color PermutateTest::test_permutate PlyTest::test_face_attributes PlyTest::test_vertex_attributes %endif # 32-bit problems: # https://github.com/mikedh/trimesh/issues/690 # https://github.com/mikedh/trimesh/files/7389423/test-failures.log # E TypeError: Cannot cast array data from dtype('int64') to # dtype('int32') according to the rule 'safe' %if 0%{?__isa_bits} == 32 BinvoxTest::test_load_save_invariance BoundsTest::test_bounding_egg ContainsTest::test_inside EncodingTest::test_composite EncodingTest::test_dense EncodingTest::test_flat EncodingTest::test_flipped EncodingTest::test_reshape EncodingTest::test_transpose NearestTest::test_coplanar_signed_distance PrimitiveTest::test_cyl_buffer RayTests::test_contain_single RayTests::test_contains RayTests::test_on_edge RayTests::test_on_vertex RleTest::test_brle_encode_decode RleTest::test_brle_length RleTest::test_brle_logical_not RleTest::test_brle_to_dense RleTest::test_brle_to_rle RleTest::test_rle_encode_decode SubdivideTest::test_loop_correct VoxelGridTest::test_local VoxelGridTest::test_roundtrip %endif # Either MemoryError or numpy.core._exceptions._ArrayMemoryError: %if 0%{?__isa_bits} == 32 GLTFTest::test_basic GLTFTest::test_merge_buffers MutateTests::test_not_mutated_cube SubDivideTest::test_subdivide SceneTests::test_scene %endif EOF ) export PYTHONPATH="${PWD}/_stub:%{buildroot}%{python3_sitelib}" %pytest -v -k "${k-}" -n auto %files -n python3-trimesh %license LICENSE.md %doc README.md # %%pyproject_save_files cannot handle skipping byte-compilation for # blender_boolean.py, so we list files manually: %{python3_sitelib}/trimesh %{python3_sitelib}/trimesh-%{version}.dist-info %changelog * Mon Feb 06 2023 Benjamin A. Beasley 3.18.3-2 - Add BR’s/Recommends on CLI tools that enable functionality * Wed Feb 01 2023 Benjamin A. Beasley 3.18.3-1 - Update to 3.18.3 (close RHBZ#2166465) * Tue Jan 31 2023 Benjamin A. Beasley 3.18.2-1 - Update to 3.18.2 (close RHBZ#2166126) * Tue Jan 31 2023 Benjamin A. Beasley 3.18.1-3 - Run tests in parallel * Fri Jan 20 2023 Fedora Release Engineering 3.18.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Jan 17 2023 Benjamin A. Beasley 3.18.1-1 - Update to 3.18.1 (close RHBZ#2161430) * Wed Jan 11 2023 Benjamin A. Beasley 3.18.0-1 - Update to 3.18.0 (close RHBZ#2159904) * Fri Dec 02 2022 Benjamin A. Beasley 3.17.1-1 - Update to 3.17.1 (close RHBZ#2150384) * Thu Dec 01 2022 Benjamin A. Beasley 3.17.0-2 - Skip a new 32-bit test failure * Thu Dec 01 2022 Benjamin A. Beasley 3.17.0-1 - Update to 3.17.0 (close RHBZ#2150113) * Thu Nov 17 2022 Benjamin A. Beasley 3.16.4-1 - Update to 3.16.4 (close RHBZ#2143778) * Wed Nov 16 2022 Benjamin A. Beasley 3.16.3-1 - Update to 3.16.3 (close RHBZ#2143124) * Mon Nov 14 2022 Benjamin A. Beasley 3.16.2-1 - Update to 3.16.2 (close RHBZ#2141880) * Thu Nov 10 2022 Benjamin A. Beasley 3.16.1-1 - Update to 3.16.1 (close RHBZ#2140244) * Sat Oct 29 2022 Benjamin A. Beasley 3.15.8-1 - Update to 3.15.8 (close RHBZ#2137692) * Fri Oct 14 2022 Benjamin A. Beasley 3.15.5-1 - Update to 3.15.5 (close RHBZ#2133939) * Thu Oct 06 2022 Benjamin A. Beasley 3.15.3-1 - Update to 3.15.3 (close RHBZ#2131810) * Thu Sep 22 2022 Benjamin A. Beasley 3.15.2-1 - Update to 3.15.2 (close RHBZ#2129188) * Sat Sep 17 2022 Benjamin A. Beasley 3.15.1-1 - Update to 3.15.1 (close RHBZ#2127530) - No longer have to patch out triangle dep.; it was removed upstream * Sun Sep 04 2022 Benjamin A. Beasley 3.14.1-1 - Update to 3.14.1 (close RHBZ#2123861) * Tue Aug 23 2022 Benjamin A. Beasley 3.14.0-1 - Update to 3.14.0 (close RHBZ#2120444) * Thu Aug 18 2022 Benjamin A. Beasley 3.13.5-1 - Update to 3.13.5 (close RHBZ#2119211) * Fri Aug 12 2022 Benjamin A. Beasley 3.13.4-1 - Update to 3.13.4 (close RHBZ#2117782) * Thu Aug 11 2022 Benjamin A. Beasley 3.13.1-2 - Skip a new test failure on 32-bit architectures * Thu Aug 11 2022 Benjamin A. Beasley 3.13.1-1 - Update to 3.13.1 (close RHBZ#2115510) * Thu Aug 11 2022 Benjamin A. Beasley 3.12.9-3 - Update License to SPDX * Fri Jul 22 2022 Fedora Release Engineering 3.12.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jul 18 2022 Benjamin A. Beasley 3.12.9-1 - Update to 3.12.9 (close RHBZ#2103265) * Tue Jun 28 2022 Python Maint 3.12.6-3 - Rebuilt for Python 3.11 * Sat Jun 11 2022 Benjamin A. Beasley 3.12.6-2 - Update spec file comments about missing optional dependencies * Fri Jun 10 2022 Benjamin A. Beasley 3.12.6-1 - Update to 3.12.6 (close RHBZ#2095121) * Mon May 30 2022 Benjamin A. Beasley 3.12.5-1 - Update to 3.12.5 (close RHBZ#2088632) * Thu May 19 2022 Benjamin A. Beasley 3.12.1-1 - Update to 3.12.1 (close RHBZ#2088191) * Sat May 14 2022 Benjamin A. Beasley 3.12.0-1 - Update to 3.12.0 (close RHBZ#2082701) * Mon May 02 2022 Benjamin A. Beasley 3.11.2-3 - Revert "F37+: Exclude ix86 and stop tracking 32-bit problems (close RHBZ#2006452)" * Mon May 02 2022 Benjamin A. Beasley 3.11.2-2 - F37+: Exclude ix86 and stop tracking 32-bit problems (close RHBZ#2006452) * Sun May 01 2022 Benjamin A. Beasley 3.11.2-1 - Update to 3.11.2 (close RHBZ#2079076) * Tue Apr 12 2022 Benjamin A. Beasley 3.10.8-2 - Stop using “private” macro %%%%_pyproject_ghost_distinfo * Fri Apr 08 2022 Benjamin A. Beasley 3.10.8-1 - Update to 3.10.8 (close RHBZ#2073136) * Fri Mar 25 2022 Benjamin A. Beasley 3.10.7-1 - Update to 3.10.7 (close RHBZ#2068305) * Fri Mar 25 2022 Benjamin A. Beasley 3.10.5-2 - Remove workaround for RHBZ#2006090 * Fri Mar 18 2022 Benjamin A. Beasley 3.10.5-1 - Update to 3.10.5 (close RHBZ#2064832) * Fri Mar 04 2022 Benjamin A. Beasley 3.10.2-1 - Update to 3.10.2 (fix RHBZ#2057598); stop patching out ezdxf * Wed Feb 09 2022 Benjamin A. Beasley 3.10.0-1 - Update to 3.10.0 (close RHBZ#2046501) * Wed Feb 09 2022 Benjamin A. Beasley 3.9.43-1 - Update to 3.9.43 “fix build” * Wed Feb 09 2022 Benjamin A. Beasley 3.9.42-4 - Remove python-Rtree/spatialite workaround * Thu Feb 03 2022 Benjamin A. Beasley 3.9.42-3 - Restore mapbox-earcut dependency in “all” extra * Fri Jan 21 2022 Fedora Release Engineering 3.9.42-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Sun Jan 09 2022 Benjamin A. Beasley 3.9.42-1 - Update to 3.9.42 (close RHBZ#2037892) * Thu Jan 06 2022 Benjamin A. Beasley 3.9.40-1 - Update to 3.9.40 (close RHBZ#2037118) * Tue Jan 04 2022 Benjamin A. Beasley 3.9.39-1 - Update to 3.9.39 (close RHBZ#2036543) * Tue Jan 04 2022 Benjamin A. Beasley 3.9.36-2 - Fix missing %%%%autorelease * Fri Dec 10 2021 Benjamin A. Beasley 3.9.36-1 - Update to 3.9.36 (close RHBZ#2030500) * Thu Dec 09 2021 Benjamin A. Beasley 3.9.35-3 - Add link to python-vecrec review request * Fri Oct 29 2021 Benjamin A. Beasley - 3.9.35-1 - Update to 3.9.35 (close RHBZ#2018572) * Wed Oct 20 2021 Benjamin A. Beasley - 3.9.34-1 - Update to 3.9.34 - Use pyproject-rpm-macros - Update metapackages for PythonExtras Change (https://fedoraproject.org/wiki/Changes/PythonExtras#Extras_metapackages) - [easy] and [all] extras now require python3dist(xxhash) - Handle arch-specific test failures methodically - Update/correct license from “MIT” to “MIT and BSD and zlib” * Tue Jul 27 2021 Fedora Release Engineering - 3.9.20-3 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Sat Jun 26 2021 Ankur Sinha - 3.9.20-2 - Fix build: omit tests on 32 bit architectures * Thu Jun 17 2021 Ankur Sinha - 3.9.20-1 - Update to latest release * Fri Jun 04 2021 Python Maint - 3.8.17-3 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 3.8.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Dec 05 2020 Ankur Sinha - 3.8.17-1 - Update to latest patch release * Thu Oct 01 2020 Ankur Sinha - 3.8.10-1 - Update to latest release * Wed Jul 29 2020 Fedora Release Engineering - 3.6.34-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue May 26 2020 Miro Hrončok - 3.6.34-2 - Rebuilt for Python 3.9 * Fri May 01 2020 Ankur Sinha - 3.6.34-1 - Update to latest release * Fri Feb 21 2020 Ankur Sinha - 3.5.23-2 - Temporarily disable tests that fail on 32 bit builders - https://github.com/mikedh/trimesh/issues/690 * Fri Feb 21 2020 Ankur Sinha - 3.5.23-1 - Update to latest release * Thu Jan 30 2020 Fedora Release Engineering - 2.37.12-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Oct 29 2019 Miro Hrončok - 2.37.12-5 - Drop weak dependencies on packages not available in Fedora * Thu Oct 03 2019 Miro Hrončok - 2.37.12-4 - Rebuilt for Python 3.8.0rc1 (#1748018) * Mon Aug 19 2019 Miro Hrončok - 2.37.12-3 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 2.37.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Mar 16 2019 Miro Hrončok - 2.37.12-1 - Update to 2.37.12 (#1678964) * Mon Feb 18 2019 Lumír Balhar - 2.36.29-1 - Update to 2.36.29 (#1678054) * Sat Feb 16 2019 Zbigniew Jędrzejewski-Szmek - 2.36.28-1 - Update to 2.36.28 (#1677725) * Sun Feb 10 2019 Zbigniew Jędrzejewski-Szmek - 2.36.24-1 - Update to 2.36.24 (#1668080) * Sat Feb 02 2019 Fedora Release Engineering - 2.36.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Mon Jan 21 2019 Miro Hrončok - 2.36.13-1 - Update to 2.36.13 (#1667470) * Fri Nov 09 2018 Miro Hrončok - 2.35.24-1 - Update to 2.35.24 (#1648477) * Mon Sep 03 2018 Miro Hrončok - 2.33.12-1 - Update to 2.33.12 * Mon Sep 03 2018 Miro Hrončok - 2.33.11-1 - Initial package