-
Notifications
You must be signed in to change notification settings - Fork 2
Enable pytest-asyncio tests in CI #92
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
Changes from all commits
bfce9ac
695bc5f
bfb3a43
d0f98ac
b08fe51
28973b9
12b230f
638d602
3be22b7
ca31048
773fad8
aa21368
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,19 +56,18 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install a specific version of uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
enable-cache: true | ||
version: "0.5.x" | ||
version: "latest" | ||
|
||
- name: uv sync | ||
working-directory: python | ||
run: uv sync --no-install-package geoindex-rs | ||
run: uv sync --no-install-package async-tiff | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like the line above this is incorrect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean Edit: Just removed the entire There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it needs to be You see this line: https://github.com/developmentseed/async-tiff/actions/runs/14786441598/job/41515604193#step:7:19 When you run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I think you're right. Checking the timings:
So let's do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Final timings at commit aa21368, job https://github.com/developmentseed/async-tiff/actions/runs/14825301405/job/41617636468:
|
||
- name: maturin venv Build | ||
working-directory: python | ||
run: uv run --no-project maturin develop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I though if the working directory is set to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not the cargo project that's the issue. It's the uv project. We don't want uv automatically building the rust parts of async-tiff in release mode. |
||
|
||
# - name: Run pytest | ||
# working-directory: python | ||
# run: uv run --no-project pytest | ||
- name: Run pytest | ||
working-directory: python | ||
run: uv run --no-project pytest --verbose |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
import async_tiff | ||
from time import time | ||
from async_tiff import TIFF | ||
from async_tiff import TIFF, enums | ||
from async_tiff.store import S3Store | ||
|
||
store = S3Store("sentinel-cogs", region="us-west-2", skip_signature=True) | ||
path = "sentinel-s2-l2a-cogs/12/S/UF/2022/6/S2B_12SUF_20220609_0_L2A/B04.tif" | ||
|
||
tiff = await TIFF.open(path, store=store, prefetch=32768) | ||
async def test_cog_s3(): | ||
""" | ||
Ensure that TIFF.open can open a Sentinel-2 Cloud-Optimized GeoTIFF file from an | ||
s3 bucket, read IFDs and GeoKeyDirectory metadata. | ||
""" | ||
path = "sentinel-s2-l2a-cogs/12/S/UF/2022/6/S2B_12SUF_20220609_0_L2A/B04.tif" | ||
store = S3Store("sentinel-cogs", region="us-west-2", skip_signature=True) | ||
tiff = await TIFF.open(path=path, store=store, prefetch=32768) | ||
|
||
start = time() | ||
tiff = await TIFF.open(path, store=store, prefetch=32768) | ||
end = time() | ||
end - start | ||
ifds = tiff.ifds | ||
assert len(ifds) == 5 | ||
|
||
ifds = tiff.ifds | ||
ifd = ifds[0] | ||
ifd.compression | ||
ifd.tile_height | ||
ifd.tile_width | ||
ifd.photometric_interpretation | ||
gkd = ifd.geo_key_directory | ||
gkd.citation | ||
gkd.projected_type | ||
gkd.citation | ||
ifd = ifds[0] | ||
assert ifd.compression == enums.CompressionMethod.Deflate | ||
assert ifd.tile_height == 1024 | ||
assert ifd.tile_width == 1024 | ||
assert ifd.photometric_interpretation == enums.PhotometricInterpretation.BlackIsZero | ||
|
||
dir(gkd) | ||
gkd = ifd.geo_key_directory | ||
assert gkd.citation == "WGS 84 / UTM zone 12N" | ||
assert gkd.projected_type == 32612 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume
enable-cache
is true by default in the latestsetup-uv
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, default was changed to
enable-cache: true
since setup-uv v5, see https://github.com/astral-sh/setup-uv/releases/tag/v5.0.0