Skip to content

Commit

Permalink
Merge pull request #1421 from mikel-brostrom/fix-pkg-version-handling
Browse files Browse the repository at this point in the history
fetch pkg version from __init__ instead of pyproject
  • Loading branch information
mikel-brostrom authored May 9, 2024
2 parents 1393d41 + ac26390 commit 564fd40
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 42 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
poetry config virtualenvs.create false
poetry install
- name: Increase path version and get commit message
- name: Increase poetry path version and add
id: get_version
run: |
git config --local user.email [email protected]
Expand All @@ -42,6 +42,12 @@ jobs:
echo "new_version=$new_version" >> $GITHUB_OUTPUT
if: ${{ success() }}

- name: Update __init__.py version and add
run: |
sed -i '' "s/__version__ = '.*'/__version__ = '${{ steps.get_version.outputs.new_version }}'/" boxmot/__init__.py
git add boxmot/__init__.py
if: ${{ success() }}

- name: Commit and push updated version
run: |
git commit -m "${{ steps.get_version.outputs.commit_message }}"
Expand Down
2 changes: 1 addition & 1 deletion boxmot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license

__version__ = '10.0.52'
__version__ = '10.1.67'

from boxmot.postprocessing.gsi import gsi
from boxmot.tracker_zoo import create_tracker, get_tracker_config
Expand Down
13 changes: 2 additions & 11 deletions boxmot/utils/torch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@

import os
import platform
import toml
import torch

from .. import __version__
from . import logger as LOGGER
from boxmot.utils import ROOT


def get_version_from_pyproject():
# Load the pyproject.toml file
with open(ROOT / "pyproject.toml", "r") as file:
pyproject_data = toml.load(file)

# Extract the version
version = pyproject_data['tool']['poetry']['version']
return version

def get_system_info():
return f"Yolo Tracking v{get_version_from_pyproject()} 🚀 Python-{platform.python_version()} torch-{torch.__version__}"
return f"Yolo Tracking v{__version__} 🚀 Python-{platform.python_version()} torch-{torch.__version__}"

def parse_device(device):
device = str(device).lower().replace("cuda:", "").replace("none", "").replace("(", "").replace(")", "").replace("[", "").replace("]", "").replace("'", "").replace(" ", "")
Expand Down
29 changes: 1 addition & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ torchvision = [
{version = "^0.17.1", source = "torchcpu", markers = "sys_platform == 'linux'"}
]
gitpython = "^3.1.42"
toml = "^0.10.2"


[[tool.poetry.source]]
Expand Down

0 comments on commit 564fd40

Please sign in to comment.