Read this article on Medium New Year 2020 marks the end of more than a decade of coexistence of Python 2 and 3. The Python landscape has changed considerably over this period: a host of new tools and best practices now improve the Python developer experience. Their adoption, however, lags behind due to the constraints of legacy support. This article series is a guide to modern Python tooling with
Code audit tool for Python. Pylama wraps these tools: pycodestyle (formerly pep8) © 2012-2013, Florent Xicluna; pydocstyle (formerly pep257 by Vladimir Keleshev) © 2014, Amir Rachum; PyFlakes © 2005-2013, Kevin Watters; Mccabe © Ned Batchelder; Pylint © 2013, Logilab; Radon © Michele Lacchia eradicate © Steven Myint; Mypy © Jukka Lehtosalo and contributors; Vulture © Jendrik Seipp and contributors
# Advanced Python Testing 26 min read... This article is mostly for me to process my thoughts but also to pave a path for anyone that wants to follow a similar journey on some more advanced python testing topics. I recently had the opportunity to garbage collect a bunch of common libraries at my company into a new python library and git repository. Marking all the critical path libraries and copyi
Python その2 Advent Calendar 2018 16日目の投稿が空いていたので、めっちゃ日が過ぎてますが飛び込み投稿。 今回は、昨今よく聞くようになった「DevSecOps」(DevOps + Security) 活動で重要になってくる、「セキュリティテストも自動で回す」を実現するためのツールを紹介します。 DevSecOpsについてはこのあたりを参照。2018年のトレンドらしいです。 2018年のトレンドは、DevOpsにセキュリティを融合した「DevSecOps」 (1/2) - ITmedia エンタープライズ 自動セキュリティテストには SAST, DAST, IAST と呼ばれるものがあります。 SAST: Static Application Security Testing(静的セキュリティ検査) ソースコード自体を解析・検査して脆弱性を見つけ出すもの 動くコ
備忘録として。 コードメトリクス解析ツール Radon 下記指標を計測可能。 循環的複雑度(Cyclomatic complexity) 保守容易性指数(Maintainability Index ) 循環的複雑度(Cyclomatic complexity)の計測例。 radon cc -s -e "*/tests/*" --min F src/保守容易性指数(Maintainability Index )の計測例。 radon mi -s -e "*/tests/*" --min C src/ 参考 GitHub - rubik/radon: Various code metrics for Python code 保守性・可読性の高いPythonコードを実装するためにはどうすればよいか - はてなの金次郎 ファジングツール syzkaller/syzbot 参考 "syzbot"と"
PySnooper を使うと print() や pdb を使わずにデバッグを行うことが出来ます。 PySnooper のページには PySnooper is a poor man's debugger. と書かれていました。 PySnooper の使い方をメモしておきます。 尚、ソースコードは cool-RR / PySnooper にありました。 ソースコードの行数 単純に行数だけ数えた場合、現時点では約 800 行のようです。 熟読出来ていませんが、中核となる実装は tracer.py に集中しているように見えました。 $ git clone https://github.com/cool-RR/PySnooper $ cd PySnooper/pysnooper/ $ find . -name '*.py' | xargs wc -l 30 ./__init__.py 82 ./p
[tox] envlist = py{36,37} skip_missing_interpreters = true [testenv] description = Unit Test and Integration Test with coverages passenv = LANG deps = pytest pytest-cov pytest-pythonpath flake8 pep8 pyflakes pytest-flake8 pytest-pep8 coverage black commands = python setup.py install coverage run --source=hogehoge -m pytest --junit-xml=test_results.xml coverage report -m coverage html coverage xml
概要 Pythonモジュールに対するCIで、勉強がてらtoxを導入してみたため、自分用に設定ファイルによく書きそうな内容をまとめて記述しておきます。 ※toxバージョン>=3.14での内容となります。 toxとは virtualenvを利用したMultiEnvironmentでのテストを実施することができるツールです。 複数バージョンのPythonでモジュールに対するテスト実施できる点が便利です。 設定ファイル種別 ドキュメントによると、3種類のファイルを次の優先順位で読み込みます。 pyproject.toml tox.ini setup.cfg 以下に記載していくのはtox.iniの内容となります。 埋め込み変数 各セクションで利用できる埋め込み変数の一覧です。 設定名 概要
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く