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:
parent
51682db33e
commit
384f54769f
2
spec/fixtures/python/requirements.txt
vendored
2
spec/fixtures/python/requirements.txt
vendored
@ -1,2 +1,4 @@
|
||||
rtxt-dep1 > 0.1
|
||||
rtxt-dep2 == 0.1
|
||||
rtxt-dep3; python_version == "2.0"
|
||||
rtxt-dep4; python_version > "2.0"
|
||||
|
6
spec/fixtures/python/setup.py
vendored
6
spec/fixtures/python/setup.py
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user