Skip to content

Commit c368585

Browse files
authored
Merge pull request #37 from sypht-team/chore/add-build-workflow
chore: add build workflow
2 parents 961ce13 + 2843221 commit c368585

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
environment: deploy
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python 3.9
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: "3.9"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install pytest coverage codecov
30+
pip install .
31+
- name: Test with pytest
32+
env:
33+
SYPHT_API_BASE_ENDPOINT: ${{ vars.SYPHT_API_BASE_ENDPOINT }}
34+
SYPHT_API_KEY: ${{ secrets.SYPHT_API_KEY }}
35+
SYPHT_AUTH_ENDPOINT: ${{ vars.SYPHT_AUTH_ENDPOINT }}
36+
run: |
37+
pytest -s tests/*.py

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-and-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI
8+
runs-on: ubuntu-latest
9+
environment: deploy
10+
if: startsWith(github.ref, 'refs/tags')
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.9"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: >-
25+
python3 -m
26+
build
27+
--sdist
28+
--wheel
29+
--outdir dist/
30+
.
31+
- name: Publish distribution 📦 to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
password: ${{ secrets.PYPI_API_TOKEN }}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import find_packages, setup
22

3-
__version__ = "0.5.16"
3+
__version__ = "0.5.17"
44
__pkg_name__ = "sypht"
55

66
setup(

tests/tests_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_with_wrong_fieldset(self):
3939

4040
def test_data_extraction_1(self):
4141
with open("tests/sample_invoice.pdf", "rb") as f:
42-
fid = self.sypht_client.upload(f, ["invoices"])
42+
fid = self.sypht_client.upload(f, ["invoices:2"])
4343
self.assertTrue(validate_uuid4(fid))
4444

4545
results = self.sypht_client.fetch_results(fid)

0 commit comments

Comments
 (0)