Skip to content

Commit

Permalink
PyPI automatic deployment through GitHub Action (#59)
Browse files Browse the repository at this point in the history
* Packaging SimulEval

* Create publish-to-test-pypi.yml for packaging

* Change the version

* Update publish-to-test-pypi.yml

* change version for testing

* Add change to test

* Update publish-to-test-pypi.yml

* Change version to trigger action

* Add config to setup.py

* set up circleci

* Change version and name of the package

* Update config.yml

* Delete publish-to-test-pypi.yml

* Delete pyproject.toml

* Circleci setup

* CircleCi

* Test github action

* Test github action

* Change version to test Github action

* PyPi workflow

* update guthub action to trusted publisher config

* add license

* use black to format. Fixes #52

* Use black to format. #52

* change name and version to initial. (#52)

* remove circleci. (#52)

* Update setup.py to remove author email

Co-authored-by: Abinesh Ramakrishnan <3632454+ibanesh@users.noreply.github.com>

* Remove author_email

* remove twine (#52)

* remove author email (#52)

* remove testpypi-publish. (#52)

---------

Co-authored-by: Mubaraq Sani <{ID}+{username}@users.noreply.github.com>
Co-authored-by: Abinesh Ramakrishnan <3632454+ibanesh@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 14, 2023
1 parent 2313d78 commit c7a1749
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -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"
44 changes: 41 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -32,12 +41,41 @@
"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.*",
"docs",
"docs.*",
]
),
setup_requires=["setuptools_scm"],
use_scm_version=True,
)

0 comments on commit c7a1749

Please sign in to comment.