Skip to content
Merged
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
70 changes: 35 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
pull_request:
branches: [ main, master, develop ]
branches: [ main, master, develop, 'feat/**' ]
push:
branches: [ main, master, develop ]
branches: ['**']
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -71,41 +71,11 @@ jobs:
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"

# PR: quick test (single environment)
test-quick:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: lint-check

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run tests with pytest
run: |
pytest -v --cov=pykrx --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false

# Push: full matrix tests
# PR: full matrix tests (comprehensive compatibility check)
test-full:
if: github.event_name == 'push'
if: github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
needs: lint-fix
needs: lint-check
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -155,3 +125,33 @@ jobs:
with:
file: ./coverage.xml
fail_ci_if_error: false

# Push: quick test (single environment for fast feedback)
test-quick:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: lint-fix

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run tests with pytest
run: |
pytest -v --cov=pykrx --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
6 changes: 3 additions & 3 deletions pykrx/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID

__version__ = version = '0.1.dev175+g96e3c214d.d20260124'
__version_tuple__ = version_tuple = (0, 1, 'dev175', 'g96e3c214d.d20260124')
__version__ = version = '0.1.dev179+g490499c97.d20260124'
__version_tuple__ = version_tuple = (0, 1, 'dev179', 'g490499c97.d20260124')

__commit_id__ = commit_id = 'g96e3c214d'
__commit_id__ = commit_id = 'g490499c97'
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ line-length = 88
target-version = "py310" # 최소 지원 버전에 맞춤

# 최소한의 exclude만 남김 (Ruff 기본값에 대부분 의존)
exclude = ["build", "dist"]
# Ignore setuptools-scm generated version file; it's autogenerated and may
# contain typing annotations that ruff flags.
exclude = ["build", "dist", "pykrx/_version.py"]

