Skip to content

Commit aed0536

Browse files
authored
Merge pull request #50 from sarnold/sphinx-apidocs
add basic sphinx docs build using apidoc
2 parents 00ff29d + ba4931b commit aed0536

File tree

16 files changed

+946
-53
lines changed

16 files changed

+946
-53
lines changed

.gitchangelog.rc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ ignore_regexps = [
6464
r'@wip', r'!wip',
6565
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
6666
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
67+
r'^([cC]i)\s*:',
6768
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
6869
r'^$', ## ignore commits with empty messages
6970
]
@@ -85,16 +86,17 @@ section_regexps = [
8586
('New', [
8687
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
8788
]),
89+
('Features', [
90+
r'^([nN]ew|[fF]eat)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
91+
]),
8892
('Changes', [
8993
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
9094
]),
91-
('Fix', [
95+
('Fixes', [
9296
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
9397
]),
94-
9598
('Other', None ## Match all lines
9699
),
97-
98100
]
99101

100102

@@ -150,7 +152,9 @@ subject_process = (strip |
150152
##
151153
## Tags that will be used for the changelog must match this regexp.
152154
##
153-
tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
155+
#tag_filter_regexp = r'^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'
156+
#tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
157+
tag_filter_regexp = r'.*?$' # accept funky tag strings
154158

155159

156160
## ``unreleased_version_label`` is a string or a callable that outputs a string
@@ -160,7 +164,9 @@ tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'
160164
#unreleased_version_label = "(unreleased)"
161165
unreleased_version_label = lambda: swrap(
162166
["git", "describe", "--tags"],
163-
shell=False)
167+
shell=False,
168+
)
169+
164170

165171
## ``output_engine`` is a callable
166172
##
@@ -227,7 +233,7 @@ include_merge = True
227233
## Outputs directly to standard output
228234
## (This is the default)
229235
##
230-
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start())
236+
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start(), flags)
231237
##
232238
## Creates a callable that will parse given file for the given
233239
## regex pattern and will insert the output in the file.
@@ -242,7 +248,7 @@ include_merge = True
242248
## take care of everything and might be more complex. Check the README
243249
## for a complete copy-pastable example.
244250
##
245-
# publish = FileInsertIntoFirstRegexMatch(
251+
# publish = FileInsertAtFirstRegexMatch(
246252
# "CHANGELOG.rst",
247253
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
248254
# idx=lambda m: m.start(1)

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ jobs:
106106
steps:
107107
- uses: actions/download-artifact@v4
108108
with:
109+
merge-multiple: true
109110
path: artifacts
110111

