File tree 3 files changed +28
-2
lines changed
3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 17
17
from .convert .converter import signature
18
18
from .convert .to_channel_last_io import to_channel_last_io
19
19
from .model import Model
20
+ from .version import __version__
20
21
21
22
22
23
def load (path : str ) -> Model :
Original file line number Diff line number Diff line change
1
+ # Copyright 2024 The AI Edge Torch Authors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+
16
+ __version__ = "0.2.0"
Original file line number Diff line number Diff line change 15
15
16
16
import os
17
17
import pathlib
18
+ import re
18
19
19
20
from setuptools import find_packages
20
21
from setuptools import setup
33
34
""" .lstrip ()
34
35
35
36
name = "ai-edge-torch"
36
- version = "0.2.0"
37
+ # TODO(b/357076369): move version updating logics to version.py
38
+ version_py = here / "ai_edge_torch" / "version.py"
39
+ version_regex = "__version__\s*=\s*(\" |')(?P<version>[^\" ']+)(\" |')"
40
+ version = re .search (version_regex , version_py .read_text ()).group ("version" )
41
+
37
42
if nightly_release_date := os .environ .get ("NIGHTLY_RELEASE_DATE" ):
38
43
name += "-nightly"
39
44
version += ".dev" + nightly_release_date
40
-
45
+ version_py .write_text (
46
+ re .sub (
47
+ version_regex , f'__version__ = "{ version } "' , version_py .read_text ()
48
+ )
49
+ )
41
50
42
51
setup (
43
52
name = name ,
You can’t perform that action at this time.
0 commit comments