Skip to content

Commit

Permalink
add initial content from pie-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Aug 23, 2023
0 parents commit 0c71a8e
Show file tree
Hide file tree
Showing 14 changed files with 517 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

[run]
source = src

[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
48 changes: 48 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: ":boom: Breaking Changes"
labels:
- "breaking"
- title: ":pencil: Document Processors"
labels:
- "document processor"
- title: ":zap: Metrics"
labels:
- "metric"
- title: ":rocket: Other Features"
labels:
- "enhancement"
- title: ":fire: Removals and Deprecations"
labels:
- "removal"
- title: ":beetle: Fixes"
labels:
- "bug"
- title: ":racehorse: Performance"
labels:
- "performance"
- title: ":rotating_light: Testing"
labels:
- "testing"
- title: ":construction_worker: Continuous Integration"
labels:
- "ci"
- title: ":books: Documentation"
labels:
- "documentation"
- title: ":hammer: Refactoring"
labels:
- "refactoring"
- title: ":lipstick: Style"
labels:
- "style"
- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
- title: Other Changes
labels:
- "*"
30 changes: 30 additions & 0 deletions .github/workflows/code-quality-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Same as `code-quality-pr.yaml` but triggered on commit to main branch
# and runs on all files (instead of only the changed ones)

name: Code Quality Main

on:
push:
branches: [main]

jobs:
code-quality:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"

- run: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install ".[dev]"
- name: Run pre-commits
uses: pre-commit/[email protected]
44 changes: 44 additions & 0 deletions .github/workflows/code-quality-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow finds which files were changed, prints them,
# and runs `pre-commit` on those files.

# Inspired by the sktime library:
# https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml

name: Code Quality PR

on:
pull_request:
branches: [main, "release/*"]

jobs:
code-quality:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"

- run: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install ".[dev]"
- name: Find modified files
id: file_changes
uses: trilom/[email protected]
with:
output: " "

- name: List modified files
run: echo '${{ steps.file_changes.outputs.files}}'

- name: Run pre-commits
uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.file_changes.outputs.files}}
39 changes: 39 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main, "release/*"]

jobs:
tests:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9"]

timeout-minutes: 10

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: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install -e ".[tests]"
- name: Run tests with coverage
run: |
pytest -k "not slow" --cov --cov-fail-under=100 --cov-report term-missing
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
Loading

0 comments on commit 0c71a8e

Please sign in to comment.