Skip to content

Commit beb2654

Browse files
committed
Ensure the package version can always be determined in CI
This fixes a small bug introduced by #151, where version numbers weren't computed correctly during CI tests. This also fixes a larger pre-existing bug, where version numbers might not always be computed correctly during CI releases. Also add a test to prevent future regressions.
1 parent b4eba8b commit beb2654

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
environment: release
1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820
- name: Set up Python
1921
uses: actions/setup-python@v5
2022
with:

.github/workflows/tox.yml

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030

3131
steps:
3232
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
3335
- name: Set up Python ${{ matrix.python-version }}
3436
uses: actions/setup-python@v5
3537
with:

tests/test_app/tests/package_tests.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from importlib.metadata import version as package_version
2+
3+
from packaging.version import parse as parse_version
4+
5+
# Any version less than this is a bug, but versions greater are fine
6+
MIN_VERSION = parse_version("0.5.7")
7+
8+
9+
def test_package_version_file():
10+
from minio_storage.version import __version__
11+
12+
version = parse_version(__version__)
13+
assert version >= MIN_VERSION
14+
15+
16+
def test_package_version_metadata():
17+
version = parse_version(package_version("django_minio_storage"))
18+
assert version >= MIN_VERSION

0 commit comments

Comments
 (0)