diff --git a/.github/workflows/TESTS.yml b/.github/workflows/TESTS.yml new file mode 100644 index 0000000..8bbc705 --- /dev/null +++ b/.github/workflows/TESTS.yml @@ -0,0 +1,36 @@ +name: Tests + +on: + pull_request: + push: + branches: [master] + +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9"] + os: [windows-latest, ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + with: + activate-conda: false + conda-channels: conda-forge + + - name: Python ${{ matrix.python-version }} + shell: bash -l {0} + run: | + conda create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt + source activate TEST + pip install -e . --no-deps --force-reinstall + conda info --all + conda list + + - name: Tests + shell: bash -l {0} + run: \ No newline at end of file diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b3065e1..e356c37 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -4,12 +4,11 @@ on: pull_request: push: branches: [master] - + jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..179e6fd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,46 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-ast + - id: end-of-file-fixer + exclude: github_deploy_key_wesleybowman_utide.enc + - id: check-docstring-first + - id: check-added-large-files + - id: requirements-txt-fixer + - id: file-contents-sorter + files: requirements-dev.txt + - id: trailing-whitespace + - id: debug-statements + +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.4 + hooks: + - id: flake8 + exclude: docs/source/conf.py + args: [--max-line-length=105] + +- repo: https://github.com/pre-commit/mirrors-isort + rev: v5.7.0 + hooks: + - id: isort + additional_dependencies: [toml] + args: [--project=utide, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88] + +- repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + language_version: python3 + +- repo: https://github.com/asottile/pyupgrade + rev: v2.10.0 + hooks: + - id: pyupgrade + args: + - --py36-plus + +- repo: https://github.com/asottile/add-trailing-comma + rev: v2.1.0 + hooks: + - id: add-trailing-comma \ No newline at end of file