111112
# note wheels should be in subdirectories named <artifact_name>
112113
- name: Check number of downloaded artifacts
113-
run: ls -l artifacts/*
114+
run: ls -l artifacts/

.github/workflows/release.yml

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,23 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-22.04, macos-latest, windows-latest]
15+
include:
16+
- os: "ubuntu-22.04"
17+
arch: "x86_64"
18+
- os: "ubuntu-22.04"
19+
arch: "aarch64"
20+
- os: "macos-13"
21+
arch: "x86_64"
22+
macosx_deployment_target: "13.0"
23+
- os: "macos-14"
24+
arch: "arm64"
25+
macosx_deployment_target: "14.0"
26+
- os: "windows-latest"
27+
arch: "auto64"
28+
triplet: "x64-windows"
29+
- os: "windows-latest"
30+
arch: "auto32"
31+
triplet: "x86-windows"
1632

1733
steps:
1834
- uses: actions/checkout@v4
@@ -22,43 +38,41 @@ jobs:
2238
- uses: actions/setup-python@v5
2339
name: Install Python
2440
with:
25-
python-version: '3.8'
41+
python-version: '3.9'
2642

27-
- name: Prepare compiler environment for Windows
28-
if: runner.os == 'Windows'
29-
uses: ilammy/msvc-dev-cmd@v1
43+
- name: Set up QEMU
44+
if: runner.os == 'Linux'
45+
uses: docker/setup-qemu-action@v3
3046
with:
31-
arch: amd64
32-
33-
- name: Install cibuildwheel
34-
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install -r requirements-cibw.txt
47+
platforms: all
3748

3849
- name: Build wheels
50+
uses: pypa/cibuildwheel@v2.20
3951
env:
40-
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest
41-
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest
42-
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-*
43-
CIBW_SKIP: "*-win32"
52+
# configure cibuildwheel to build native archs ('auto'), and some
53+
# emulated ones, plus cross-compile on macos
54+
CIBW_ARCHS: ${{ matrix.arch }}
55+
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
56+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
57+
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
58+
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
59+
CIBW_SKIP: "*musllinux* *i686"
4460
CIBW_BEFORE_ALL_LINUX: >
45-
yum -y -q --enablerepo=extras install epel-release
46-
&& yum install -y re2-devel ninja-build
47-
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel show {wheel} && auditwheel repair -w {dest_dir} {wheel}"
61+
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build
4862
CIBW_BEFORE_ALL_MACOS: >
49-
brew install re2 pybind11 ninja
50-
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.09
51-
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "pip uninstall -y delocate && pip install git+https://github.com/Chia-Network/delocate.git && delocate-listdeps {wheel} && delocate-wheel -w {dest_dir} -v {wheel}"
63+
brew install re2 pybind11
64+
# macos target should be at least 10.13 to get full c++17
65+
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }}
5266
CIBW_BEFORE_ALL_WINDOWS: >
53-
vcpkg install re2:x64-windows
67+
vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }}
5468
&& vcpkg integrate install
5569
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
56-
CIBW_TEST_COMMAND: python -c "import re2"
57-
run: |
58-
python -m cibuildwheel --output-dir wheelhouse
70+
CIBW_TEST_REQUIRES: ""
71+
CIBW_TEST_COMMAND: ""
5972

6073
- uses: actions/upload-artifact@v4
6174
with:
75+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
6276
path: ./wheelhouse/*.whl
6377

6478
build_sdist:
@@ -70,12 +84,12 @@ jobs:
7084
- uses: actions/setup-python@v5
7185
name: Install Python
7286
with:
73-
python-version: '3.8'
87+
python-version: '3.9'
7488

7589
- name: Build sdist
7690
run: |
77-
pip install pep517
78-
python -m pep517.build -s .
91+
pip install build
92+
python -m build -s .
7993
8094
- uses: actions/upload-artifact@v4
8195
with:
@@ -99,10 +113,13 @@ jobs:
99113
- uses: actions/setup-python@v5
100114
name: Install Python
101115
with:
102-
python-version: 3.7
116+
python-version: 3.9
103117

104-
# download all artifacts to project dir
118+
# download all artifacts to artifacts dir
105119
- uses: actions/download-artifact@v4
120+
with:
121+
merge-multiple: true
122+
path: artifacts
106123

107124
- name: Generate changes file
108125
uses: sarnold/gitchangelog-action@master
@@ -121,7 +138,7 @@ jobs:
121138
draft: false
122139
prerelease: false
123140
# uncomment below to upload wheels to github releases
124-
files: dist/cibw-wheels/pyre2*.whl
141+
files: artifacts/pyre2*
125142

126143
- uses: pypa/gh-action-pypi-publish@master
127144
if: ${{ github.actor == github.repository_owner && github.ref == 'refs/heads/master' }}

.github/workflows/sphinx.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Docs
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-22.04
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install Ubuntu build deps
22+
run: |
23+
sudo apt-get -qq update
24+
sudo apt-get install -y libre2-dev
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.9'
29+
30+
- name: Add python requirements
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install tox
34+
35+
- name: Install Ubuntu build deps
36+
run: |
37+
sudo apt-get -qq update
38+
sudo apt-get install -y libre2-dev
39+
40+
- name: Build docs
41+
run: |
42+
tox -e ldocs,docs
43+
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: ApiDocsHTML
47+
path: "docs/_build/html/"
48+
49+
- name: set nojekyll for github
50+
run: |
51+
touch docs/_build/html/.nojekyll
52+
53+
- name: Deploy docs to gh-pages
54+
if: ${{ github.event_name == 'push' }}
55+
uses: JamesIves/github-pages-deploy-action@v4
56+
with:
57+
branch: gh-pages
58+
folder: docs/_build/html/
59+
single-commit: true

.gitignore

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,54 @@ src/*.html
88
tests/*.so
99
tests/access.log
1010
*~
11-
*.so
1211
*.pyc
1312
*.swp
1413
*.egg-info
14+
15+
# Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
share/python-wheels/
38+
*.egg-info/
39+
.installed.cfg
40+
*.egg
41+
MANIFEST
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Sphinx documentation
59+
docs/_build/
60+
docs/source/api/
61+

0 commit comments

Comments
 (0)