私は多くの「make for Python」プロジェクトをかき集めてきましたが、ケーキ ファイルのようにシンプルなものは見つかりませんでした。私が探しているのは、次のことを可能にする Python の同等物です。
- ビルド コマンドをプロジェクト ルートの 1 つのファイルに保持する
- 「make」ファイルが引数なしで実行されたときに自動的に表示される説明とともに、各タスクを単純な関数として定義します。
- Python モジュールをインポートする
私はこのようなものを描いています:
from pymake import task, main
@task('reset_tables', 'Drop and recreate all MySQL tables')
def reset_tables():
# ...
@task('build_stylus', 'Build the stylus files to public/css/*')
def build_stylus():
from myproject import stylus_builder
# ...
@task('build_cscript', 'Build the coffee-script files to public/js/*')
def build_cscript():
# ...
@task('build', 'Build everything buildable')
def build():
build_cscript()
build_stylus()
# etc...
# Function that parses command line args etc...
main()
探しても探しても、それらしいものはありませんでした。存在しない場合は、自分で作成し、おそらくそれでこの質問に答えます。
ご協力いただきありがとうございます!