-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial refactoring for standardizing linting and testing (#15)
* Inline dependencies with Py3.8 as 1.0.0 * Add isort, black and basic invoke tasks * Typo in docstring * Add package installation by default * Ignore the lines which are too long * Initial automatic linting * Use pytest for running tests * Fix testing with pytest * Don't change Python code (cosmestics only) * Add setup and publishing commands * Update README to match the Invoke usage * Explain ignored codes * Add github actions pipeline --------- Co-authored-by: Matti Mokko <[email protected]>
- Loading branch information
Showing
22 changed files
with
988 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: java-access-bridge-wrapper | ||
|
||
on: | ||
push: | ||
paths: | ||
- src/** | ||
- .github/workflows/** | ||
|
||
jobs: | ||
lint: | ||
# Not using the latest ubuntu until this issue is fixed in setup-python: | ||
# https://github.com/actions/setup-python/issues/401 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.12 | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install requirements | ||
run: pip install -Ur requirements.txt | ||
- name: Set up cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: invoke update | ||
- name: Run lint | ||
run: invoke lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# List of codes: | ||
# https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes | ||
# https://flake8.pycqa.org/en/latest/user/error-codes.html | ||
|
||
[flake8] | ||
ignore = | ||
# W503: line break before binary operator | ||
W503, | ||
# E203: whitespace before ‘,’, ‘;’, or ‘:’ | ||
E203, | ||
# E501: line too long (82 > 79 characters) | ||
E501 | ||
per-file-ignores = | ||
# F401: module imported but unused | ||
*/__init__.py: F401 | ||
exclude = | ||
.git, | ||
.venv | ||
|
||
max-complexity = 10 | ||
# Subject to change after deciding upon a global Python library standard. | ||
max-line-length = 120 |
Oops, something went wrong.