Skip to content

Commit

Permalink
0.7.1 (#39)
Browse files Browse the repository at this point in the history
* Fix setup.py

* ✨ Allow absolute path and pathlib.Path passed as template files

* 🎨 Use flake8 instead pylint; add mypy type check

* ✨ Allow add/sub to work with date filter (#38); Add filters_as_globals for wild mode

* ✅ Add full tests

* 💚 Try fixing CI

* 0.7.1
  • Loading branch information
pwwang authored Oct 5, 2021
1 parent 56eee6c commit 3917729
Show file tree
Hide file tree
Showing 43 changed files with 1,175 additions and 1,270 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

[run]
omit = liquid/patching.py

[report]
exclude_lines =
if TYPE_CHECKING:
pragma: no cover
pass
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
# reinstall pandas to specific version
pip install $JINJA2
pip install python-dateutil
pip install python-frontmatter
env:
JINJA2: ${{ matrix.jinja2 }}
- name: Test with pytest
Expand All @@ -46,7 +47,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: cov.xml
Expand Down
55 changes: 21 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,35 @@ repos:
- id: check-added-large-files
- repo: local
hooks:
- id: masterpylintrc
name: Overwrite local .pylintrc by master one
entry: cp ../.pylintrc ./.pylintrc
pass_filenames: false
always_run: true
- id: versionchecker
name: Check version agreement in pyproject and __version__
entry: bash -c
language: system
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
files: ^liquid/.+$
args:
- get_ver() { echo $(egrep "^__version|^version" $1 | cut -d= -f2 | sed 's/\"\| //g'); };
v1=`get_ver pyproject.toml`;
v2=`get_ver liquid/__init__.py`;
if [[ $v1 == $v2 ]]; then exit 0; else exit 1; fi
pass_filenames: false
types: [python]
args: [liquid]
- repo: local
hooks:
- id: poetry2setuppy
name: Convert pyproject.toml to setup.py
# need to pass name directly to setup() for github
# to track dependents
entry: |
bash -c "poetry build --format sdist | tail -1 | sed 's|.\+varname|cat dist/varname|' | bash | tar --wildcards --no-anchored '*/setup.py' -O -zxf - | sed \"s/'name': /# 'name': /\" | sed \"s/setup(/setup(name='varname', /\" > setup.py"
files: ^pyproject\.toml|liquid/__init__\.py$
- id: flake8
name: Run flake8
entry: flake8
language: system
files: pyproject.toml
args: [liquid]
pass_filenames: false
# - id: poetry2requirements
# name: Convert pyproject.toml to requirements.txt
# entry: dephell deps convert --from=poetry --to=requirements.txt
# language: system
# files: pyproject.toml
# pass_filenames: false
# - id: api
# name: Generate API documentation
# entry: bash -c
# args: ['python api.py > docs/api.md']
# language: system
# pass_filenames: false
# files: ^liquid/.+$
files: ^liquid/.+$
- id: pytest
name: Run pytest
entry: pytest
language: system
args: [tests/]
pass_filenames: false
files: ^tests/.+$|^liquid/.+$
- id: mypy
name: Run mypy type check
entry: mypy
language: system
args: ["-p", "liquid"]
pass_filenames: false
files: ^liquid/.+$
Loading

0 comments on commit 3917729

Please sign in to comment.