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 }}
|
27
setup.py
27
setup.py
@ -10,8 +10,10 @@ class DownloadNLTK(install):
|
|||||||
nltk.download('punkt')
|
nltk.download('punkt')
|
||||||
|
|
||||||
|
|
||||||
with open('README_zh-CN.md') as f:
|
def readme():
|
||||||
readme = f.read()
|
with open('README.md', encoding='utf-8') as f:
|
||||||
|
content = f.read()
|
||||||
|
return content
|
||||||
|
|
||||||
|
|
||||||
def parse_requirements(fname='requirements.txt', with_version=True):
|
def parse_requirements(fname='requirements.txt', with_version=True):
|
||||||
@ -101,23 +103,30 @@ def get_version():
|
|||||||
|
|
||||||
|
|
||||||
def do_setup():
|
def do_setup():
|
||||||
setup(
|
setup(name='opencompass',
|
||||||
name='opencompass',
|
|
||||||
version=get_version(),
|
version=get_version(),
|
||||||
description='A comprehensive toolkit for large model evaluation',
|
description='A comprehensive toolkit for large model evaluation',
|
||||||
# url="",
|
url='https://github.com/open-compass/opencompass',
|
||||||
# author="",
|
long_description=readme(),
|
||||||
long_description=readme,
|
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
|
maintainer='OpenCompass Authors',
|
||||||
cmdclass={'download_nltk': DownloadNLTK},
|
cmdclass={'download_nltk': DownloadNLTK},
|
||||||
setup_requires=['nltk==3.8'],
|
setup_requires=['nltk==3.8'],
|
||||||
python_requires='>=3.8.0',
|
python_requires='>=3.8.0',
|
||||||
install_requires=parse_requirements('requirements/runtime.txt'),
|
install_requires=parse_requirements('requirements/runtime.txt'),
|
||||||
|
license='Apache License 2.0',
|
||||||
packages=find_packages(exclude=[
|
packages=find_packages(exclude=[
|
||||||
'test*',
|
'test*',
|
||||||
'paper_test*',
|
'configs',
|
||||||
|
'data',
|
||||||
|
'docs',
|
||||||
|
'tools',
|
||||||
|
'tmp',
|
||||||
]),
|
]),
|
||||||
keywords=['AI', 'NLP', 'in-context learning'],
|
keywords=[
|
||||||
|
'AI', 'NLP', 'in-context learning', 'large language model',
|
||||||
|
'evaluation', 'benchmark', 'llm'
|
||||||
|
],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
'Programming Language :: Python :: 3.9',
|
||||||
|
Loading…
Reference in New Issue
Block a user