Skip to content

Commit e1f0c40

Browse files
authored
Merge pull request #78 from ESousa97/feature/new-version
Major project overhaul: docs translation, new modules, examples, CI, …
2 parents e27734d + 8934fd8 commit e1f0c40

43 files changed

Lines changed: 4442 additions & 781 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install build dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build twine
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Check package with twine
29+
run: twine check dist/*
30+
31+
- name: Publish to PyPI
32+
env:
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35+
run: twine upload dist/*

.github/workflows/quality.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.11'
21+
cache: 'pip'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -e ".[dev]"
27+
28+
- name: Run black
29+
run: black --check --diff perplexity perplexity_async
30+
31+
- name: Run isort
32+
run: isort --check-only --diff perplexity perplexity_async
33+
34+
- name: Run flake8
35+
run: flake8 perplexity perplexity_async
36+
37+
- name: Run mypy
38+
run: mypy perplexity perplexity_async
39+
40+
- name: Run pylint
41+
run: pylint perplexity perplexity_async || true
42+
43+
- name: Security check with bandit
44+
run: bandit -r perplexity perplexity_async -ll

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop, feature/* ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: 'pip'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -e ".[dev]"
32+
33+
- name: Lint with flake8
34+
run: |
35+
flake8 perplexity perplexity_async --count --select=E9,F63,F7,F82 --show-source --statistics
36+
flake8 perplexity perplexity_async --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
38+
- name: Check formatting with black
39+
run: |
40+
black --check perplexity perplexity_async
41+
42+
- name: Type check with mypy
43+
run: |
44+
mypy perplexity perplexity_async
45+
46+
- name: Run tests with pytest
47+
run: |
48+
pytest tests/ -v --cov=perplexity --cov=perplexity_async --cov-report=xml --cov-report=term
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v4
52+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
53+
with:
54+
file: ./coverage.xml
55+
flags: unittests
56+
name: codecov-umbrella
57+
fail_ci_if_error: false

0 commit comments

Comments
 (0)