Skip to content

Commit d461edb

Browse files
committed
Include version in footer
1 parent dbc4441 commit d461edb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pypi_browser/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import email
2+
import importlib.metadata
23
import io
34
import itertools
45
import mimetypes
@@ -103,6 +104,7 @@ def _human_size(size: int) -> str:
103104

104105
templates.env.filters['human_size'] = _human_size
105106
templates.env.filters['pluralize'] = _pluralize
107+
templates.env.globals['pypi_browser_version'] = importlib.metadata.version('pypi-browser-webapp')
106108

107109

108110
@app.route('/')

pypi_browser/templates/_base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
<div class="container mt-5 mb-3">
3535
<footer class="border-top py-3 px-3">
3636
<p class="text-muted small">
37-
PyPI Browser is an open source project.
37+
PyPI Browser v{{pypi_browser_version}} is an open source project.
3838
<br />
39-
<a href="{{url_for('package', package='pypibrowser')}}">View its files with PyPI Browser</a>
39+
<a href="{{url_for('package', package='pypi-browser-webapp')}}">View its files with PyPI Browser</a>
4040
<br />
4141
<a href="https://github.com/chriskuehl/pypi-browser">View it on GitHub</a>
4242
</p>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poetry]
2-
name = "pypibrowser"
2+
name = "pypi-browser-webapp"
33
version = "0.0.0"
44
description = "PyPI package browsing web application"
55
authors = ["Chris Kuehl <[email protected]>"]

0 commit comments

Comments
 (0)