[tool.ruff.lint]
select = ["E", "F", "I", "W", "UP", "B", "C4"]
Expand Down
53 changes: 53 additions & 0 deletions tests/cassettes/etf/elw_ticker_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
interactions:
- request:
body: indIdx2=001&indIdx=1&strtDd=20260117&endDd=20260124&bld=dbms%2FMDC%2FSTAT%2Fstandard%2FMDCSTAT00301
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '99'
Content-Type:
- application/x-www-form-urlencoded
Referer:
- https://data.krx.co.kr/contents/MDC/MDI/outerLoader/index.cmd
User-Agent:
- Mozilla/5.0
method: POST
uri: https://data.krx.co.kr/comm/bldAttendant/getJsonData.cmd
response:
body:
string: '{"output":[{"TRD_DD":"2026/01/23","CLSPRC_IDX":"4,990.07","FLUC_TP_CD":"1","PRV_DD_CMPR":"37.54","UPDN_RATE":"0.76","OPNPRC_IDX":"4,984.08","HGPRC_IDX":"5,021.13","LWPRC_IDX":"4,926.22","ACC_TRDVOL":"612,601,752","ACC_TRDVAL":"30,017,138,130,375","MKTCAP":"4,125,555,096,685,080"},{"TRD_DD":"2026/01/22","CLSPRC_IDX":"4,952.53","FLUC_TP_CD":"1","PRV_DD_CMPR":"42.60","UPDN_RATE":"0.87","OPNPRC_IDX":"4,987.06","HGPRC_IDX":"5,019.54","LWPRC_IDX":"4,934.17","ACC_TRDVOL":"568,624,077","ACC_TRDVAL":"32,919,611,108,208","MKTCAP":"4,095,874,148,435,200"},{"TRD_DD":"2026/01/21","CLSPRC_IDX":"4,909.93","FLUC_TP_CD":"1","PRV_DD_CMPR":"24.18","UPDN_RATE":"0.49","OPNPRC_IDX":"4,808.94","HGPRC_IDX":"4,910.54","LWPRC_IDX":"4,807.13","ACC_TRDVOL":"600,101,467","ACC_TRDVAL":"30,093,031,855,585","MKTCAP":"4,061,917,379,318,616"},{"TRD_DD":"2026/01/20","CLSPRC_IDX":"4,885.75","FLUC_TP_CD":"2","PRV_DD_CMPR":"-18.91","UPDN_RATE":"-0.39","OPNPRC_IDX":"4,900.28","HGPRC_IDX":"4,935.48","LWPRC_IDX":"4,823.88","ACC_TRDVOL":"667,709,207","ACC_TRDVAL":"27,148,846,770,961","MKTCAP":"4,038,612,917,321,370"},{"TRD_DD":"2026/01/19","CLSPRC_IDX":"4,904.66","FLUC_TP_CD":"1","PRV_DD_CMPR":"63.92","UPDN_RATE":"1.32","OPNPRC_IDX":"4,829.40","HGPRC_IDX":"4,917.37","LWPRC_IDX":"4,827.95","ACC_TRDVOL":"570,841,030","ACC_TRDVAL":"25,214,738,198,401","MKTCAP":"4,056,832,202,296,880"}],"CURRENT_DATETIME":"2026.01.24
PM 08:15:06"}'
headers:
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Length:
- '514'
Content-Type:
- text/html; charset=utf-8
Date:
- Sat, 24 Jan 2026 11:15:06 GMT
Expires:
- Sat, 24 Jan 2026 11:15:06 GMT
Pragma:
- no-cache
Set-Cookie:
- __smVisitorID=QQnCqe4_gXn; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- __smVisitorID=sLQu9mQ4Pcg; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- __smVisitorID=RKtdbkrNBSq; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- JSESSIONID=fCE8TpgL24lcZjsrtXF8XD6HU5r1KRNgdrnZuP2yrrORCn71teSQx8uYGpbHrhJi.bWRjX2RvbWFpbi9tZGNvd2FwMS1tZGNhcHAwMQ==;
Domain=.krx.co.kr; Path=/; HttpOnly
Vary:
- Accept-Encoding
status:
code: 200
message: OK
version: 1
53 changes: 53 additions & 0 deletions tests/cassettes/etf/etn_ticker_list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
interactions:
- request:
body: indIdx2=001&indIdx=1&strtDd=20260117&endDd=20260124&bld=dbms%2FMDC%2FSTAT%2Fstandard%2FMDCSTAT00301
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '99'
Content-Type:
- application/x-www-form-urlencoded
Referer:
- https://data.krx.co.kr/contents/MDC/MDI/outerLoader/index.cmd
User-Agent:
- Mozilla/5.0
method: POST
uri: https://data.krx.co.kr/comm/bldAttendant/getJsonData.cmd
response:
body:
string: '{"output":[{"TRD_DD":"2026/01/23","CLSPRC_IDX":"4,990.07","FLUC_TP_CD":"1","PRV_DD_CMPR":"37.54","UPDN_RATE":"0.76","OPNPRC_IDX":"4,984.08","HGPRC_IDX":"5,021.13","LWPRC_IDX":"4,926.22","ACC_TRDVOL":"612,601,752","ACC_TRDVAL":"30,017,138,130,375","MKTCAP":"4,125,555,096,685,080"},{"TRD_DD":"2026/01/22","CLSPRC_IDX":"4,952.53","FLUC_TP_CD":"1","PRV_DD_CMPR":"42.60","UPDN_RATE":"0.87","OPNPRC_IDX":"4,987.06","HGPRC_IDX":"5,019.54","LWPRC_IDX":"4,934.17","ACC_TRDVOL":"568,624,077","ACC_TRDVAL":"32,919,611,108,208","MKTCAP":"4,095,874,148,435,200"},{"TRD_DD":"2026/01/21","CLSPRC_IDX":"4,909.93","FLUC_TP_CD":"1","PRV_DD_CMPR":"24.18","UPDN_RATE":"0.49","OPNPRC_IDX":"4,808.94","HGPRC_IDX":"4,910.54","LWPRC_IDX":"4,807.13","ACC_TRDVOL":"600,101,467","ACC_TRDVAL":"30,093,031,855,585","MKTCAP":"4,061,917,379,318,616"},{"TRD_DD":"2026/01/20","CLSPRC_IDX":"4,885.75","FLUC_TP_CD":"2","PRV_DD_CMPR":"-18.91","UPDN_RATE":"-0.39","OPNPRC_IDX":"4,900.28","HGPRC_IDX":"4,935.48","LWPRC_IDX":"4,823.88","ACC_TRDVOL":"667,709,207","ACC_TRDVAL":"27,148,846,770,961","MKTCAP":"4,038,612,917,321,370"},{"TRD_DD":"2026/01/19","CLSPRC_IDX":"4,904.66","FLUC_TP_CD":"1","PRV_DD_CMPR":"63.92","UPDN_RATE":"1.32","OPNPRC_IDX":"4,829.40","HGPRC_IDX":"4,917.37","LWPRC_IDX":"4,827.95","ACC_TRDVOL":"570,841,030","ACC_TRDVAL":"25,214,738,198,401","MKTCAP":"4,056,832,202,296,880"}],"CURRENT_DATETIME":"2026.01.24
PM 08:15:06"}'
headers:
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Length:
- '514'
Content-Type:
- text/html; charset=utf-8
Date:
- Sat, 24 Jan 2026 11:15:06 GMT
Expires:
- Sat, 24 Jan 2026 11:15:06 GMT
Pragma:
- no-cache
Set-Cookie:
- __smVisitorID=GjtYl6lUzhj; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- __smVisitorID=jDkrUFpTQk9; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- __smVisitorID=V6qpc8Hj2Zd; Expires=Sun, 24-Jan-2027 11:15:06 GMT; Path=/
- JSESSIONID=fHCOUFNI1ziNcphctQS8lqmAknFSEJ7Fdvr4WXJaa9SShpjjtjFuUCaV986SMWBM.bWRjX2RvbWFpbi9tZGNvd2FwMi1tZGNhcHAxMQ==;
Domain=.krx.co.kr; Path=/; HttpOnly
Vary:
- Accept-Encoding
status:
code: 200
message: OK
version: 1
Loading