Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[bumpversion]
current_version = 1.2.0
commit = True
tag = True

[bumpversion:file:./setup.py]
[bumpversion:file:./docs/conf.py]
[bumpversion:file:./README.md]
[bumpversion:file:SignalIntegrity/__init__.py]

Binary file added .coverage
Binary file not shown.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "daily"

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
40 changes: 40 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Sphinx docs to gh-pages

on:
push:
branches:
- master
workflow_dispatch:

jobs:
sphinx_docs_to_gh-pages:
runs-on: ubuntu-latest
name: Sphinx docs to gh-pages
steps:
- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.10.0
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.10
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: anaconda-client-env
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Installing the library
shell: bash -l {0}
run: |
pip install -e .
pip install -r requirements_dev.txt
sudo wget https://github.com/jgm/pandoc/releases/download/1.16.0.2/pandoc-1.16.0.2-1-amd64.deb
sudo dpkg -i pandoc-1.16.0.2-1-amd64.deb
#sudo apt install pandoc
- name: Running the Sphinx to gh-pages Action
uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.0-beta.2
with:
branch: master
dir_docs: docs
sphinxopts: ""
70 changes: 70 additions & 0 deletions .github/workflows/test_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test pre-commit, code and docs

on:
pull_request:
push:

jobs:
test_code:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.7, "3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
make install
- name: Test
run: make test
test_docs:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
matrix:
python-version: [3.9]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
make install
sudo apt install doxygen
- name: Test documentation
run: |
cd Doc
doxygen SignalIntegrityLinux
release_pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ SignalIntegrity.egg-info/
Doc/xhtml
build/
dist/
Test/.coverage
108 changes: 108 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "afb705d488f95978d2bf1459e05e9b7e3dca03ac"
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/hakancelik96/unimport
rev: 004b5dd0c8112330275beb52c4ccfce016a4b945
hooks:
- id: unimport
args: [--remove, --include-star-import]
- repo: https://github.com/pycqa/isort
rev: "12cc5fbd67eebf92eb2213b03c07b138ae1fb448"
hooks:
- id: isort
files: "SignalIntegrity/.*"
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: "d4a85643a465f5fae2113d07d22d021d4af4795a"
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: "647996c743f9e77368ce46cc74abe98549dd4c3a"
hooks:
- id: flake8

- repo: https://github.com/kynan/nbstripout
rev: 4e0f64cf03b52e2aa54f7dd57c722e1a04a439f6
hooks:
- id: nbstripout
files: ".ipynb"

- repo: https://github.com/asottile/pyupgrade
rev: 4c7ee5abff7f53f8be0bacb0974c63cbd413bae6
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]

- repo: https://github.com/codespell-project/codespell
rev: 6a9d7a7a7d0db950a1bd8d5ecdd3298f114d2a12
hooks:
- id: codespell
args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro,donot"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 5dbc9746f876e3acee90e75113792699b64aed43
hooks:
- id: shellcheck

- repo: https://github.com/pre-commit/pygrep-hooks
rev: 7b4409161486c6956bb3206ce96db5d56731b1b9 # Use the ref you want to point at
hooks:
- id: python-use-type-annotations

- repo: https://github.com/PyCQA/bandit
rev: d9fe642e01866e460454641bcd14b9de9d2b1478
hooks:
- id: bandit
args: [--exit-zero]
# ignore all tests, not just tests data
exclude: ^tests/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
hooks:
- id: mypy
exclude: ^(docs/|example-plugin/|tests/fixtures)
additional_dependencies:
- "pydantic"
# - repo: https://github.com/terrencepreilly/darglint
# rev: master
# hooks:
# - id: darglint

- repo: https://github.com/pycqa/pydocstyle
rev: "a6fe4222012e990042c86cdaaa904a8d059752ee"
hooks:
- id: pydocstyle
# - repo: https://github.com/asottile/reorder_python_imports
# rev: 2b2f0c74acdb3de316e23ceb7dd0d7945c354050
# hooks:
# - id: reorder-python-imports
# - repo: https://github.com/PyCQA/pylint
# rev: v2.14.1
# hooks:
# - id: pylint
# args: [--exit-zero]
# - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
# rev: 6565d773ca281682d7062d4c0be74538cc474cc9
# hooks:
# - id: pretty-format-java
# args: [--autofix]
# - id: pretty-format-kotlin
# args: [--autofix]
# - id: pretty-format-yaml
# args: [--autofix, --indent, "2"]
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.21.0 # or higher tag
# hooks:
# - id: yamllint
# args: [--format, parsable, --strict]
# - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
# rev: 0.1.0 # or specific tag
# hooks:
# - id: yamlfmt
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

install:
pip install -e .
pip install -r requirements_dev.txt

pre-commit:
pre-commit install

test:
coverage run --source='SignalIntegrity' Test/TestSignalIntegrity/TestAll.py > /dev/null

cov:
pytest --cov=SignalIntegrity

mypy:
mypy . --ignore-missing-imports

flake8:
flake8 --select RST

pylint:
pylint SignalIntegrity

pydocstyle:
pydocstyle SignalIntegrity

doc8:
doc8 docs/

update:
pur

update-pre:
pre-commit autoupdate --bleeding-edge

5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
numpy
matplotlib
urllib3
Pillow
scipy
24 changes: 24 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
autodoc_pydantic
autotyping
doc8
docutils==0.17.1
flake8
flake8-bugbear
ipykernel
mypy
myst-parser
nbsphinx
pre-commit
pur
pydocstyle
pytest
pytest-cov
pytest-regressions
sphinx-autodoc-typehints
sphinx-book-theme==0.3.3
sphinx-click
sphinx-copybutton
sphinx-markdown-tables==0.0.16
types-PyYAML
types-waitress
xdoctest