Skip to content

Commit

Permalink
Fix package name delimiter normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdemin committed Feb 17, 2023
1 parent b026e3c commit 772a370
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
History
=======

2.6.2 (2023-02-23)
------------------

* Fix package name normalization for names with delimiters (``urltemplate`` != ``url-template``).


2.6.1 (2022-11-23)
------------------

Expand Down
2 changes: 1 addition & 1 deletion pipcompilemulti/deduplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ def __contains__(self, key):
@classmethod
def _make_stem(cls, name):
for delim in cls._DELIMITERS:
name = name.replace(delim, '')
name = name.replace(delim, '-')
return name.lower()
2 changes: 2 additions & 0 deletions tests/test_deduplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ def test_package_deduplicator_handles_delimiters_normalization():
package_deduplicator.register_packages_for_env('b', {'pkg.name': '1.0'})
ignored_packages = package_deduplicator.ignored_packages('a')
assert 'pkg-name' in ignored_packages
assert 'pkg.name' in ignored_packages
assert 'pkgname' not in ignored_packages
assert ignored_packages['Pkg_Name'] == '1.0'

0 comments on commit 772a370

Please sign in to comment.