Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python開発に役立つツールの紹介 - NIFTY Tech Talk #11
Search
ニフティ株式会社
PRO
May 30, 2023
Video
Resources
Programming
750
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python開発に役立つツールの紹介 - NIFTY Tech Talk #11
ニフティ株式会社
PRO
May 30, 2023
Video
Resources
新人エンジニアに贈る最強の開発環境 - NIFTY Tech Talk #11
https://nifty.connpass.com/event/284175/
More Decks by ニフティ株式会社
See All by ニフティ株式会社
microCMS移行をいまならAIでどう進めるか - microCMS Meetup 2026
niftycorp
PRO
0
600
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
4.4k
ニフティ株式会社 エンジニア向け Company Deck 2026年版
niftycorp
PRO
0
1.5k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
430
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
470
AI 開発合宿を通して得た学び
niftycorp
PRO
0
440
なぜISPでオリジナルカードゲームを作ったのか?制作者と対談 - NIFTY Tech Talk #25
niftycorp
PRO
0
140
「なぜかネットが遅い」を“見える化”する 〜マイ ニフティが繋ぐサポートと暮らし〜 - NIKKEI Tech Talk #39
niftycorp
PRO
0
720
InnerSource Summit 2025 Three points that promoted innersource activities
niftycorp
PRO
0
380
Other Decks in Programming
See All in Programming
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.1k
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.6k
Workers Cache を知る
syumai
0
370
ジョジョの世界をXRで再現する
mofurune
0
160
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
950
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
A better future with KSS
kneath
240
18k
Building AI with AI
inesmontani
PRO
1
1.3k
Prompt Engineering for Job Search
mfonobong
0
520
The Pragmatic Product Professional
lauravandoore
37
7.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
My Coaching Mixtape
mlcsv
0
360
Transcript
Copyright © NIFTY Corporation All Rights Reserved. Python開発に役⽴つツールの紹介 ⼩倉聡司 NIFTY
Tech Talk #11 「新⼈エンジニアに贈る最強の開発環境」 2023/05/30
Copyright © NIFTY Corporation All Rights Reserved. ⾃⼰紹介 ⼩倉 聡司(おぐら
さとし) ニフティ株式会社 基幹システムグループ 課⾦システムチーム 新卒⼊社3年⽬ 担当業務 書⾯発送システム、課⾦請求系システム等の開発・運⽤
Copyright © NIFTY Corporation All Rights Reserved. 話すこと ❏ 効率性や品質向上に繋がる便利な以下のツールについて紹介します
❏ Poetry パッケージ管理ツール ❏ Ruff Linter ❏ Black Formatter ❏ Mypy 静的型チェッカー ❏ Pytest 単体テストツール
Copyright © NIFTY Corporation All Rights Reserved. Poetry Pythonパッケージ管理ツールの⼀種 依存関係の管理、パッケージングを効率化するツール
❏ 特徴 ❏ 依存関係の管理 ❏ プロジェクトの仮想環境 ❏ パッケージング
Copyright © NIFTY Corporation All Rights Reserved. Poetry ❏ メリット
❏ 依存関係の管理を簡素化してくれる ❏ バージョンの衝突や互換性を回避 プロジェクト内のライブラリの⼀貫性を保つのに役⽴つ
Copyright © NIFTY Corporation All Rights Reserved. Poetry Poetryインストール curl
-sSL https://install.python-poetry.org | python3 - # 新規プロジェクトの場合 poetry new <project_name> # 既存プロジェクトの場合 poetry init プロジェクトのセットアップ
Copyright © NIFTY Corporation All Rights Reserved. Poetry [tool.poetry] name
= "techtalk" version = "0.1.0" description = "" authors = ["ogura <メールアドレス>"] readme = "README.md" [tool.poetry.dependencies] python = "^3.11" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" pyproject.toml
Copyright © NIFTY Corporation All Rights Reserved. Poetry # 本番環境で必須のパッケージ
poetry add pydantic # 開発環境でのみ必要なパッケージ poetry add mypy ruff black pytest --dev パッケージの追加 [tool.poetry.dependencies] python = "^3.11" pydantic = "^1.10.8" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" mypy = "^1.3.0" ruff = "^0.0.269" black = "^23.3.0"
Copyright © NIFTY Corporation All Rights Reserved. パッケージのインストール Poetry 仮想環境外からの操作
poetry run <command> poetry install 仮想環境に⼊る poetry shell
Copyright © NIFTY Corporation All Rights Reserved. Rustで記述されたPython⽤Linter ❏ Linterとは︖
❏ Linterは特定のコード規約に従っていないコードがないかを静的解 析によりチェックするツール ❏ 特徴 ❏ 静的コード解析 ❏ さまざまなlintルールの選択 ❏ ⾃動修正 Ruff
Copyright © NIFTY Corporation All Rights Reserved. Ruff ❏ メリット
❏ エラーの早期発⾒ ❏ コードの可読性向上 ❏ チームでのコーディングルールの共通化 プロジェクトの品質とメンテナンスの容易化に役⽴つ
Copyright © NIFTY Corporation All Rights Reserved. Ruff Lintルール選択 ruff
. --select E --select W ruff . --ignore E501 ruff . --select E --select W --ignore E501 --fix 適応しないルール ⾃動修正 チェックのみ(修正はしない) ruff check .
Copyright © NIFTY Corporation All Rights Reserved. BlackはPEP8に準拠したPython⽤Formatter ❏ Formatterとは︖
❏ コードのスタイルを静的解析を⾏いチェックするツール ❏ 特徴 ❏ ⾃動フォーマット ❏ フォーマットの⼀貫性 Black
Copyright © NIFTY Corporation All Rights Reserved. ❏ メリット ❏
コードのフォーマットを⾃動化してくれる ❏ チーム全体でコードのスタイルを統⼀してくれる Black 開発効率向上、品質と保守性の向上に役⽴つ
Copyright © NIFTY Corporation All Rights Reserved. Black 1⾏における最⼤⽂字数の指定 チェックのみ(フォーマットはされません)
フォーマットの差分を確認 black --line-length 120 . black --check . black --check --diff .
Copyright © NIFTY Corporation All Rights Reserved. MypyはPythonの静的型チェックを実⾏するツール ❏ 静的型チェック
❏ Pythonの型ヒントを活⽤し、コードの型エラーを検出 ❏ メリット ❏ エラーや意図しない動作を事前に防ぐことが可能 ❏ 信頼性の⾼いコードを実装し、効率的なデバッグ、保守が可能 Mypy 品質向上とバグの早期発⾒に役⽴つ
Copyright © NIFTY Corporation All Rights Reserved. Mypy 型チェック 厳格に型チェックをする場合
mypy . mypy --strict .
Copyright © NIFTY Corporation All Rights Reserved. Pythonで書かれたテストを実⾏するツール Pytest ❏
特徴 ❏ シンプルな構⽂ ❏ 豊富なアサーション ❏ テストランナー機能と柔軟性 ❏ テストカバレッジのサポート
Copyright © NIFTY Corporation All Rights Reserved. Pytest ❏ メリット
❏ シンプルな構⽂と豊富な機能を持つ ❏ さまざまなテストパターンに活⽤できる 品質を確保するのに役に⽴つ
Copyright © NIFTY Corporation All Rights Reserved. Pytest テストの実⾏ pytest
カバレッジの計測 # install pip install pytest-cov # カバレッジの計測 pytest –cov=<対象のディレクトリorファイル>
Copyright © NIFTY Corporation All Rights Reserved. ツールの設定値をpyproject.tomlにまとめる [tool.ruff] select
= [ # pyflakes "F", # pycodestyle errors, warnings "E", "W", # isort "I", # flake8-2020 "YTT", # flake8-bugbear "B", ] target-version = "py311" line-length = 120 [tool.mypy] warn_return_any = true warn_unused_configs = true disallow_untyped_defs = true strict = true [tool.black] line-length = 120 target-version = ["py311"] [tool.pytest.ini_options] testpaths = [ "tests", ] 今まで紹介したツールはpyproject.tomlに⼀元管理できる
Copyright © NIFTY Corporation All Rights Reserved. まとめ ❏ 紹介したツールを活⽤することでコードの品質向上やバグの早期発⾒
に役⽴ちます。 ❏ チームに導⼊することで開発における品質と⽣産性を向上させ効率的 な開発プロセスを実現しましょう。 *Docker環境で今回紹介したツールを活⽤する⽅法は以下のページに記述 https://engineering.nifty.co.jp/blog/16673
Copyright © NIFTY Corporation All Rights Reserved.