mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +01:00
feat: Update version retrieval to prioritize _version.py
This commit is contained in:
11
manage.sh
11
manage.sh
@@ -72,7 +72,10 @@ is_running() {
|
||||
|
||||
# Function to get current version
|
||||
get_version() {
|
||||
if [ -f "$INSTALL_DIR/pyproject.toml" ]; then
|
||||
# Try to read from _version.py first (generated by setuptools_scm)
|
||||
if [ -f "$INSTALL_DIR/repeater/_version.py" ]; then
|
||||
grep "^__version__ = version = " "$INSTALL_DIR/repeater/_version.py" | cut -d"'" -f2 2>/dev/null || echo "unknown"
|
||||
elif [ -f "$INSTALL_DIR/pyproject.toml" ]; then
|
||||
grep "^version" "$INSTALL_DIR/pyproject.toml" | cut -d'"' -f2 2>/dev/null || echo "unknown"
|
||||
else
|
||||
echo "not installed"
|
||||
@@ -226,7 +229,8 @@ install_repeater() {
|
||||
# Generate version file using setuptools_scm before copying
|
||||
if [ -d .git ]; then
|
||||
git fetch --tags 2>/dev/null || true
|
||||
python3 -m setuptools_scm 2>/dev/null || true
|
||||
# Write the version file that will be copied
|
||||
python3 -c "from setuptools_scm import get_version; get_version(write_to='repeater/_version.py', local_scheme='no-local-version')" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
echo "30"; echo "# Installing files..."
|
||||
@@ -392,7 +396,8 @@ upgrade_repeater() {
|
||||
# Generate version file using setuptools_scm before copying
|
||||
if [ -d .git ]; then
|
||||
git fetch --tags 2>/dev/null || true
|
||||
python3 -m setuptools_scm 2>/dev/null || true
|
||||
# Write the version file that will be copied
|
||||
python3 -c "from setuptools_scm import get_version; get_version(write_to='repeater/_version.py', local_scheme='no-local-version')" 2>/dev/null || true
|
||||
fi
|
||||
echo " ✓ Version file generated"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user