meta: require cargo2rpm >= 0.1.2 to fix edge case in "is-lib" checks

This commit is contained in:
Fabio Valentini 2023-02-16 21:39:51 +01:00
parent 64a3f39291
commit 9696550bb7
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF
4 changed files with 4 additions and 14 deletions

View file

@ -1,4 +1,4 @@
cargo2rpm
cargo2rpm>=0.1.2
jinja2
pyparsing
requests

View file

@ -1,7 +1,5 @@
"""
Functionality for rendering the spec file template.
FIXME: document which parameters the template actually uses
"""
import time
@ -13,7 +11,7 @@ import jinja2
from rust2rpm import __version__, log
from rust2rpm.licensing import translate_license
from rust2rpm.metadata import guess_main_package, package_uses_rust_1_60_feature_syntax, metadata_is_cdylib
from rust2rpm.metadata import guess_main_package, package_uses_rust_1_60_feature_syntax
def to_list(s):
@ -126,7 +124,7 @@ def spec_render_crate(
is_bin = metadata.is_bin()
is_lib = metadata.is_lib()
is_cdylib = metadata_is_cdylib(metadata)
is_cdylib = metadata.is_cdylib()
package = metadata.packages[0]
description = package.get_description()

View file

@ -1,14 +1,6 @@
from cargo2rpm.metadata import Metadata, Package
def metadata_is_cdylib(metadata: Metadata) -> bool:
for package in metadata.packages:
for target in package.targets:
if "cdylib" in target.kind and "cdylib" in target.crate_types:
return True
return False
def guess_main_package(metadata: Metadata) -> Package:
if not metadata.is_workspace():
return metadata.packages[0]

View file

@ -24,7 +24,7 @@ classifiers =
include_package_data = True
packages = rust2rpm
install_requires =
cargo2rpm
cargo2rpm>=0.1.2
jinja2
pyparsing
requests