-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow Google's Python style guide (#11)
Migrate pyscaffold to 4.5, setup pre-commits and some sphinx changes to document private and special methods. Update docstrings, tutorial and text everywhere.
- Loading branch information
Showing
14 changed files
with
294 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,13 @@ | |
|
||
name: Test the library | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
|
@@ -25,16 +31,30 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest tox cython numpy | ||
- name: Download rds2cpp deps | ||
run: | | ||
cd extern/rds2cpp | ||
cmake . | ||
cd ../.. | ||
- name: Test with tox | ||
run: | | ||
python setup.py build_ext --inplace | ||
tox | ||
- name: Build docs | ||
run: | | ||
tox -e docs | ||
touch ./docs/_build/html/.nojekyll | ||
- name: GH Pages Deployment | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: ./docs/_build/html | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
|
@@ -45,17 +65,19 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- name: Install dependencies | ||
- name: Download dependencies | ||
run: | | ||
cd extern/rds2cpp | ||
cd extern/knncolle | ||
cmake . | ||
cd ../.. | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
|
||
CIBW_ARCHS_LINUX: x86_64 # remove this later so we build for all linux archs | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | ||
CIBW_SKIP: pp* | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
@@ -68,12 +90,6 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd extern/rds2cpp | ||
cmake . | ||
cd ../.. | ||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
exclude: '^docs/conf.py' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: mixed-line-ending | ||
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows | ||
|
||
## If you want to automatically "modernize" your Python code: | ||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v3.7.0 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: ['--py37-plus'] | ||
|
||
## If you want to avoid flake8 errors due to unused vars or imports: | ||
# - repo: https://github.com/PyCQA/autoflake | ||
# rev: v2.1.1 | ||
# hooks: | ||
# - id: autoflake | ||
# args: [ | ||
# --in-place, | ||
# --remove-all-unused-imports, | ||
# --remove-unused-variables, | ||
# ] | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
## If like to embrace black styles even in the docs: | ||
# - repo: https://github.com/asottile/blacken-docs | ||
# rev: v1.13.0 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
## You can add flake8 plugins via `additional_dependencies`: | ||
# additional_dependencies: [flake8-bugbear] | ||
|
||
## Check for misspells in documentation files: | ||
# - repo: https://github.com/codespell-project/codespell | ||
# rev: v2.2.5 | ||
# hooks: | ||
# - id: codespell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.