diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 00000000..16e60fb6 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,37 @@ +name: PyPI Publish + +on: + push: + branches: + - main + tags: + - v* +jobs: + pypi_publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/simuleval + permissions: + id-token: write + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: pip install --upgrade pip setuptools wheel + + - name: Build package + run: python setup.py sdist bdist_wheel + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + args: "--use-feature=fast-deploy" \ No newline at end of file diff --git a/setup.py b/setup.py index 64aae337..b7b0b779 100644 --- a/setup.py +++ b/setup.py @@ -4,13 +4,22 @@ # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. -import setuptools +from setuptools import setup, find_packages -setuptools.setup( +with open("README.md", "r") as readme_file: + long_description = readme_file.read() + +setup( python_requires=">3.7.0", name="simuleval", version="1.1.0", author="Xutai Ma", + description="SimulEval: A Flexible Toolkit for Automated Machine Translation Evaluation", + long_description=long_description, + long_description_content_type="text/markdown", + homepage="https://github.com/facebookresearch/SimulEval.git", + documentation="https://simuleval.readthedocs.io/en/v1.1.0/quick_start.html", + license="LICENSE", entry_points={ "console_scripts": [ "simuleval = simuleval.cli:main", @@ -32,7 +41,34 @@ "yt-dlp", "pydub", ], - package=setuptools.find_packages( + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Development Status :: 4 - Beta", + ], + keywords=[ + "SimulEval", + "Machine Translation", + "Evaluation", + "Metrics", + "BLEU", + "TER", + "METEOR", + "chrF", + "RIBES", + "WMD", + "Embedding Average", + "Embedding Extrema", + "Embedding Greedy", + "Embedding Average", + "SimulEval", + "SimulEval_Testing_Package_1", + "facebookresearch", + "facebook", + "Meta-Evaluation", + ], + packages=find_packages( exclude=[ "examples", "examples.*", @@ -40,4 +76,6 @@ "docs.*", ] ), + setup_requires=["setuptools_scm"], + use_scm_version=True, )