Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: support both pai and alipai package release #37

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
18 changes: 14 additions & 4 deletions .github/workflows/release_trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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文档。

## 🛠 使用示例

Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/source/quick-tour/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

.. parsed-literal::

python -m pip install alipai
python -m pip install pai


前提条件
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"],
Expand Down