Skip to content
Merged

1.9.1 #259

Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- main

env:
VERSION_NUMBER: 'v1.9.0'
VERSION_NUMBER: 'v1.9.1'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.6'
go-version: '1.25.8'

- name: Build Go Binary
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25

- name: Lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.0.1
version: v2.11.4
skip-cache: true
2 changes: 1 addition & 1 deletion .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25

- name: Install dependencies
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
name: Codspeed Benchmarks
name: Python Tests

on:
push:
branches:
- main
paths:
- 'card_data/**'
- 'web/**'
pull_request:
types: [ opened, reopened, synchronize ]
types: [opened, reopened, synchronize]
paths:
- 'card_data/**'
- 'web/**'

permissions:
contents: read
id-token: write

jobs:
benchmarks:
card-data-benchmarks:
runs-on: ubuntu-22.04
defaults:
run:
Expand All @@ -41,4 +44,28 @@ jobs:
with:
working-directory: card_data
mode: simulation
run: uv run pytest pipelines/tests/ -v --codspeed
run: uv run pytest pipelines/tests/ -v --codspeed

streamlit-testing:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: web

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies
run: uv sync --dev

- name: Run tests
run: uv run pytest app_test.py -v
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- -s -w -X main.version=v1.9.0
- -s -w -X main.version=v1.9.1

archives:
- formats: [ 'zip' ]
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build 1
FROM golang:1.24.12-alpine3.23 AS build
FROM golang:1.25.8-alpine3.23 AS build

WORKDIR /app

Expand All @@ -8,7 +8,7 @@ RUN go mod download

COPY . .

RUN go build -ldflags "-X main.version=v1.9.0" -o poke-cli .
RUN go build -ldflags "-X main.version=v1.9.1" -o poke-cli .

