Skip to content

Commit

Permalink
Merge pull request #35 from lewiswolf/dev
Browse files Browse the repository at this point in the history
2.0rc
  • Loading branch information
lewiswolf authored Aug 12, 2024
2 parents 3901b19 + a779d58 commit 84c814f
Show file tree
Hide file tree
Showing 56 changed files with 2,268 additions and 2,498 deletions.
18 changes: 16 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignConsecutiveShortCaseStatements:
Enabled: false
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
AllowAllArgumentsOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortLoopsOnASingleLine: true
AlwaysBreakBeforeMultilineStrings: true
BinPackArguments: false
BinPackParameters: false
BreakArrays: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
ColumnLimit: 100
CompactNamespaces: true
Expand All @@ -29,21 +36,27 @@ IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequires: false
IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: true
InsertTrailingCommas: Wrapped
JavaScriptQuotes: Single
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: LF
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PPIndentWidth: 4
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
RemoveParentheses: ReturnStatement
RemoveSemicolon: true
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
Expand All @@ -55,6 +68,7 @@ SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
Expand All @@ -65,7 +79,7 @@ SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInParens: Never
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,41 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.9", "3.10"]
python: ["3.11", "3.12"]

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@main
with:
python-version: ${{ matrix.python }}

- name: Test installation
run: pip install "git+https://github.com/lewiswolf/kac_drumset.git#egg=kac_drumset"
run: |
pip install "git+https://github.com/lewiswolf/kac_drumset.git"
python3 -c "import kac_drumset"
# - name: Test C++ deployment
# run: |
# python3 -c "import kac_drumset.externals._geometry"
# python3 -c "import kac_drumset.externals._physics"

all-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.9", "3.10"]
# os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-latest]
python: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: lukka/get-cmake@latest
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-pipenv
with:
path: ~/.local/share/virtualenvs
Expand All @@ -57,9 +65,14 @@ jobs:
- name: Build CPP
run: pipenv run build

- name: Lint project
- name: Lint project 3.11
if: ${{ matrix.python == '3.11' }}
run: pipenv run flake8 --config=test/test.cfg

- name: Lint project 3.12
if: ${{ matrix.python == '3.12' }}
run: pipenv run flake8 --config=test/test.cfg --extend-ignore=Q000

- name: Assert types
run: pipenv run mypy --config-file=test/test.cfg

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ _skbuild
# files
*.so
.DS_Store
Pipfile.lock
MANIFEST.in
Pipfile.lock

# lew stuff
unused
19 changes: 2 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,14 @@ cmake_minimum_required(VERSION 3.22)
set(CMAKE_CXX_STANDARD 20)
include(FetchContent)

project(kac_drumset)
project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION} LANGUAGES CXX)

# include pybind as a remote dependency
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
endif()

# scikit-build does not add site-packages to the search path automatically,
# so it _or_ the pybind11 specific directory needs to be added here.
if(SKBUILD)
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "import pybind11; print(pybind11.get_cmake_dir())"
OUTPUT_VARIABLE _tmp_dir
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT
)
list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}")
endif()
FetchContent_MakeAvailable(pybind11)

# include kac_core
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kac_core)
Expand Down
15 changes: 7 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@ verify_ssl = true
name = "pypi"

[packages]
numpy = ">=1.23"
opencv-python = ">=4.6"
soundfile = "*"
torch = ">=1.12"
torchaudio = ">=0.12"
tqdm = ">=4.64"
kac_prediction = {git = "https://github.com/lewiswolf/kac_prediction.git"}
numpy = ">=2.0"
opencv-python = ">=4.10"

[dev-packages]
flake8 = "*"
flake8-commas = "*"
flake8-pyi = "*"
flake8-quotes = "*"
graphs = {git = "https://github.com/lewiswolf/graphs.git"}
kac_drumset = {editable = true, path = "."}
kac-drumset = {file = ".", editable = true}
mypy = "*"
scikit-build = "*"
types-setuptools = "*"
types-tqdm = "*"

[requires]
python_version = "3.9"
python_version = "3.11"

[scripts]
build = "python setup.py develop"
Expand Down
Loading

0 comments on commit 84c814f

Please sign in to comment.