Skip to content

Commit e316afd

Browse files
initial commit
0 parents  commit e316afd

File tree

23 files changed

+1564
-0
lines changed

23 files changed

+1564
-0
lines changed

.appveyor.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '{build}'
2+
image: Visual Studio 2019
3+
stack: python 3.7
4+
skip_branch_with_pr: true
5+
init:
6+
- cmd: set PATH=C:\Python37;C:\Python37\Scripts;%PATH%
7+
install:
8+
- ps: python -m pip install --disable-pip-version-check --upgrade --no-warn-script-location pip build virtualenv wheel
9+
build_script:
10+
- ps: |
11+
python -m pip install .
12+
test_script:
13+
- ps: python tests\test.py

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3+
{
4+
"name": "Existing Dockerfile",
5+
"build": {
6+
// Sets the run context to one level up instead of the .devcontainer folder.
7+
"context": "..",
8+
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
9+
"dockerfile": "../Dockerfile"
10+
},
11+
"mounts": [
12+
"source=${localEnv:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached"
13+
],
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-python.python",
18+
"ms-python.black-formatter",
19+
"ms-python.pylint",
20+
"benjamin-simmonds.pythoncpp-debug",
21+
"ms-vscode.cpptools-extension-pack"
22+
]
23+
}
24+
},
25+
// Features to add to the dev container. More info: https://containers.dev/features.
26+
// "features": {},
27+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28+
// "forwardPorts": [],
29+
// Uncomment the next line to run commands after the container is created.
30+
"postCreateCommand": "pip install . && pip install pytest"
31+
// Configure tool-specific properties.
32+
// "customizations": {},
33+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "devcontainer"
35+
}

.github/dependabot.yml

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

.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+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform: [ubuntu-latest, windows-latest, macos-12]
20+
python-version: ["3.8", "3.10"]
21+
22+
runs-on: ${{ matrix.platform }}
23+
24+
# The setup-miniconda action needs this to activate miniconda
25+
defaults:
26+
run:
27+
shell: "bash -l {0}"
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Get conda
33+
uses: conda-incubator/[email protected]
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
channels: conda-forge
37+
38+
- name: Prepare
39+
run: conda install conda-build conda-verify
40+
41+
- name: Build
42+
run: conda build conda.recipe
43+
44+
- name: Install
45+
run: conda install -c ${CONDA_PREFIX}/conda-bld/ python_example
46+
47+
- name: Test
48+
run: python tests/test.py

.github/workflows/pip.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Pip
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform: [windows-latest, macos-13, ubuntu-latest]
20+
python-version: ["3.7", "3.11"]
21+
22+
runs-on: ${{ matrix.platform }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Add requirements
32+
run: python -m pip install --upgrade wheel setuptools
33+
34+
- name: Build and install
35+
run: pip install --verbose .
36+
37+
- name: Test
38+
run: python tests/test.py
39+
40+
build-mingw64:
41+
runs-on: windows-latest
42+
defaults:
43+
run:
44+
shell: msys2 {0}
45+
steps:
46+
- uses: msys2/setup-msys2@v2
47+
with:
48+
update: true
49+
install: >-
50+
mingw-w64-x86_64-gcc
51+
mingw-w64-x86_64-python-pip
52+
mingw-w64-x86_64-python-wheel
53+
54+
- uses: actions/checkout@v4
55+
56+
- name: Install pybind11
57+
# This is required because --no-build-isolation disable dependences
58+
# installation
59+
run: pip install pybind11
60+
61+
- name: Build and install
62+
# --no-build-isolation is required because the vanilla setuptool does not
63+
# support Mingw64.See patches here:
64+
# https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-setuptools
65+
# Without those patches build_ext fails with:
66+
# error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
67+
run: pip install --no-build-isolation .
68+
69+
- name: Test
70+
run: python tests/test.py

.github/workflows/wheels.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build_sdist:
19+
name: Build SDist
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Build SDist
25+
run: pipx run build --sdist
26+
27+
- name: Check metadata
28+
run: pipx run twine check dist/*
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: cibw-sdist
33+
path: dist/*.tar.gz
34+
35+
36+
build_wheels:
37+
name: Wheels on ${{ matrix.os }}
38+
runs-on: ${{ matrix.os }}
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: [ubuntu-latest, windows-latest, macos-13]
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- uses: pypa/[email protected]
48+
env:
49+
CIBW_ARCHS_MACOS: auto universal2
50+
51+
- name: Verify clean directory
52+
run: git diff --exit-code
53+
shell: bash
54+
55+
- name: Upload wheels
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: cibw-wheels-${{ matrix.os }}
59+
path: wheelhouse/*.whl
60+
61+
62+
upload_all:
63+
name: Upload if release
64+
needs: [build_wheels, build_sdist]
65+
runs-on: ubuntu-latest
66+
if: github.event_name == 'release' && github.event.action == 'published'
67+
68+
steps:
69+
- uses: actions/setup-python@v5
70+
with:
71+
python-version: "3.x"
72+
73+
- uses: actions/download-artifact@v4
74+
with:
75+
pattern: cibw-*
76+
path: dist
77+
merge-multiple: true
78+
- uses: pypa/gh-action-pypi-publish@release/v1
79+
with:
80+
user: __token__
81+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)