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 fd8eb52cd6..723780d14c 100644 --- a/ietf/api/tests.py +++ b/ietf/api/tests.py @@ -872,6 +872,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) @@ -879,6 +881,7 @@ def test_api_version(self): self.assertEqual(data['dumptime'], "2022-08-31 07:10:01 -0700") + def test_api_appauth(self): url = urlreverse('ietf.api.views.app_auth') person = PersonFactory() diff --git a/ietf/api/views.py b/ietf/api/views.py index 6aaed4b6a9..cd7823a829 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',