Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version number #61

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 0.8 (unreleased)


- Nothing changed yet.
- Made internal brostar_api version number available.


## 0.7 (2024-04-18)
Expand Down
4 changes: 4 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from api import filters, mixins, models, serializers
from api.bro_upload import utils
from brostar_api import __version__


class LogoutView(views.APIView):
Expand Down Expand Up @@ -56,6 +57,9 @@ def get(self, request: HttpRequest, format: Any = None) -> HttpResponse:
return Response(data)


APIOverview.__doc__ = f"**BROstar version**: *{__version__}*"


class LocalHostRedirectView(APIView):
"""
View that redirects user to localhost:4200.
Expand Down
3 changes: 3 additions & 0 deletions brostar_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from importlib.metadata import version

from .celery import app as celery_app

__all__ = ("celery_app",)
__version__ = version("brostar_api")
4 changes: 4 additions & 0 deletions brostar_api/tests/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def test_version():
from brostar_api import __version__

assert __version__