14
0
Files
python-fawltydeps/python-fawltydeps.spec

95 lines
3.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-fawltydeps
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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-fawltydeps
- update to 0.20.0: * When FawltyDeps finds a 3rd-party `import` that is not declared, it will output that import name as an undeclared dependency. But as we've talked about before, _import_ names in Python are not necessarily synonymous with the _package_ names that you would have to declare in order to make those import names available. * For example, if you `import sklearn` in your code, it might not be obvious that the corresponding dependency declaration should be `scikit-learn`, and not `sklearn`. * Starting with this version, if you run FawltyDeps with the `--detailed` option, _and_ if there happens to be one or more (undeclared) packages in your Python environment that provide the relevant import name, then FawltyDeps will suggest these packages as potential solutions to your undeclared dependency. * By default (and before this release) FawltyDeps looks at the paths on the command-line to deduce where 1st-party imports (i.e. your project's own modules) can be found. In some corner cases this deduction fails, and the result is typically that a 1st-party import is flagged by FawltyDeps as an undeclared dependency. * The new `--base-dir` allows you to control where FawltyDeps looks for 1st-party imports, and it can help fix those cases where the default deduction fails, for example in cases where you are passing individual file names (instead of directory names) on the FawltyDeps command line. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fawltydeps?expand=0&rev=9
2025-07-13 12:16:48 +00:00
Version: 0.20.0
Release: 0
Summary: Find undeclared and unused 3rd-party dependencies in your Python project
License: MIT
URL: https://github.com/tweag/FawltyDeps
Source: https://github.com/tweag/FawltyDeps/archive/refs/tags/v%{version}.tar.gz#/fawltydeps-%{version}.tar.gz
BuildRequires: %{python_module PyYAML >= 6.0.1}
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module importlib-metadata >= 6.6.0}
BuildRequires: %{python_module isort > 5.10}
BuildRequires: %{python_module nox}
BuildRequires: %{python_module packaging >= 24.0}
BuildRequires: %{python_module pip-requirements-parser >= 32.0.1}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry-core}
BuildRequires: %{python_module pydantic >= 1.10.4}
BuildRequires: fdupes
Requires: python-PyYAML >= 6.0.1
Requires: python-importlib-metadata >= 6.6.0
Requires: python-isort > 5.10
Requires: python-packaging
Requires: python-pip-requirements-parser
Requires: python-pydantic
Requires(post): update-alternatives
Requires(postun): update-alternatives
Suggests: python-uv
# TEST dependencies
BuildRequires: %{python_module pytest >= 7.1.0}
BuildArch: noarch
%if "%{python_flavor}" < "python311"
BuildRequires: %{python_module tomli >= 2.0.1}
%endif
%python_subpackages
%description
Find undeclared and unused 3rd-party dependencies in your Python project.
%prep
%autosetup -p1 -n FawltyDeps-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/fawltydeps
%{python_expand %fdupes %{buildroot}%{$python_sitelib}}
%check
# integration testsuite requires network for downloading project tarballs
# disable tests that require network
skiptests="test_resolve_dependencies_install_deps__via_local_cache"
skiptests+=" or test_resolve_dependencies_install_deps__raises_unresolved_error_on_install_failure"
skiptests+=" or test_resolve_dependencies_install_deps__unresolved_error_only_warns_failing_packages"
skiptests+=" or test_resolve_dependencies_install_deps_on_mixed_packages__raises_unresolved_error"
skiptests+=" or test_resolve_dependencies__generates_expected_mappings"
%pytest -k "not ($skiptests)"
%post
%python_install_alternative fawltydeps
%postun
%python_uninstall_alternative fawltydeps
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/fawltydeps
%{python_sitelib}/fawltydeps
%{python_sitelib}/fawltydeps-%{version}.dist-info
%changelog