meta: require cargo2rpm >= 0.1.2 to fix edge case in "is-lib" checks
This commit is contained in:
parent
64a3f39291
commit
9696550bb7
4 changed files with 4 additions and 14 deletions
|
@ -1,4 +1,4 @@
|
|||
cargo2rpm
|
||||
cargo2rpm>=0.1.2
|
||||
jinja2
|
||||
pyparsing
|
||||
requests
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -24,7 +24,7 @@ classifiers =
|
|||
include_package_data = True
|
||||
packages = rust2rpm
|
||||
install_requires =
|
||||
cargo2rpm
|
||||
cargo2rpm>=0.1.2
|
||||
jinja2
|
||||
pyparsing
|
||||
requests
|
||||
|
|
Loading…
Reference in a new issue