Skip to content

Commit

Permalink
feat: Change assertions to warnings, when adding or removing codes fr…
Browse files Browse the repository at this point in the history
…om an extension's codelist
  • Loading branch information
jpmckinney committed Jul 20, 2023
1 parent b00d3be commit a103d13
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
@@ -1,6 +1,11 @@
Changelog
=========

0.3.7 (2023-07-19)
------------------

- feat: Change assertions to warnings, when adding or removing codes from an extension's codelist.

0.3.6 (2023-07-12)
------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -26,7 +26,7 @@
author = "Open Contracting Partnership"

# The short X.Y version
version = "0.3.6"
version = "0.3.7"
# The full version, including alpha/beta/rc tags
release = version

Expand Down
6 changes: 4 additions & 2 deletions ocdsextensionregistry/profile_builder.py
Expand Up @@ -285,12 +285,14 @@ def extension_codelists(self):
if codelist.addend:
for row in codelist:
code = row['Code']
assert code in codes, f'{code} added by {name}, but not in {basename}'
if code not in codes:
warnings.warn(f'{code} added by {name}, but not in {basename}')
logger.info('%s has the codes added by %s - ignoring %s', basename, name, name)
else:
for row in codelist:
code = row['Code']
assert code not in codes, f'{code} removed by {name}, but in {basename}'
if code in codes:
warnings.warn(f'{code} removed by {name}, but in {basename}')
logger.info('%s has no codes removed by %s - ignoring %s', basename, name, name)
del codelists[name]

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = ocdsextensionregistry
version = 0.3.6
version = 0.3.7
author = Open Contracting Partnership
author_email = data@open-contracting.org
license = BSD
Expand Down

0 comments on commit a103d13

Please sign in to comment.