Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nivlekp committed Jun 6, 2024
0 parents commit 68cc5d7
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
98 changes: 98 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Minamidera

南寺 (2024) for solo piano.
11 changes: 11 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -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
Empty file added minamidera/library.py
Empty file.
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 13 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[pytest]
addopts =
--doctest-modules
doctest_optionflags =
ELLIPSIS
NORMALIZE_WHITESPACE
markers =
sphinx
norecursedirs =
segments/*
testpaths =
minamidera
tests

0 comments on commit 68cc5d7

Please sign in to comment.