-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cb88acf
Showing
129 changed files
with
8,286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "🐛 Bug Report" | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "🚀 Feature Request" | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: "❓Question" | ||
about: Ask a general question | ||
title: '' | ||
labels: question | ||
assignees: '' | ||
|
||
--- | ||
|
||
## ❔Question | ||
|
||
|
||
## Additional context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Description | ||
|
||
This PR ... | ||
|
||
### Checklist | ||
|
||
- [ ] Linked issues (if existing) | ||
- [ ] Amended changelog.md for large changes (and added myself there as contributor) | ||
- [ ] Added/modified tests | ||
- [ ] Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with `pre-commit install`. | ||
To run hooks independent of commit, execute `pre-commit run --all-files` | ||
|
||
Thank you for joining. Have fun coding! |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This action runs GitHub's industry-leading static analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. | ||
# https://github.com/github/codeql-action | ||
|
||
name: "CodeQL" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 27 1 *' # Runs at 00:00 UTC on the 27th of January | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ['python'] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release - Conda | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- conda_* | ||
|
||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }} | ||
|
||
jobs: | ||
build_and_package: | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
auto-activate-base: false | ||
python-version: 3.8 | ||
activate-environment: "build-transformers" | ||
channels: huggingface | ||
|
||
- name: Setup conda env | ||
run: | | ||
conda install -c defaults anaconda-client conda-build | ||
- name: Extract version | ||
run: echo "TRANSFORMERS_VERSION=`python setup.py --version`" >> $GITHUB_ENV | ||
|
||
- name: Build conda packages | ||
run: | | ||
conda info | ||
conda list | ||
conda-build .github/conda | ||
- name: Upload to Anaconda | ||
run: anaconda upload `conda-build .github/conda --output` --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [master, main, dev] | ||
pull_request: | ||
branches: [master, main] | ||
|
||
jobs: | ||
linter-black: | ||
name: Check code formatting with Black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Black | ||
run: pip install black[jupyter] | ||
- name: Run Black | ||
run: black --check . | ||
|
||
imports-check-isort: | ||
name: Check valid import formatting with isort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install isort | ||
run: pip install isort==5.6.4 | ||
- name: Run isort | ||
run: isort --check-only --diff . | ||
|
||
linter-flake8: | ||
name: Check valid formatting with flake8 | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: pip install flake8==3.9.2 | ||
- name: Run checks | ||
run: flake8 | ||
|
||
pre-commit-hooks: | ||
name: Check that pre-commit hooks pass | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: pip install pre-commit | ||
|
||
- name: Run checks | ||
run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: PyPi Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install poetry | ||
shell: bash | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
python -m pip install poetry-dynamic-versioning[plugin] | ||
- name: Set poetry path variable | ||
run: echo "/Users/runner/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | ||
run: | | ||
poetry publish --username "${{ secrets.PYPI_USERNAME }}" --password "${{ secrets.PYPI_PASSWORD }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [master, main, dev] | ||
pull_request: | ||
branches: [master, main, dev] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest] # add windows-2019 when poetry allows installation with `-f` flag | ||
python-version: [3.8, 3.9] # python 3.9 is not supported by all dependencies yet | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get full Python version | ||
id: full-python-version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install poetry | ||
shell: bash | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Set poetry path variable | ||
run: echo "/Users/runner/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Configure poetry | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Ensure cache is healthy | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv | ||
|
||
- name: Upgrade pip | ||
shell: bash | ||
run: poetry run python -m pip install pip -U | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run unittest | ||
shell: bash | ||
run: poetry run coverage run -m unittest discover -s ./tests -p 'test_*.py' | ||
|
||
- name: Statistics | ||
if: success() | ||
run: | | ||
poetry run coverage report -i | ||
poetry run coverage xml -i | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: coverage.xml | ||
flags: cpu, unittest | ||
name: CPU-coverage | ||
fail_ci_if_error: false | ||
|
||
docs: | ||
name: Test docs build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements_docs.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y pandoc | ||
python -m pip install --upgrade pip | ||
pip install -r docs/requirements_docs.txt | ||
shell: bash | ||
|
||
- name: Build sphinx documentation | ||
run: | | ||
cd docs | ||
make clean | ||
make html --debug --jobs 2 SPHINXOPTS="-W" | ||
- name: Upload built docs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docs-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }} | ||
path: docs/build/html/ | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: success() |
Oops, something went wrong.