-
Notifications
You must be signed in to change notification settings - Fork 0
Refact/reorganize modules #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 57 commits
1efb481
9c531ed
b705379
e940b80
4bf2de3
f21695f
dba5173
5c4f078
509a602
8596038
76d6a67
303dbb1
19fa6a7
47975ba
9f49273
ed69731
f4812f1
9983221
4ef6576
4725ff0
4563315
5c829b2
2a4fa6b
0e9a00b
dce40de
ec307c6
d84fc40
6132089
0752ba4
c0e81a5
d04a904
ac22db3
a865360
c4a734e
66ee5b4
cbb7271
1d5d7e4
40d5cdd
4374b32
25b3b2a
1b5cd0f
5d760f8
001eec6
1a462d1
579ee5b
d45aa5a
3459c7f
ad02fe0
5dc7506
3db05ff
2ab53b0
2796999
cc985fb
bf6c015
aca0e68
8d24344
83b5461
aab06e5
fceec5e
7f01143
8bc87e5
7f3b473
197f708
ec4cc8b
d4967b7
b39a916
4da1ecd
4723430
32da3f6
7635a67
258d253
74d7c15
c6329d6
187689b
0374492
daf1152
f0f50a7
c74aa4c
e178641
1898f78
72356d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM ghcr.io/astral-sh/uv:latest AS uv | ||
|
|
||
| FROM mcr.microsoft.com/devcontainers/base:2-ubuntu24.04 | ||
|
|
||
| # install needed packages | ||
| RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get -y install \ | ||
| build-essential \ | ||
| cmake \ | ||
| gcc \ | ||
| gdb \ | ||
| libgmp-dev \ | ||
| ninja-build | ||
|
|
||
| COPY tools/install-deps.sh /usr/local/bin/install-deps.sh | ||
|
|
||
| RUN /usr/local/bin/install-deps.sh \ | ||
| && apt-get autoremove -y \ | ||
| && apt-get clean -y \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY --from=uv --chown=vscode /uv /uvx /bin/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "name": "PauliEngine development environment", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "capAdd": [ | ||
| "SYS_PTRACE" | ||
| ], | ||
| "securityOpt": [ | ||
| "seccomp=unconfined" | ||
| ], | ||
| "remoteUser": "vscode", | ||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "python.defaultInterpreterPath": "${containerEnv:UV_PROJECT_ENVIRONMENT}/bin/python", | ||
| "python.terminal.activateEnvInCurrentTerminal": true, | ||
| "terminal.integrated.defaultProfile.linux": "zsh", | ||
| "terminal.integrated.profiles.linux": { | ||
| "zsh": { | ||
| "path": "/bin/zsh" | ||
| } | ||
| } | ||
| }, | ||
| "extensions": [ | ||
| "MS-vsliveshare.vsliveshare", | ||
| "benjamin-simmonds.pythoncpp-debug", | ||
| "charliermarsh.ruff", | ||
| "cschlosser.doxdocgen", | ||
| "ms-python.python", | ||
| "ms-toolsai.jupyter", | ||
| "ms-vscode.cmake-tools", | ||
| "ms-vscode.cpptools", | ||
| "ms-vscode.cpptools-themes", | ||
| "mutantdino.resourcemonitor", | ||
| "njpwerner.autodocstring", | ||
| "streetsidesoftware.code-spell-checker", | ||
| "streetsidesoftware.code-spell-checker-scientific-terms", | ||
| "tamasfe.even-better-toml", | ||
| "vivaxy.vscode-conventional-commits" | ||
| ] | ||
| } | ||
| }, | ||
| "containerEnv": { | ||
| "PYTHONUNBUFFERED": "True", | ||
| "WORKSPACE": "${containerWorkspaceFolder}", | ||
| "UV_LINK_MODE": "copy", | ||
| "UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv" | ||
| }, | ||
| "postCreateCommand": "./.devcontainer/postCreateCommand.sh", | ||
| "postStartCommand": "./.devcontainer/postStartCommand.sh", | ||
| "hostRequirements": { | ||
| "cpus": 4, | ||
| "memory": "6gb" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euxo pipefail | ||
|
|
||
| # install uv and uvx shell completions | ||
| echo 'eval "$(uv generate-shell-completion zsh)"' >> /home/vscode/.zshrc | ||
| echo 'eval "$(uvx --generate-shell-completion zsh)"' >> /home/vscode/.zshrc | ||
|
|
||
| # set up GDB to view contents of STL containers | ||
| gcc_version="$(gcc --version | awk 'NR==1 {print $NF}')" | ||
| cat <<EOT >> ~/.gdbinit | ||
| python | ||
| import sys | ||
| sys.path.insert(0, "/usr/share/gcc-$gcc_version/python") | ||
| from libstdcxx.v6.printers import register_libstdcxx_printers | ||
| register_libstdcxx_printers (None) | ||
| end | ||
| EOT |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # install project with all dependencies | ||
| uv sync --all-groups --all-extras | ||
|
|
||
| # install pre-commit hooks | ||
| # uv run pre-commit install --install-hooks |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node: $Format:%H$ | ||
| node-date: $Format:%cI$ | ||
| describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,181 @@ | ||||||||
| name: Publish PauliEngine Python sdist and wheels to PyPI | ||||||||
|
|
||||||||
| on: | ||||||||
| workflow_dispatch: | ||||||||
| inputs: | ||||||||
| force-upload: | ||||||||
| description: 'Upload artifacts without a corresponding release' | ||||||||
| required: false | ||||||||
| default: false | ||||||||
| type: boolean | ||||||||
| release: | ||||||||
| types: | ||||||||
| - published | ||||||||
| pull_request: | ||||||||
| # PRs trigger for the "opened", "reopened", "synchronize" events (default) and | ||||||||
| # "ready_for_review" | ||||||||
| paths: | ||||||||
| - .github/workflows/deploy.yml | ||||||||
| types: | ||||||||
| - opened | ||||||||
| - reopened | ||||||||
| - synchronize # when new commits are pushed to the PR | ||||||||
| - ready_for_review # when the PR is un-drafted | ||||||||
|
|
||||||||
| concurrency: | ||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||
| cancel-in-progress: true | ||||||||
|
|
||||||||
| env: | ||||||||
| COLUMNS: 120 | ||||||||
| FORCE_COLOR: 3 | ||||||||
|
|
||||||||
| jobs: | ||||||||
| build-sdist: | ||||||||
| name: Build source distribution | ||||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v6 | ||||||||
| with: | ||||||||
| fetch-depth: 0 # such that setuptools_scm can do its job correctly | ||||||||
|
|
||||||||
| - name: Build SDist | ||||||||
| run: | | ||||||||
| pipx install uv | ||||||||
| pipx run build --verbose --sdist --installer=uv | ||||||||
|
|
||||||||
| - uses: actions/upload-artifact@v6 | ||||||||
| with: | ||||||||
| name: cibw-sdist | ||||||||
| path: dist/*.tar.gz | ||||||||
|
|
||||||||
| build-wheels: | ||||||||
| # in combination with the PR types selection, this top-level if statement | ||||||||
| # skips running the workflow for Draft PRs | ||||||||
| if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} | ||||||||
| name: Build Python wheels for ${{ matrix.os }} | ||||||||
| runs-on: ${{ matrix.runs-on }} | ||||||||
| strategy: | ||||||||
| matrix: | ||||||||
| os: [ linux-intel, linux-arm, macos-arm, windows-intel, windows-arm] | ||||||||
| include: | ||||||||
| - archs: native | ||||||||
| platform: auto | ||||||||
| - os: linux-intel | ||||||||
| runs-on: ubuntu-latest | ||||||||
| - os: linux-arm | ||||||||
| runs-on: ubuntu-24.04-arm | ||||||||
| - os: macos-arm | ||||||||
| runs-on: macos-latest | ||||||||
| - os: windows-intel | ||||||||
| runs-on: windows-latest | ||||||||
| - os: windows-arm | ||||||||
| runs-on: windows-latest | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v6 | ||||||||
| with: | ||||||||
| fetch-depth: 0 | ||||||||
|
|
||||||||
| - uses: pypa/cibuildwheel@v3.3.1 | ||||||||
| with: | ||||||||
| extras: "uv" | ||||||||
| env: | ||||||||
| # target platform | ||||||||
| CIBW_PLATFORM: ${{ matrix.platform }} | ||||||||
| # architectures to build | ||||||||
| CIBW_ARCHS: ${{ matrix.archs }} | ||||||||
| # use uv and build | ||||||||
| CIBW_BUILD_FRONTEND: "build[uv]" | ||||||||
| # increase pip debugging output | ||||||||
| CIBW_BUILD_VERBOSITY: 1 | ||||||||
| CIBW_DEBUG_TRACEBACK: TRUE | ||||||||
| CIBW_BEFORE_ALL_LINUX: | | ||||||||
| dnf install -y gmp gmp-devel ninja-build | ||||||||
| # install symengine | ||||||||
| ./tools/install-deps.sh | ||||||||
| CIBW_BEFORE_ALL_MACOS: | | ||||||||
| brew install gmp | ||||||||
| # install symengine | ||||||||
| PREFIX="${SYMEMENGINE_PREFIX:-$HOME/.local}" | ||||||||
| ./tools/install-deps.sh "$PREFIX" | ||||||||
| CIBW_BEFORE_ALL_WINDOWS: | | ||||||||
| pip install delvewheel | ||||||||
| # do not activate architecture-dependent compiler flags | ||||||||
| # 4 jobs in parallel, but do not start new ones if load average exceeds 5 | ||||||||
| CIBW_ENVIRONMENT_LINUX: > | ||||||||
| CIBW="true" | ||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the
Suggested change
|
||||||||
| SKBUILD_BUILD_TOOL_ARGS="-j4;-l5" | ||||||||
| # CMAKE_PREFIX_PATH="$HOME/.local" | ||||||||
| # set deployment target for C++20 compatibility | ||||||||
| # make brew-installed OpenMP discoverable by CMake | ||||||||
| # do not activate architecture-dependent compiler flags | ||||||||
| # 4 jobs in parallel, but do not start new ones if load average exceeds 5 | ||||||||
| CIBW_ENVIRONMENT_MACOS: > | ||||||||
| CIBW="true" | ||||||||
| MACOSX_DEPLOYMENT_TARGET=15.0 | ||||||||
| GMP_PREFIX="$(brew --prefix gmp)" | ||||||||
| CPPFLAGS="-I${GMP_PREFIX}/include ${CPPFLAGS}" | ||||||||
| CFLAGS="-I${GMP_PREFIX}/include ${CFLAGS}" | ||||||||
| CXXFLAGS="-I${GMP_PREFIX}/include ${CXXFLAGS}" | ||||||||
| LDFLAGS="-L${GMP_PREFIX}/lib ${LDFLAGS}" | ||||||||
| PKG_CONFIG_PATH="${GMP_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||||||||
| CMAKE_PREFIX_PATH="${GMP_PREFIX}:$HOME/.local:${CMAKE_PREFIX_PATH}" | ||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| CIBW_ENVIRONMENT_WINDOWS: > | ||||||||
| CIBW="true" | ||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| # build 3.10, 3.11, 3.12, 3.13 (with GIL), and 3.14 (with GIL) | ||||||||
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" | ||||||||
| # skip musl builds, and PyPy builds | ||||||||
| CIBW_SKIP: "*-musllinux_*" | ||||||||
| # use abi3audit to catch issues with Limited API wheels | ||||||||
| CIBW_REPAIR_WHEEL_COMMAND_LINUX: | | ||||||||
| auditwheel repair -w {dest_dir} {wheel} | ||||||||
| if [[ "{wheel}" == *abi3* ]]; then | ||||||||
| pipx run abi3audit --strict --report {wheel} | ||||||||
| else | ||||||||
| echo "{wheel} is not abi3, skipping abi3audit" | ||||||||
| fi | ||||||||
| # use abi3audit to catch issues with Limited API wheels | ||||||||
| CIBW_REPAIR_WHEEL_COMMAND_MACOS: | | ||||||||
| delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} | ||||||||
| if [[ "{wheel}" == *abi3* ]]; then | ||||||||
| pipx run abi3audit --strict --report {wheel} | ||||||||
| else | ||||||||
| echo "{wheel} is not abi3, skipping abi3audit" | ||||||||
| fi | ||||||||
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: | | ||||||||
| delvewheel repair -w {dest_dir} {wheel} | ||||||||
| if [[ "{wheel}" == *abi3* ]]; then | ||||||||
| pipx run abi3audit --strict --report {wheel} | ||||||||
| else | ||||||||
| echo "{wheel} is not abi3, skipping abi3audit" | ||||||||
| fi | ||||||||
| CIBW_TEST_COMMAND: python -m pytest {package}/tests | ||||||||
| CIBW_TEST_GROUPS: "test" | ||||||||
|
|
||||||||
| - name: Upload wheels | ||||||||
| uses: actions/upload-artifact@v6 | ||||||||
| with: | ||||||||
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||||||||
| path: wheelhouse/*.whl | ||||||||
|
|
||||||||
| # upload_all: | ||||||||
| # name: Upload if release | ||||||||
| # needs: | ||||||||
| # - build_wheels | ||||||||
| # - build_sdist | ||||||||
| # environment: pypi | ||||||||
| # permissions: | ||||||||
| # id-token: write | ||||||||
| # runs-on: ubuntu-latest | ||||||||
| # #if: github.event_name == 'release' && github.event.action == 'published' | ||||||||
|
|
||||||||
| # steps: | ||||||||
| # - uses: actions/download-artifact@v4 | ||||||||
| # with: | ||||||||
| # pattern: cibw-* | ||||||||
| # path: dist | ||||||||
| # merge-multiple: true | ||||||||
|
|
||||||||
| # - uses: pypa/gh-action-pypi-publish@release/v1 | ||||||||
| # with: | ||||||||
| # repository-url: https://test.pypi.org/legacy/ | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,6 @@ Thumbs.db | |
| .bat | ||
| .cmake | ||
| .env | ||
| config.json | ||
| config.json | ||
|
|
||
| __pycache__/ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise it's run on x86_64