Skip to content

Commit

Permalink
misc: minor updates in tests, readme, dependabot and release-drafter (x…
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas authored Jul 18, 2022
1 parent ff4c0fe commit cf6cd72
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 17 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
# Add assignees
assignees:
- "math-fehr"
- "georgebisbas"
commit-message:
prefix: "pip prod"
prefix-development: "pip dev"
include: "scope"
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: 'API'
label: 'API'
- title: 'Examples'
label: 'examples'
- title: 'Documentation'
label: 'documentation'
- title: 'Compiler'
label: 'compiler'
- title: '🐛 Bug Fixes'
labels:
- 'bug-py-minor'
- 'bug-py'
- title: 'Benchmarking'
label: 'benchmarking'
- title: 'Testing'
label: 'testing'
- title: 'Continuous Integration'
label: 'CI'
- title: 'Installation'
labels:
- 'docker'
- 'installation'
- 'dependencies'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
27 changes: 17 additions & 10 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,39 @@

name: Python application

on: [push, pull_request]
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check format with yapf
run: |
# Returns en error code if the files are not formatted
yapf --diff -r .
- name: Install the package locally
run: pip install .
- name: Test with pytest
run: |
python3 -m pytest
python3 -m pytest tests/
- name: Execute lit tests
run: |
export PYTHONPATH=$(pwd)
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/yapf-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: yapf formatting

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install formatting requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements-optional.txt
- name: Check format with yapf
run: |
# Returns en error code if the files are not formatted
yapf --diff -r .
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,7 @@ cython_debug/
# PyCharm IDE
*.idea/
.vscode/settings.json


# lit tests results
tests/filecheck/.lit_test_times.txt
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# xDSL

## Prerequisits
## Prerequisites

To install all required dependencies, execute the following command:
To install the required dependencies, execute the following command:

```
pip install -r requirements.txt
```

Optional dependencies, necessary for formatting the code may be installed via:

```
pip install -r requirements-optionals.txt
```

TODO: check if PYTHONPATH is required or if there exists an easy fix for it.

## Testing
Expand Down Expand Up @@ -40,8 +46,6 @@ The functionality is tested with MLIR git commit hash: 74992f4a5bb79e2084abdef40

## Formatting

All python code used in xDSL use yapf to format the code in a uniform manner.

https://github.com/google/yapf
All python code used in xDSL uses [yapf](https://github.com/google/yapf) to format the code in a uniform manner.

To automate the formatting within vim, one can use https://github.com/vim-autoformat/vim-autoformat and trigger a `:Autoformat` on save.
2 changes: 2 additions & 0 deletions requirements-optional.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yapf<0.33.*
toml<0.11.*
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
yapf<0.33.*
pytest<7.2.*
filecheck<0.0.23
lit<15.0.*
frozenlist<1.4.*
toml

0 comments on commit cf6cd72

Please sign in to comment.