mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[CI] Publish to Pypi (#366)
This commit is contained in:
parent
63ced828d8
commit
ca68637c4e
26
.github/workflows/publish-to-pypi.yml
vendored
Normal file
26
.github/workflows/publish-to-pypi.yml
vendored
Normal file
@ -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 }}
|
63
setup.py
63
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__':
|
||||
|
Loading…
Reference in New Issue
Block a user