Skip to content

Commit 8694c57

Browse files
author
Liudmila Molkova
committed
support version.py and version/__init__.py files
1 parent 830f35f commit 8694c57

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/package-prepare-patch-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
3939
version=$(./scripts/eachdist.py version --package ${{ inputs.package }})
4040
41-
version_file=$(find $path -type f -name "version.py")
41+
version_file=$(find $path -type f -path "version*.py")
4242
file_count=$(echo "$version_file" | wc -l)
4343
4444
if [ "$file_count" -ne 1 ]; then
45-
echo "Error: expected one version.py file, found $file_count"
45+
echo "Error: expected one version file, found $file_count"
4646
echo "$version_file"
4747
exit 1
4848
fi
@@ -79,7 +79,7 @@ jobs:
7979
8080
- name: Update version
8181
run: |
82-
# replace the version in the version.py file (1.2.3 -> 1.2.4)
82+
# replace the version in the version file (1.2.3 -> 1.2.4)
8383
sed -i -E "s/__version__\s*=\s*\"${VERSION}\"/__version__ = \"${NEXT_VERSION}\"/g" $VERSION_FILE
8484
8585
- name: Set up Python 3.9

.github/workflows/package-prepare-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ jobs:
5353
5454
version=${version_dev%.dev}
5555
56-
version_file=$(find $path -type f -name "version.py")
56+
version_file=$(find $path -type f -path "version*.py")
5757
file_count=$(echo "$version_file" | wc -l)
5858
5959
if [ "$file_count" -ne 1 ]; then
60-
echo "Error: expected one version.py file, found $file_count"
60+
echo "Error: expected one version file, found $file_count"
6161
echo "$version_file"
6262
exit 1
6363
fi
@@ -105,7 +105,7 @@ jobs:
105105
106106
- name: Update package version
107107
run: |
108-
# replace the version in the version.py file (1.2.3dev -> 1.2.3)
108+
# replace the version in the version file (1.2.3dev -> 1.2.3)
109109
sed -i -E "s/__version__\s*=\s*\"${VERSION}\.dev\"/__version__ = \"${VERSION}\"/g" $VERSION_FILE
110110
111111
- name: Set up Python 3.9
@@ -156,7 +156,7 @@ jobs:
156156
157157
- name: Update version
158158
run: |
159-
# replace the version in the version.py file (1.2.3dev -> 1.3.3.dev)
159+
# replace the version in the version file (1.2.3dev -> 1.3.3.dev)
160160
sed -i -E "s/__version__\s*=\s*\"${VERSION}\.dev\"/__version__ = \"${NEXT_VERSION}.dev\"/g" $VERSION_FILE
161161
162162
- name: Set up Python 3.9

0 commit comments

Comments
 (0)