Skip to content

Commit 4537541

Browse files
committed
First commit
0 parents  commit 4537541

File tree

258 files changed

+60715
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+60715
-0
lines changed

.appveyor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: '{build}'
2+
image: Visual Studio 2019
3+
platform:
4+
- x86
5+
- x64
6+
environment:
7+
global:
8+
DISTUTILS_USE_SDK: 1
9+
PYTHONWARNINGS: ignore:DEPRECATION
10+
MSSdk: 1
11+
matrix:
12+
- PYTHON: 37
13+
install:
14+
- cmd: '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%'
15+
- ps: |
16+
git submodule update -q --init --recursive
17+
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
18+
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
19+
python -m pip install --disable-pip-version-check --upgrade --no-warn-script-location pip build pytest
20+
build_script:
21+
- ps: |
22+
python -m build -s
23+
cd dist
24+
python -m pip install --verbose sqlite_blaster_python-0.0.1.tar.gz
25+
cd ..
26+
test_script:
27+
- ps: python -m pytest

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/conda.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Conda
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [ubuntu-latest, windows-latest, macos-latest]
16+
python-version: ["3.8", "3.10"]
17+
18+
runs-on: ${{ matrix.platform }}
19+
20+
# The setup-miniconda action needs this to activate miniconda
21+
defaults:
22+
run:
23+
shell: "bash -l {0}"
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
submodules: true
29+
30+
- name: Get conda
31+
uses: conda-incubator/[email protected]
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
channels: conda-forge
35+
channel-priority: strict
36+
37+
# Currently conda-build requires the dead package "toml" but doesn't declare it
38+
- name: Prepare
39+
run: conda install conda-build conda-verify pytest toml
40+
41+
- name: Build
42+
run: conda build conda.recipe
43+
44+
- name: Install
45+
run: conda install -c ${CONDA_PREFIX}/conda-bld/ sqlite_blaster_python
46+
47+
- name: Test
48+
run: python -m pytest

.github/workflows/format.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This is a format job. Pre-commit has a first-party GitHub action, so we use
2+
# that: https://github.com/pre-commit/action
3+
4+
name: Format
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
push:
10+
branches:
11+
- master
12+
13+
jobs:
14+
pre-commit:
15+
name: Format
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.x"
22+
- uses: pre-commit/[email protected]

.github/workflows/pip.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pip
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [windows-latest, macos-latest, ubuntu-latest]
16+
python-version: ["3.7", "3.11"]
17+
18+
runs-on: ${{ matrix.platform }}
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: true
24+
25+
- uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
- name: Add requirements
30+
run: python -m pip install --upgrade wheel setuptools
31+
32+
- name: Build and install
33+
run: pip install --verbose .[test]
34+
35+
- name: Test
36+
run: python -m pytest

.github/workflows/wheels.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
build_sdist:
15+
name: Build SDist
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
submodules: true
21+
22+
- name: Build SDist
23+
run: pipx run build --sdist
24+
25+
- name: Check metadata
26+
run: pipx run twine check dist/*
27+
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
path: dist/*.tar.gz
31+
32+
33+
build_wheels:
34+
name: Wheels on ${{ matrix.os }}
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os: [ubuntu-latest, windows-latest, macos-latest]
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
with:
44+
submodules: true
45+
46+
- uses: pypa/[email protected]
47+
env:
48+
CIBW_ARCHS_MACOS: auto universal2
49+
50+
- name: Verify clean directory
51+
run: git diff --exit-code
52+
shell: bash
53+
54+
- name: Upload wheels
55+
uses: actions/upload-artifact@v3
56+
with:
57+
path: wheelhouse/*.whl
58+
59+
60+
upload_all:
61+
name: Upload if release
62+
needs: [build_wheels, build_sdist]
63+
runs-on: ubuntu-latest
64+
if: github.event_name == 'release' && github.event.action == 'published'
65+
66+
steps:
67+
- uses: actions/setup-python@v4
68+
with:
69+
python-version: "3.x"
70+
71+
- uses: actions/download-artifact@v3
72+
with:
73+
name: artifact
74+
path: dist
75+
76+
- uses: pypa/[email protected]
77+
with:
78+
password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build/
2+
dist/
3+
_build/
4+
_generate/
5+
*.so
6+
*.py[cod]
7+
*.egg-info
8+
*env*

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "pybind11"]
2+
path = pybind11
3+
url = https://github.com/pybind/pybind11.git
4+
branch = master
5+
6+
[submodule "src/sqlite_blaster"]
7+
path = src/sqlite_blaster
8+
url = https://github.com/siara-cc/sqlite_blaster.git
9+
branch = main

.pre-commit-config.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
15+
ci:
16+
autoupdate_commit_msg: "chore: update pre-commit hooks"
17+
autofix_commit_msg: "style: pre-commit fixes"
18+
19+
repos:
20+
# Standard hooks
21+
- repo: https://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.4.0
23+
hooks:
24+
- id: check-added-large-files
25+
- id: check-case-conflict
26+
- id: check-merge-conflict
27+
- id: check-symlinks
28+
- id: check-yaml
29+
exclude: ^conda\.recipe/meta\.yaml$
30+
- id: debug-statements
31+
- id: end-of-file-fixer
32+
- id: mixed-line-ending
33+
- id: requirements-txt-fixer
34+
- id: trailing-whitespace
35+
36+
# Black, the code formatter, natively supports pre-commit
37+
- repo: https://github.com/psf/black
38+
rev: 23.1.0
39+
hooks:
40+
- id: black
41+
exclude: ^(docs)
42+
43+
- repo: https://github.com/charliermarsh/ruff-pre-commit
44+
rev: "v0.0.252"
45+
hooks:
46+
- id: ruff
47+
args: ["--fix", "--show-fixes"]
48+
49+
# Checking static types
50+
- repo: https://github.com/pre-commit/mirrors-mypy
51+
rev: "v1.0.1"
52+
hooks:
53+
- id: mypy
54+
files: "setup.py"
55+
args: []
56+
additional_dependencies: [types-setuptools]
57+
58+
# Changes tabs to spaces
59+
- repo: https://github.com/Lucas-C/pre-commit-hooks
60+
rev: v1.4.2
61+
hooks:
62+
- id: remove-tabs
63+
exclude: ^(docs)
64+
65+
# CMake formatting
66+
- repo: https://github.com/cheshirekow/cmake-format-precommit
67+
rev: v0.6.13
68+
hooks:
69+
- id: cmake-format
70+
additional_dependencies: [pyyaml]
71+
types: [file]
72+
files: (\.cmake|CMakeLists.txt)(.in)?$
73+
74+
# Suggested hook if you add a .clang-format file
75+
# - repo: https://github.com/pre-commit/mirrors-clang-format
76+
# rev: v13.0.0
77+
# hooks:
78+
# - id: clang-format

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.4...3.18)
2+
project(sqlite_blaster_python)
3+
4+
add_subdirectory(pybind11)
5+
pybind11_add_module(sqlite_blaster_python src/main.cpp)
6+
7+
# EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a
8+
# define (VERSION_INFO) here.
9+
target_compile_definitions(sqlite_blaster_python
10+
PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})

0 commit comments

Comments
 (0)