Skip to content

Commit 36e78fa

Browse files
authored
Re-work release logic (#4221)
* fix release logic * workflow * add version file
1 parent 1816c85 commit 36e78fa

File tree

8 files changed

+12
-27
lines changed

8 files changed

+12
-27
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PyPI
1+
name: Release
22

33
on:
44
workflow_dispatch:

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ deploy-paddle-pipelines:
6060
deploy-paddlenlp:
6161
# install related package
6262
make install
63-
# deploy version
64-
echo "VERSION = '$$(cat VERSION)'" > paddlenlp/version.py
6563
# build
6664
python3 setup.py sdist bdist_wheel
6765
# upload

VERSION

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

paddlenlp/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.6

paddlenlp/__init__.py

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

15-
from .version import VERSION
16-
17-
__version__ = VERSION # Maybe dev is better
15+
import os
1816
import sys
1917

18+
with open(os.path.join(os.path.dirname(__file__), "VERSION")) as fp:
19+
__version__ = fp.read().strip()
20+
2021
if "datasets" in sys.modules.keys():
2122
from paddlenlp.utils.log import logger
2223

paddlenlp/version.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

scripts/should_deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def read_version_of_local_package(version_file_path: str) -> str:
6666
args = parser.parse_args()
6767

6868
version_file_map = {
69-
"paddlenlp": "VERSION",
69+
"paddlenlp": "paddlenlp/VERSION",
7070
"ppdiffusers": "ppdiffusers/VERSION",
7171
"paddle-pipelines": "pipelines/VERSION",
7272
}

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
import io
1415
import os
16+
1517
import setuptools
16-
import io
18+
19+
from paddlenlp import __version__
1720

1821

1922
def read_requirements_file(filepath):
@@ -58,7 +61,7 @@ def get_package_data_files(package, data, package_dir=None):
5861

5962
setuptools.setup(
6063
name="paddlenlp",
61-
version="2.4.1.dev", # modify this for each release
64+
version=__version__,
6265
author="PaddleNLP Team",
6366
author_email="[email protected]",
6467
description="Easy-to-use and powerful NLP library with Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including Neural Search, Question Answering, Information Extraction and Sentiment Analysis end-to-end system.",

0 commit comments

Comments
 (0)