diff --git a/ietf/__init__.py b/ietf/__init__.py index 26124c3c67..950926ccf8 100644 --- a/ietf/__init__.py +++ b/ietf/__init__.py @@ -35,6 +35,21 @@ __release_branch__ = branch __release_hash__ = git_hash +# important libraries +__version_extra__ = {} +# xml2rfc +try: + import xml2rfc + __version_extra__['xml2rfc'] = xml2rfc.__version__ +except Exception: + pass + +# weasyprint +try: + import weasyprint + __version_extra__['weasyprint'] = weasyprint.__version__ +except Exception: + pass # This will make sure the app is always imported when # Django starts so that shared_task will use this app. diff --git a/ietf/api/tests.py b/ietf/api/tests.py index 7dc9c42cc8..4eecde2fc1 100644 --- a/ietf/api/tests.py +++ b/ietf/api/tests.py @@ -936,6 +936,8 @@ def test_api_version(self): r = self.client.get(url) data = r.json() self.assertEqual(data['version'], ietf.__version__+ietf.__patch__) + self.assertEqual(data['other']['xml2rfc'], ietf.__version_extra__['xml2rfc']) + self.assertEqual(data['other']['weasyprint'], ietf.__version_extra__['weasyprint']) self.assertEqual(data['dumptime'], "2022-08-31 07:10:01 +0000") DumpInfo.objects.update(tz='PST8PDT') r = self.client.get(url) @@ -943,6 +945,7 @@ def test_api_version(self): self.assertEqual(data['dumptime'], "2022-08-31 07:10:01 -0700") + def test_api_appauth(self): for app in ["authortools", "bibxml"]: url = urlreverse('ietf.api.views.app_auth', kwargs={"app": app}) diff --git a/ietf/api/views.py b/ietf/api/views.py index df67cffd56..2b5c2d5993 100644 --- a/ietf/api/views.py +++ b/ietf/api/views.py @@ -243,6 +243,7 @@ def version(request): return HttpResponse( json.dumps({ 'version': ietf.__version__+ietf.__patch__, + 'other': ietf.__version_extra__, 'dumptime': dumptime, }), content_type='application/json',