Don't match tilde and exclamation mark as part of requirements.txt package name
This commit is contained in:
parent
5cd1a48d5e
commit
11e22835ed
3 changed files with 10 additions and 1 deletions
5
changelogs/unreleased/dm-requirements-txt-tilde.yml
Normal file
5
changelogs/unreleased/dm-requirements-txt-tilde.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Don't match tilde and exclamation mark as part of requirements.txt package
|
||||
name
|
||||
merge_request:
|
||||
author:
|
|
@ -6,7 +6,7 @@ module Gitlab
|
|||
private
|
||||
|
||||
def link_dependencies
|
||||
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=;\[]+)/) do |name|
|
||||
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=~!;\[]+)/) do |name|
|
||||
"https://pypi.python.org/pypi/#{name}"
|
||||
end
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
|
|||
Sphinx>=1.3
|
||||
docutils>=0.7
|
||||
markupsafe
|
||||
pytest~=3.0
|
||||
foop!=3.0
|
||||
CONTENT
|
||||
end
|
||||
|
||||
|
@ -78,6 +80,8 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
|
|||
expect(subject).to include(link('Sphinx', 'https://pypi.python.org/pypi/Sphinx'))
|
||||
expect(subject).to include(link('docutils', 'https://pypi.python.org/pypi/docutils'))
|
||||
expect(subject).to include(link('markupsafe', 'https://pypi.python.org/pypi/markupsafe'))
|
||||
expect(subject).to include(link('pytest', 'https://pypi.python.org/pypi/pytest'))
|
||||
expect(subject).to include(link('foop', 'https://pypi.python.org/pypi/foop'))
|
||||
end
|
||||
|
||||
it 'links URLs' do
|
||||
|
|
Loading…
Reference in a new issue