-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the possibility to specify the pip version in virtual envs
- Loading branch information
1 parent
911daa0
commit 605c2ba
Showing
5 changed files
with
163 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Python::Venv::PipVersion' do | ||
describe 'valid values' do | ||
[ | ||
'< 1', | ||
'< 0.1', | ||
'< 1.2.3', | ||
'< 1.2.3.40', | ||
'<= 1', | ||
'<= 0.1', | ||
'<= 1.2.3', | ||
'<= 1.2.3.40', | ||
'> 1', | ||
'> 0.1', | ||
'> 1.2.3', | ||
'> 1.2.3.40', | ||
'>= 1', | ||
'>= 0.1', | ||
'>= 1.2.3', | ||
'>= 1.2.3.40', | ||
'== 1', | ||
'== 0.1', | ||
'== 1.2.3', | ||
'== 1.2.3.40', | ||
].each do |value| | ||
describe value.inspect do | ||
it { | ||
is_expected.to allow_value(value) | ||
} | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid values' do | ||
[ | ||
'+ 1', | ||
'- 0.1', | ||
'< -1', | ||
'< 1.+2.3.40', | ||
'<=', | ||
'<= 0.-1', | ||
'<= 1.f.3', | ||
'1.2.3.0', | ||
'pip > 1', | ||
'all', | ||
-1, | ||
65_536, | ||
:undef, | ||
].each do |value| | ||
describe value.inspect do | ||
it { | ||
is_expected.not_to allow_value(value) | ||
} | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# @summary A version type to ensure a specific Pip version in a virtual env. | ||
# | ||
type Python::Venv::PipVersion = Pattern[ | ||
/^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, | ||
/\Alatest\Z/ | ||
] |