Skip to content

Commit

Permalink
📌 Clean up and pin deps
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang committed May 12, 2022
1 parent ce17f98 commit 9630172
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 927 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: "! contains(github.event.head_commit.message, 'wip')"
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.7, 3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,10 +22,10 @@ jobs:
python -m pip install --upgrade pip
python -m pip install poetry
poetry config virtualenvs.create false
python -m pip install pylint
python -m pip install flake8
poetry install -v
- name: Run pylint
run: pylint simplug
- name: Run flake8
run: flake8 simplug.py
- name: Test with pytest
run: poetry run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
- name: Upload pytest test results
Expand All @@ -37,7 +37,7 @@ jobs:
if: ${{ always() }}
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@master
if: matrix.python-version == 3.8
if: matrix.python-version == 3.9
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: .coverage.xml
Expand All @@ -48,7 +48,7 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Setup Python # Set Python version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
if: "! contains(github.event.head_commit.message, 'wip')"
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Setup Python # Set Python version
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
with:
Expand Down
41 changes: 15 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
fail_fast: false
exclude: '^README.rst$|^tests/|^setup.py$|^examples/'
exclude: '^tests/|^setup\.py$|^examples/'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 5df1a4bf6f04a1ed3a643167b38d502575e29aef
Expand All @@ -12,39 +12,28 @@ repos:
- id: check-added-large-files
- repo: local
hooks:
- id: masterpylintrc
name: Overwrite local .pylintrc by master one
entry: cp ../.pylintrc ./.pylintrc
files: ../.pylintrc
pass_filenames: false
always_run: true
language: system
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
- id: flake8
name: Run flake8
files: ^simplug\.py$
pass_filenames: false
pass_filenames: true
entry: flake8
types: [python]
args: [simplug.py]
- repo: local
hooks:
- id: poetry2setuppy
name: Convert pyproject.toml to setup.py
entry: dephell deps convert --from=poetry --to=setup.py
language: system
files: pyproject.toml
pass_filenames: false
- id: poetry2requirements
name: Convert pyproject.toml to requirements.txt
entry: dephell deps convert --from=poetry --to=requirements.txt
- id: versionchecker
name: Check version agreement in pyproject and __version__
entry: bash -c
language: system
files: pyproject.toml
args:
- get_ver() { echo $(egrep "^__version|^version" $1 | cut -d= -f2 | sed 's/\"\| //g'); };
v1=`get_ver pyproject.toml`;
v2=`get_ver simplug.py`;
if [[ $v1 == $v2 ]]; then exit 0; else exit 1; fi
pass_filenames: false
files: ^pyproject\.toml|simplug\.py$
- id: pytest
name: Run pytest
entry: pytest
language: system
args: [tests/]
pass_filenames: false
files: ^tests/.+$|simplug\.py$
files: ^tests/.+$|^simplug\.py$
Loading

0 comments on commit 9630172

Please sign in to comment.