# build 2
FROM --platform=$BUILDPLATFORM alpine:3.23
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img width="425" src="poke-cli.png" alt="pokemon-logo"/>
<h4></h4>
<img src="https://img.shields.io/github/v/release/digitalghost-dev/poke-cli?style=flat-square&logo=git&logoColor=FFCC00&label=Release%20Version&labelColor=EEE&color=FFCC00" alt="version-label">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.9.0?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/docker/image-size/digitalghostdev/poke-cli/v1.9.1?arch=arm64&style=flat-square&logo=docker&logoColor=FFCC00&labelColor=EEE&color=FFCC00" alt="docker-image-size">
<img src="https://img.shields.io/github/actions/workflow/status/digitalghost-dev/poke-cli/ci.yml?branch=main&style=flat-square&logo=github&logoColor=FFCC00&label=CI&labelColor=EEE&color=FFCC00" alt="ci-status-badge">
</div>
<div align="center">
Expand Down Expand Up @@ -99,15 +99,29 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
docker run --rm -it digitalghostdev/poke-cli:v1.9.0 <command> [subcommand] [flag]
docker run --rm -it digitalghostdev/poke-cli:v1.9.1 <command> [subcommand] [flag]
```
* Enter the container and use its shell:
```bash
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.0 -c "cd /app && exec sh"
docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.1 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```

> [!NOTE]
> The `card` command renders TCG card images using your terminal's graphics protocol. When running inside Docker, pass your terminal's environment variables so image rendering works correctly:
> ```bash
> # Kitty
> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1 card
>
> # WezTerm, iTerm2, Ghostty, Konsole, Rio, Tabby
> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.1 card
>
> # Windows Terminal (Sixel)
> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.1 card
> ```
> If your terminal is not listed above, image rendering is not supported inside Docker.

### Binary

1. Head to the [releases](https://github.com/digitalghost-dev/poke-cli/releases) page of the project.
Expand Down
1 change: 1 addition & 0 deletions card_data/pipelines/defs/extract/tcgcsv/extract_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

SET_PRODUCT_MATCHING = {
# Mega Evolution
"me03": "24587",
"me02.5": "24541",
"me02": "24448",
"me01": "24380",
Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/defs/extract/tcgdex/extract_cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@dg.asset(kinds={"API"}, name="extract_card_url_from_set_data")
def extract_card_url_from_set() -> list:
urls = ["https://api.tcgdex.net/v2/en/sets/me02.5"]
urls = ["https://api.tcgdex.net/v2/en/sets/me03"]

all_card_urls = []

Expand Down
2 changes: 1 addition & 1 deletion card_data/pipelines/soda/checks_sets.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
checks for sets:
# Row count validation
- row_count > 41
- row_count > 50

# Schema validation checks
- schema:
Expand Down
19 changes: 9 additions & 10 deletions card_data/pipelines/tests/extract_series_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import responses
from pipelines.defs.extract.tcgdex.extract_series import extract_series_data


@pytest.fixture
def mock_api_response():
"""Sample API response matching tcgdex format"""
Expand All @@ -19,23 +20,21 @@ def mock_api_response():
{"id": "sm", "name": "Sun & Moon", "logo": None},
]

@pytest.mark.benchmark

@responses.activate
def test_extract_series_data_success(mock_api_response):
def test_extract_series_data_success(benchmark, mock_api_response):
"""Test successful extraction and filtering"""
# Mock the API call
responses.add(
responses.GET,
"https://api.tcgdex.net/v2/en/series",
json=mock_api_response,
status=200
)

result = extract_series_data()
result = benchmark(extract_series_data)

# Assertions
assert isinstance(result, pl.DataFrame) # nosec
assert len(result) == 4 # nosec
assert set(result["id"].to_list()) == {"swsh", "sv", "me", "sm"} # nosec
assert "name" in result.columns # nosec
assert "logo" in result.columns # nosec
assert isinstance(result, pl.DataFrame) # nosec
assert len(result) == 4 # nosec
assert set(result["id"].to_list()) == {"swsh", "sv", "me", "sm"} # nosec
assert "name" in result.columns # nosec
assert "logo" in result.columns # nosec
18 changes: 6 additions & 12 deletions card_data/pipelines/tests/extract_sets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ def mock_api_response():
}


@pytest.mark.benchmark
@responses.activate
def test_extract_sets_data_success(mock_api_response):
def test_extract_sets_data_success(benchmark, mock_api_response):
"""Test successful extraction of sets from multiple series"""
# Mock all API calls
for url, response_data in mock_api_response.items():
responses.add(
responses.GET,
Expand All @@ -95,9 +93,8 @@ def test_extract_sets_data_success(mock_api_response):
status=200,
)

result = extract_sets_data()
result = benchmark(extract_sets_data)

# Assertions
assert isinstance(result, pl.DataFrame) # nosec
assert len(result) == 6 # nosec (2 + 2 + 1 + 1 sets)
assert set(result.columns) == { # nosec
Expand All @@ -113,11 +110,9 @@ def test_extract_sets_data_success(mock_api_response):
assert set(result["set_id"].to_list()) == {"me01", "me02", "sv01", "sv02", "swsh1", "sm1"} # nosec


@pytest.mark.benchmark
@responses.activate
def test_extract_sets_data_empty_sets(mock_api_response):
def test_extract_sets_data_empty_sets(benchmark, mock_api_response):
"""Test extraction when a series has no sets"""
# Modify one response to have empty sets
mock_api_response["https://api.tcgdex.net/v2/en/series/me"]["sets"] = []

for url, response_data in mock_api_response.items():
Expand All @@ -128,16 +123,15 @@ def test_extract_sets_data_empty_sets(mock_api_response):
status=200,
)

result = extract_sets_data()
result = benchmark(extract_sets_data)

assert isinstance(result, pl.DataFrame) # nosec
assert len(result) == 4 # nosec (0 + 2 + 1 + 1 sets)
assert "me" not in result["series_id"].to_list() # nosec


@pytest.mark.benchmark
@responses.activate
def test_extract_sets_data_null_card_counts():
def test_extract_sets_data_null_card_counts(benchmark):
"""Test extraction with null card counts"""
mock_responses = {
"https://api.tcgdex.net/v2/en/series/me": {
Expand Down Expand Up @@ -178,7 +172,7 @@ def test_extract_sets_data_null_card_counts():
status=200,
)

result = extract_sets_data()
result = benchmark(extract_sets_data)

assert isinstance(result, pl.DataFrame) # nosec
assert len(result) == 1 # nosec
Expand Down
Loading
Loading