-
Notifications
You must be signed in to change notification settings - Fork 337
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
Showing
10 changed files
with
233 additions
and
126 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,45 @@ | ||
name: Publish to PyPI | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install . | ||
pip install pytest | ||
- name: Run tests | ||
run: pytest -v | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
needs: [test] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheel | ||
run: pipx run build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
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
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "24.3.3" | ||
__version__ = "24.3.4" |
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
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 |
---|---|---|
@@ -1,29 +1,18 @@ | ||
from functools import cache | ||
|
||
import pytest | ||
import requests | ||
from PIL import Image | ||
|
||
|
||
@cache | ||
def _sample_image(): | ||
url = "https://i.imgur.com/E5OVXvn.png" | ||
resp = requests.get(url, stream=True, headers={"User-Agent": "Mozilla/5.0"}) | ||
return Image.open(resp.raw) | ||
|
||
|
||
@cache | ||
def _sample_image2(): | ||
url = "https://i.imgur.com/px5UT7T.png" | ||
def get_image(url: str) -> Image.Image: | ||
resp = requests.get(url, stream=True, headers={"User-Agent": "Mozilla/5.0"}) | ||
return Image.open(resp.raw) | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.fixture(scope="session") | ||
def sample_image(): | ||
return _sample_image() | ||
return get_image("https://i.imgur.com/E5OVXvn.png") | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.fixture(scope="session") | ||
def sample_image2(): | ||
return _sample_image2() | ||
return get_image("https://i.imgur.com/px5UT7T.png") |
Oops, something went wrong.