Skip to content

Commit 3a31a5e

Browse files
committed
의존 패키지 설치방법 정리, README 개선, github build 속도 향상을 위해 mypy 검사 대상에서 tests 제외
1 parent c3348ef commit 3a31a5e

File tree

4 files changed

+41
-42
lines changed

4 files changed

+41
-42
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
21+
pip install -e .[dev]
2222
- name: Run unit tests
2323
run: |
2424
python -m pytest --cov=iamport
@@ -27,7 +27,7 @@ jobs:
2727
python -m flake8 iamport tests
2828
- name: Run type check
2929
run: |
30-
python -m mypy iamport tests
30+
python -m mypy iamport
3131
- name: Run import sort check
3232
run: |
3333
python -m isort iamport tests --diff

README.md

+28-33
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
1-
I'mport; REST Client Python
2-
---------------------------
1+
# I'mport; REST Client Python
32

43
[![Python Versions](https://img.shields.io/pypi/pyversions/iamport-rest-client)](https://pypi.org/project/iamport-rest-client/)
54
[![PyPI Release (latest by date)](https://img.shields.io/pypi/v/iamport-rest-client?color=blue)](https://pypi.org/project/iamport-rest-client/)
65
[![GitHub Workflow Status (Build)](https://img.shields.io/github/workflow/status/iamport/iamport-rest-client-python/Build%20Status)](https://github.com/iamport/iamport-rest-client-python/actions)
76
[![GitHub LICENSE](https://img.shields.io/github/license/iamport/iamport-rest-client-python)](https://github.com/iamport/iamport-rest-client-python/blob/master/LICENSE)
87
[![Lines of Code](https://img.shields.io/tokei/lines/github/iamport/iamport-rest-client-python)](https://github.com/iamport/iamport-rest-client-python/tree/master/iamport)
98

9+
## 소개
1010

11-
설명
12-
---
1311
> Python 개발자를 위한 [아임포트 REST API](https://api.iamport.kr/) 연동 패키지입니다.
1412
15-
주의 사항
16-
-------
13+
### 주의 사항
14+
1715
* 이용 중 발생한 문제에 대해 책임지지 않습니다.
1816
* `lexifdev`님의 도움을 받아 작성되었습니다[`lexifdev's iamport 모듈](https://github.com/lexifdev/iamport)
1917
* 최초 작성은 `[핑크퐁 북스토어](https://store.pinkfong.com)`에서 쓰기 위해 만들었습니다.
2018

21-
주요 기능
22-
---
19+
### 주요 기능
20+
2321
1. 결제 정보 찾기
2422
2. 가격 확인
2523
3. 취소
2624
4. 비 인증 결제
2725
5. 정기 예약 결제
2826
6. 본인인증결과 조회 및 삭제
2927

30-
설치
31-
---
32-
[추천 사항] 아나콘다 환경에서 작업하신다면, 우선 아래의 절차를 진행해주세요.
28+
### 설치
29+
3330
```bash
34-
# 아임포트 패키지를 위한 새로운 파이썬 가상환경을 생성해주세요. 이 때, 파이썬 버전은 최소 3.6 이상을 선택해주세요.
35-
conda create --name iamport python=3.6
31+
# mac, linux
32+
pip install iamport-rest-client
3633

37-
# 위에서 파이썬 가상환경이 정상적으로 설치되었다면, 해당 가상환경을 활성화해주세요.
34+
# 아나콘다
35+
conda create --name iamport python=3.6
3836
conda activate iamport
39-
```
40-
41-
다음 커맨드를 실행하여 최신버전의 아임포트 패키지를 설치해주세요.
42-
```bash
4337
python -m pip install iamport-rest-client --upgrade
44-
```
4538

46-
현재 개발중인 버전의 아임포트 패키지를 아래의 커맨드로 설치하실 수 있습니다.
47-
```bash
48-
python -m pip install git+https://github.com/iamport/iamport-rest-client-python.git@develop --upgrade
39+
# 개발버전
40+
pip install git+https://github.com/iamport/iamport-rest-client-python.git@master --upgrade # master
41+
pip install git+https://github.com/iamport/iamport-rest-client-python.git@v1.0.0 --upgrade # 특정 버전
4942
```
5043

51-
혹은, 특정 버전의 아임포트 패키지를 다음과 같이 설치하실 수 있습니다.
44+
### 개발 환경
45+
5246
```bash
53-
python -m pip install git+https://github.com/iamport/[email protected] --upgrade
47+
# venv 등 환경 준비 및 활성화
48+
pip install -e .[dev]
49+
pytest # 테스트 실행
5450
```
5551

56-
사용 준비
57-
-------
52+
### 기여하기
53+
54+
[iamport-rest-client-python 프로젝트 보드](https://github.com/iamport/iamport-rest-client-python/projects/1)`To do` 탭을 참고해주세요.
55+
56+
## 사용법
57+
58+
### 설정
5859

5960
```python
6061
from iamport import Iamport
@@ -72,8 +73,7 @@ iamport = Iamport(
7273
iamport = Iamport(imp_key='{발급받은 키}', imp_secret='{발급받은 시크릿}')
7374
```
7475

75-
사용 예제
76-
-------
76+
### 예제
7777

7878
결제를 진행한 상품 아이디나, 전달받은 IMP 아이디를 이용해 결제 정보를 찾습니다.
7979

@@ -98,7 +98,6 @@ iamport.is_paid(product_price, imp_uid='{IMP UID}')
9898
iamport.is_paid(product_price, response=response)
9999
```
100100

101-
102101
결제를 취소합니다.
103102

104103
```python
@@ -282,7 +281,3 @@ except Iamport.HttpError as http_error:
282281
# HTTP not 200 응답 에러 처리
283282
pass
284283
```
285-
286-
기여하기
287-
------
288-
[iamport-rest-client-python 프로젝트 보드](https://github.com/iamport/iamport-rest-client-python/projects/1)`To do` 탭을 참고해주세요.

requirements.txt

-7
This file was deleted.

setup.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ classifiers =
2727
zip_safe = False
2828
packages = find:
2929
python_requires = >=3.6
30+
install_requires =
31+
requests==2.26.0
32+
33+
[options.extras_require]
34+
dev =
35+
pytest==6.2.4
36+
pytest-cov==2.12.1
37+
flake8==4.0.1
38+
isort==5.9.3
39+
mypy==0.910
40+
types-requests==2.26.0
3041
3142
[options.packages.find]
3243
exclude = tests

0 commit comments

Comments
 (0)