diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0a0cd40..1b1f902 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,8 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PAI_PYPI_TOKEN: ${{ secrets.PAI_PYPI_TOKEN }} + ALIPAI_PYPI_TOKEN: ${{ secrets.ALIPAI_PYPI_TOKEN }} steps: - uses: actions/checkout@v4 - name: Set up Python 3.8 @@ -23,7 +24,18 @@ jobs: python-version: '3.8' - name: Install dependencies run: pip install wheel setuptools twine - - name: Build package + # build and upload package pai + - name: Build package for pai run: python setup.py sdist bdist_wheel - - name: Publish package to PyPI - run: twine upload dist/* --skip-existing -u __token__ -p $PYPI_TOKEN + - name: Publish package to PyPI (pai) + run: twine upload dist/* --skip-existing -u __token__ -p $PAI_PYPI_TOKEN + - name: cleanup + run: | + rm -rf dist + rm -rf build + rm -rf pai.egg-info + # build and upload package alipai + - name: Build package for alipai + run: PACKAGE_NAME=alipai python setup.py sdist bdist_wheel + - name: Publish package to PyPI (alipai) + run: twine upload dist/* --skip-existing -u __token__ -p $ALIPAI_PYPI_TOKEN diff --git a/.github/workflows/release_trigger.yaml b/.github/workflows/release_trigger.yaml index cf45247..2d6ee91 100644 --- a/.github/workflows/release_trigger.yaml +++ b/.github/workflows/release_trigger.yaml @@ -17,8 +17,9 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v') env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PAI_PYPI_TOKEN: ${{ secrets.PAI_PYPI_TOKEN }} + ALIPAI_PYPI_TOKEN: ${{ secrets.ALIPAI_PYPI_TOKEN }} steps: - uses: actions/checkout@v4 - name: Set up Python 3.8 @@ -43,7 +44,16 @@ jobs: # git tag pushed by GitHub action bot will not trigger another action. - name: Install dependencies run: pip install wheel setuptools twine - - name: Build package + - name: Build package for pai run: python setup.py sdist bdist_wheel - - name: Publish package to PyPI - run: twine upload dist/* --skip-existing -u __token__ -p $PYPI_TOKEN + - name: Publish package to PyPI (pai) + run: twine upload dist/* --skip-existing -u __token__ -p $PAI_PYPI_TOKEN + - name: cleanup + run: | + rm -rf dist + rm -rf build + rm -rf pai.egg-info + - name: Build package for alipai + run: PACKAGE_NAME=alipai python setup.py sdist bdist_wheel + - name: Publish package to PyPI (alipai) + run: twine upload dist/* --skip-existing -u __token__ -p $ALIPAI_PYPI_TOKEN diff --git a/README.md b/README.md index 57cfbb6..5306161 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ PAI Python SDK是阿里云 [机器学习平台 PAI(Platform for Artificial Intel 使用以下命令安装PAI Python SDK(支持Python版本 \>= 3.8): ```shell -python -m pip install alipai +python -m pip install pai ``` ## 📖 文档 -请通过访问 [PAI Python SDK文档](https://alipai.readthedocs.io/) 或是查看 [docs](./docs) 目录下的文件获取SDK的详细文档,包括用户指南和API文档。 +请通过访问 [PAI Python SDK文档](https://pai.readthedocs.io/) 或是查看 [docs](./docs) 目录下的文件获取SDK的详细文档,包括用户指南和API文档。 ## 🛠 使用示例 diff --git a/README_EN.md b/README_EN.md index 851b9f0..833f99d 100644 --- a/README_EN.md +++ b/README_EN.md @@ -10,12 +10,12 @@ The PAI Python SDK is provided by Alibaba Cloud\'s [Platform for Artificial Inte Install the PAI Python SDK using the following command, which supports Python versions \>= 3.8 : ```shell -python -m pip install alipai +python -m pip install pai ``` ## 📖 Documentation -Find detailed documentation, including API references and user guides, in the [docs](./docs/) directory or visit [PAI Python SDK Documentation](https://alipai.readthedocs.io/). +Find detailed documentation, including API references and user guides, in the [docs](./docs/) directory or visit [PAI Python SDK Documentation](https://pai.readthedocs.io/). ## 🛠 Basic Usage diff --git a/docs/source/quick-tour/installation.rst b/docs/source/quick-tour/installation.rst index 181353f..b160c7a 100644 --- a/docs/source/quick-tour/installation.rst +++ b/docs/source/quick-tour/installation.rst @@ -9,7 +9,7 @@ .. parsed-literal:: - python -m pip install alipai + python -m pip install pai 前提条件 diff --git a/setup.py b/setup.py index 1dad53c..8df16cc 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,7 @@ pkg_root = os.path.dirname(os.path.abspath(__file__)) REQUIREMENTS_FILE = "requirements/requirements.txt" +PACKAGE_NAME = os.getenv("PACKAGE_NAME", "pai") version_data = {} with open(os.path.join(pkg_root, "pai/version.py")) as fp: @@ -25,7 +26,7 @@ def read_requirements(): long_description = f.read() setup( - name="alipai", + name=PACKAGE_NAME, python_requires=">=3.8", version=version, setup_requires=["setuptools_scm"],