Skip to content

mozkzki/moz-library

Repository files navigation

moz-library

CircleCI codecov Maintainability

図書館で借りた本や予約した本の状況を取得する自前ライブラリ。

Function

  • search_rental (借りている本の状況確認)
  • search_reserve (予約している本の状況確認)

Usage

Environmental variables

.envファイルに書いてproject rootに配置。.env_sampleをコピーすると楽。

USER1='{"name": "foo1", "disp_name": "Foo1", "id": "11111", "password": "pass"}'
USER2='{"name": "foo2", "disp_name": "Foo2", "id": "11112", "password": "pass"}'
USER3='{"name": "foo3", "disp_name": "Foo3", "id": "11113", "password": "pass"}'
USER4='{"name": "foo4", "disp_name": "Foo4", "id": "11114", "password": "pass"}'
CHROME_BINARY_LOCATION='/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'
CHROME_DRIVER_LOCATION='/usr/local/bin/chromedriver'

Install

pip install git+https://github.com/mozkzki/moz-library
# upgrade
pip install --upgrade git+https://github.com/mozkzki/moz-library
# uninstall
pip uninstall moz-library

Coding

import moz_library
messages = moz_library.search_rental({
    "mode": "rental",
    "all_user": False,
    "users": ["USER1"],
    "debug": False,
    "zero_behavior": "message",
    "separate": False
})
import pprint
pprint.pprint(messages)

Develop

base project: mozkzki/moz-sample

Prepare

poetry install
poetry shell

Run (Example)

python ./examples/example.py
# or
make start

Unit Test

test all.

pytest
pytest -v # verbose
pytest -s # show standard output (same --capture=no)
pytest -ra # show summary (exclude passed test)
pytest -rA # show summary (include passed test)

with filter.

pytest -k app
pytest -k test_app.py
pytest -k my

specified marker.

pytest -m 'slow'
pytest -m 'not slow'

make coverage report.

pytest -v --capture=no --cov-config .coveragerc --cov=src --cov-report=xml --cov-report=term-missing .
# or
make ut

Lint

flake8 --max-line-length=100 --ignore=E203,W503 ./src
# or
make lint

Create API Document (Sphinx)

make doc

Update dependency modules

dependabot (GitHub公式) がプルリクを挙げてくるので確認してマージする。

  • 最低でもCircleCIが通っているかは確認
  • CircleCIでは、最新の依存モジュールでtestするためpoetry updateしてからtestしている
  • dependabotはpyproject.tomlpoetry.lockを更新してくれる

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages