1
0
mirror of https://github.com/jordansissel/fpm synced 2025-04-09 10:59:08 +02:00

Add tests for python PEP0508 tags

This commit is contained in:
Alexey Stepanov 2018-03-19 18:03:40 +01:00 committed by Jordan Sissel
parent 51682db33e
commit 384f54769f
3 changed files with 11 additions and 5 deletions

@ -1,2 +1,4 @@
rtxt-dep1 > 0.1
rtxt-dep2 == 0.1
rtxt-dep3; python_version == "2.0"
rtxt-dep4; python_version > "2.0"

@ -8,6 +8,10 @@ setup(name="Example",
url="sample url",
packages=[],
package_dir={},
install_requires=["Dependency1", "dependency2"],
install_requires=[
"Dependency1", "dependency2",
'rtxt-dep3; python_version == "2.0"',
'rtxt-dep4; python_version > "2.0"',
],
)

@ -146,13 +146,13 @@ describe FPM::Package::Python, :if => python_usable? do
it "it should prefix requirements.txt" do
subject.input(example_dir)
insist { subject.dependencies.sort } == ["python-rtxt-dep1 > 0.1", "python-rtxt-dep2 = 0.1"]
insist { subject.dependencies.sort } == ["python-rtxt-dep1 > 0.1", "python-rtxt-dep2 = 0.1", "python-rtxt-dep4 "]
end
it "it should exclude the dependency" do
subject.attributes[:python_disable_dependency] = "rtxt-dep1"
subject.input(example_dir)
insist { subject.dependencies.sort } == ["python-rtxt-dep2 = 0.1"]
insist { subject.dependencies.sort } == ["python-rtxt-dep2 = 0.1", "python-rtxt-dep4 "]
end
end
@ -163,13 +163,13 @@ describe FPM::Package::Python, :if => python_usable? do
it "it should load requirements.txt" do
subject.input(example_dir)
insist { subject.dependencies.sort } == ["rtxt-dep1 > 0.1", "rtxt-dep2 = 0.1"]
insist { subject.dependencies.sort } == ["rtxt-dep1 > 0.1", "rtxt-dep2 = 0.1", "rtxt-dep4 "]
end
it "it should exclude the dependency" do
subject.attributes[:python_disable_dependency] = "rtxt-dep1"
subject.input(example_dir)
insist { subject.dependencies.sort } == ["rtxt-dep2 = 0.1"]
insist { subject.dependencies.sort } == ["rtxt-dep2 = 0.1", "rtxt-dep4 "]
end
end
end