diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000..e8c7c826 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,26 @@ +name: deploy + +on: push + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-n-publish: + runs-on: ubuntu-latest + if: startsWith(github.event.ref, 'refs/tags') + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Build lagent + run: | + pip install wheel + python setup.py sdist bdist_wheel + - name: Publish distribution to PyPI + run: | + pip install twine + twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }} diff --git a/setup.py b/setup.py index 7b9c578d..354c2433 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,10 @@ class DownloadNLTK(install): nltk.download('punkt') -with open('README_zh-CN.md') as f: - readme = f.read() +def readme(): + with open('README.md', encoding='utf-8') as f: + content = f.read() + return content def parse_requirements(fname='requirements.txt', with_version=True): @@ -101,31 +103,38 @@ def get_version(): def do_setup(): - setup( - name='opencompass', - version=get_version(), - description='A comprehensive toolkit for large model evaluation', - # url="", - # author="", - long_description=readme, - long_description_content_type='text/markdown', - cmdclass={'download_nltk': DownloadNLTK}, - setup_requires=['nltk==3.8'], - python_requires='>=3.8.0', - install_requires=parse_requirements('requirements/runtime.txt'), - packages=find_packages(exclude=[ - 'test*', - 'paper_test*', - ]), - keywords=['AI', 'NLP', 'in-context learning'], - classifiers=[ - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - ]) + setup(name='opencompass', + version=get_version(), + description='A comprehensive toolkit for large model evaluation', + url='https://github.com/open-compass/opencompass', + long_description=readme(), + long_description_content_type='text/markdown', + maintainer='OpenCompass Authors', + cmdclass={'download_nltk': DownloadNLTK}, + setup_requires=['nltk==3.8'], + python_requires='>=3.8.0', + install_requires=parse_requirements('requirements/runtime.txt'), + license='Apache License 2.0', + packages=find_packages(exclude=[ + 'test*', + 'configs', + 'data', + 'docs', + 'tools', + 'tmp', + ]), + keywords=[ + 'AI', 'NLP', 'in-context learning', 'large language model', + 'evaluation', 'benchmark', 'llm' + ], + classifiers=[ + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + ]) if __name__ == '__main__':