Skip to content

Commit

Permalink
enables publishing to pipy with ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
WissamAntoun committed Jul 17, 2022
1 parent e808619 commit feffddd
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish AraBERT 📦 to TestPyPI

on: workflow_dispatch

jobs:
build-n-publish:
name: Build and publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish AraBERT 📦 to TestPyPI

on: workflow_dispatch

jobs:
build-n-publish:
name: Build and publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AraBERTv2 / AraGPT2 / AraELECTRA

![visitors](https://visitor-badge.glitch.me/badge?page_id=wissamantoun.arabert)
[![PyPI version](https://badge.fury.io/py/arabert.svg)](https://badge.fury.io/py/arabert)

<p align="middle">
<img src="https://github.com/aub-mind/arabert/blob/master/arabert_logo.png" width="150" align="left"/>
Expand All @@ -21,9 +22,23 @@ cd arabert && git checkout 6a58ca118911ef311cbe8cdcdcc1d03601123291
```
# Update

- **8-Oct-2021**: New AraBERT models that better supports tweets and emojies.
- **8-Oct-2021:** New AraBERT models that better supports tweets and emojies.
- **13-Sep-2021:** Arabic NLP Demo Space on HuggingFace [![Open Space](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://huggingface.co/spaces/aubmindlab/Arabic-NLP)
- **02-Apr-2021:** AraELECTRA powered Arabic Wikipedia QA system [![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/wissamantoun/arabic-wikipedia-qa-streamlit/main)
- **17-jul-2022:** You can now install arabert via `pip install arabert`

# Installation

Install AraBERT from PyPI:
```bash
pip install arabert
```

and then you can use it:
```python
from arabert import ArabertPreprocessor
from arabert.aragpt2.grover.modeling_gpt2 import GPT2LMHeadModel
```

# AraBERTv2

Expand Down
33 changes: 32 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
from setuptools import find_packages, setup


def get_long_description():
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()

long_description = long_description.replace(
"[Read More...](#AraBERT)",
"[Read More...](https://github.com/aub-mind/arabert/tree/master/arabert)",
)
long_description = long_description.replace(
"[Read More...](#AraGPT2)",
"[Read More...](https://github.com/aub-mind/arabert/tree/master/aragpt2)",
)
long_description = long_description.replace(
"[Read More...](#AraELECTRA)",
"[Read More...](https://github.com/aub-mind/arabert/tree/master/araelectra)",
)
long_description = long_description.replace(
"[preprocessing function](#Preprocessing)",
"https://github.com/aub-mind/arabert#preprocessing",
)
long_description = long_description.replace(
"[Dataset Section](#Dataset)", "https://github.com/aub-mind/arabert#Dataset"
)
long_description = long_description.replace(
"https://github.com/aub-mind/arabert/blob/master/",
"https://raw.githubusercontent.com/aub-mind/arabert/master/",
)
return long_description


setup(
name="arabert",
version="1.0.0",
Expand All @@ -10,7 +41,7 @@
description="AraBERT is a Python library that contains the"
"code for the AraBERT, AraGPT2 and AraELECTRA models with"
"the preprocessing scripts.",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description=get_long_description(),
long_description_content_type="text/markdown",
install_requires=["PyArabic", "farasapy"],
py_modules=["arabert.preprocess"],
Expand Down

0 comments on commit feffddd

Please sign in to comment.