diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd6fab4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +*.DS_Store + +*.swp +__pycache__ + +# latex stuff +*.aux +*.log +*.out + +**/segments/*/music.pdf +**/builds/*/*.pdf +**/builds/*/*.midi + +# directory where I store some lilypond examples that I reference to +lilypond_examples + +# stylesheets from abjad (which will get imported using a script) +**/stylesheets/abjad_contrib diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..993b9ba --- /dev/null +++ b/Makefile @@ -0,0 +1,98 @@ +.PHONY: black-check black-reformat clean flake8 isort-check isort-reformat +.PHONY: mypy pytest reformat check test +.PHONY: sections test-sections score full-score test-score + +black-check: + black --check --diff . + +black-reformat: + black . + +clean: + find . -name '*.pyc' | xargs rm + rm -Rif __pycache__ + +flake_ignore = --ignore=E203,E266,E501,W503 +flake_options = --isolated --max-line-length=88 + +flake8: + flake8 ${flake_ignore} ${flake_options} + +isort-check: + isort \ + --case-sensitive \ + --check-only \ + --diff \ + --line-width=88 \ + --multi-line=3 \ + --thirdparty=abjad \ + --thirdparty=abjadext \ + --thirdparty=pang \ + --thirdparty=ply \ + --thirdparty=roman \ + --thirdparty=uqbar \ + --trailing-comma \ + --use-parentheses \ + . + +isort-reformat: + isort \ + --case-sensitive \ + --line-width=88 \ + --multi-line=3 \ + --thirdparty=abjad \ + --thirdparty=abjadext \ + --thirdparty=pang \ + --thirdparty=ply \ + --thirdparty=roman \ + --thirdparty=uqbar \ + --trailing-comma \ + --use-parentheses \ + . + +mypy: + mypy . + +project = minamidera + +pytest: + pytest . + +reformat: + make black-reformat + make isort-reformat + +check: + make black-check + make flake8 + make isort-check + +test: + make black-check + make flake8 + make isort-check + make pytest + +sections: + @python ${PANG_PATH}/scripts/make_sections.py --sections $(sections) + +score: + @python ${PANG_PATH}/scripts/make_score.py + +score_directory = minamidera/builds/score + +full-score: + @python ${PANG_PATH}/scripts/make_score.py + # run lualatex on front-cover.tex twice, otherwise rectangle is not + # centred + @lualatex --output-directory=${score_directory} ${score_directory}/front-cover.tex + @lualatex --output-directory=${score_directory} ${score_directory}/front-cover.tex + @lualatex --output-directory=${score_directory} ${score_directory}/preface.tex + @lualatex --output-directory=${score_directory} ${score_directory}/back-cover.tex + @lualatex --output-directory=${score_directory} ${score_directory}/score.tex + +test-sections: + @pytest ${PANG_PATH}/scripts/test_sections.py + +test-score: + @pytest ${PANG_PATH}/scripts/test_score.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..06533fe --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Minamidera + +南寺 (2024) for solo piano. diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..52fe1db --- /dev/null +++ b/conftest.py @@ -0,0 +1,11 @@ +import abjad +import pang +import pytest +from abjadext import nauert + + +@pytest.fixture(autouse=True) +def add_libraries(doctest_namespace): + doctest_namespace["abjad"] = abjad + doctest_namespace["nauert"] = nauert + doctest_namespace["pang"] = pang diff --git a/minamidera/library.py b/minamidera/library.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7c0ea3c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "minamidera" +version = "24.6b0" +authors = [ + { name="Tsz Kiu Pang" }, +] +description = "Minamidera, for solo piano" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "abjad", + "abjad-ext-nauert", + "pang", + "numpy >= 1.26.0, < 2.0" +] +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] + +[project.optional-dependencies] +test = [ + "black", + "flake8", + "isort", + "pytest", +] + +[tool.hatch.build.targets.wheel] +packages = ["minamidera"] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..a6335e8 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,13 @@ +[pytest] +addopts = + --doctest-modules +doctest_optionflags = + ELLIPSIS + NORMALIZE_WHITESPACE +markers = + sphinx +norecursedirs = + segments/* +testpaths = + minamidera + tests