Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add asynchronous api #44

Merged
merged 20 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Continuous Delivery

on:
push:
branches:
- master
paths-ignore:
- '*.md'

jobs:
release:
runs-on: ubuntu-latest
concurrency: release

permissions:
id-token: write
contents: write

steps:
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}

- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@v9.9.0
with:
github_token: ${{ secrets.FACILITO_GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "actions@users.noreply.github.com"

- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'

- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v9.8.9
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.FACILITO_GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test

on:
push:
paths-ignore:
- '*.md'

branches:
- develop

pull_request:
paths-ignore:
- '*.md'

jobs:
test:
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Setup | Checkout Repository
uses: actions/checkout@v4

- name: Install Poetry
shell: bash
run: pipx install poetry

- name: Install FFmpeg
uses: AnimMouse/setup-ffmpeg@v1
with:
version: master

- name: Setup | Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install Dependencies
run: poetry install --with=dev

- name: Install Playwright Browsers
run: poetry run python -m playwright install --with-deps

- name: Lint with Ruff
run: poetry run ruff check --output-format=github .

- name: Type Check with MyPy
run: poetry run mypy --pretty --show-error-codes .

- name: Run Tests with Pytest
run: poetry run pytest
36 changes: 14 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@
# See https://pre-commit.com/hooks.html for more hooks

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-toml # Checks that files are valid TOML
- id: trailing-whitespace # Trims trailing whitespace
- id: mixed-line-ending # Replaces or checks mixed line ending
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline
- id: check-added-large-files # Checks for large files
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black # Python code formatter
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort # Python import sorter
args: ["--profile", "black"]
- repo: https://github.com/hadialqattan/pycln # removes unused imports
rev: v2.4.0
hooks:
- id: pycln # Removes unused imports
args: [--all]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
hooks:
- id: ruff # Run the linter.
args: [--fix]
- id: ruff-format # Run the formatter.
12 changes: 2 additions & 10 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.pylint",
"ms-python.isort",
"Codeium.codeium",
"ms-python.vscode-pylance",
"usernamehw.errorlens",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-spanish",
"Gruntfuggly.todo-tree",
"tamasfe.even-better-toml",
"ms-python.vscode-pylance",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
"unwantedRecommendations": []
}
47 changes: 30 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
{
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports": "explicit",
},
},
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"cSpell.language": "en,es",
"cSpell.words": [
"aiofiles",
"aiohttp",
"APKAIAHLS",
"articulos",
"bestaudio",
"bootcamp",
"codigo",
"Codigo",
"codigofacilito",
"colorlog",
"Consts",
"cookiefile",
"curso",
"descargar",
"downloaders",
"facilitopy",
"github",
"hashify",
"ivansaul",
"KHTML",
"levelname",
"linux",
"mhtml",
"msvc",
"mypy",
"noprogress",
"outtmpl",
"pipx",
"pycln",
"pydantic",
"pypa",
"pypi",
"pyproject",
"pytest",
"secho",
"slugified",
"tprint",
"typer"
],
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
},
"editor.formatOnSave": true
},
"isort.args": [
"--profile",
"black"
"typer",
"unidecode"
],
"python.testing.pytestArgs": [
"test"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"cSpell.language": "en,es",
}
Loading