Skip to content

Commit 918a545

Browse files
authored
fix version (#4226)
1 parent 9124996 commit 918a545

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

paddlenlp/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

paddlenlp/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
1615
import sys
1716

18-
with open(os.path.join(os.path.dirname(__file__), "VERSION")) as fp:
19-
__version__ = fp.read().strip()
17+
__version__ = "2.4.7"
2018

2119
if "datasets" in sys.modules.keys():
2220
from paddlenlp.utils.log import logger

scripts/should_deploy.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
from pkg_resources import parse_version
2222

23-
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
24-
2523

2624
def read_version_of_remote_package(name: str) -> str:
2725
"""get version of remote package,
@@ -66,16 +64,23 @@ def read_version_of_local_package(version_file_path: str) -> str:
6664
args = parser.parse_args()
6765

6866
version_file_map = {
69-
"paddlenlp": "paddlenlp/VERSION",
7067
"ppdiffusers": "ppdiffusers/VERSION",
7168
"paddle-pipelines": "pipelines/VERSION",
7269
}
73-
if args.name not in version_file_map:
74-
raise ValueError(f"package<{args.name}> not supported")
75-
76-
local_version_file = os.path.join(PROJECT_ROOT, version_file_map[args.name])
7770
remote_version = read_version_of_remote_package(args.name)
78-
local_version = read_version_of_local_package(local_version_file)
71+
72+
# tmp fix
73+
if args.name == "paddlenlp":
74+
sys.path.append(".")
75+
from paddlenlp import __version__
76+
77+
local_version = __version__
78+
elif args.name in version_file_map:
79+
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
80+
local_version_file = os.path.join(PROJECT_ROOT, version_file_map[args.name])
81+
local_version = read_version_of_local_package(local_version_file)
82+
else:
83+
raise ValueError(f"package<{args.name}> not supported")
7984

8085
should_deploy = str(parse_version(remote_version) < parse_version(local_version)).lower()
8186
print(f"should_deploy={should_deploy}")

0 commit comments

Comments
 (0)