Skip to content

Commit

Permalink
Remove black and flake8 deps. They are not available on wcoss2. keep… (
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul authored Jul 10, 2023
1 parent f084062 commit 654f63c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 40 deletions.
7 changes: 3 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Before opening a PR, please note these guidelines:

**Type of change**

Please delete options that are not relevant.
<!-- Please delete options that are not relevant. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
Expand All @@ -31,11 +31,10 @@ Please delete options that are not relevant.
<!-- Please describe the tests that you ran to verify your changes and on the platforms these tests were conducted. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->
<!-- If adding a new feature, was an accompanying test added? -->

<!-- Use the following as a guide to list your tests and delete options that are not relevant. Expand as necessary. -->
<!--
- [ ] pynorms
- [ ] pytests
-->

**Checklist**

Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/pynorms.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
name: pynorms
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
check_norms:
runs-on: ubuntu-latest
name: Check Python coding norms with pycodestyle
name: Check Python coding norms

steps:

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pycodestyle
- name: Checkout
uses: actions/checkout@v3

- name: Run pycodestyle
run: |
cd $GITHUB_WORKSPACE
pycodestyle --verbose --config ./.pycodestyle ./
- uses: actions/setup-python@v4
- name: Install (upgrade) python dependencies (pycodestyle)
run: |
pip install --upgrade pip
pip install pycodestyle
- uses: actions/checkout@v3
- uses: pre-commit/[email protected]
18 changes: 8 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ repos:
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 23.3.0
name: isort
- repo: local
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
- id: pycodestyle
name: pycodestyle
entry: pycodestyle
language: system
types: [python]
args: ['--config=.pycodestyle']
9 changes: 4 additions & 5 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To help speed up the review process please ensure the following:

- The PR addresses an open issue.
- All tests are passing locally with ``pytest``.
- The project passes linting with ``black`` and ``flake8``.
- The project passes linting with ``isort`` and ``pycodestyle``.
- If adding a new feature you also add documentation.

Developing
Expand All @@ -25,13 +25,13 @@ and then clone it locally.
$ git clone https://github.com/yourusername/wxflow
$ cd wxflow
This project uses ``isort`` to sort Python import definitions alphabetically, ``black`` to format code and ``flake8`` for linting. We also support ``pre-commit`` to ensure
This project uses ``isort`` to sort Python import definitions alphabetically and ``pycodestyle`` as the Python style checker against conventions in PEP8. We also support ``pre-commit`` to ensure
these have been run. To configure your local environment please install these development dependencies and set up
the commit hooks.

.. code-block:: bash
$ pip install isort black flake8 pre-commit
$ pip install isort pycodestyle pre-commit
$ pre-commit install
You can check that things are working correctly by calling pre-commit directly.
Expand All @@ -40,8 +40,7 @@ You can check that things are working correctly by calling pre-commit directly.
$ pre-commit run --all-files
isort......................................Passed
black......................................Passed
flake8.....................................Passed
pycodestyle................................Passed
These checks will be run automatically when you make a commit (if ``pre-commit`` has been installed).

Expand Down
11 changes: 5 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install_requires =
PyYAML>=6.0
Jinja2>=3.1.2
tests_require =
pytest, pytest-cov, isort, black, flake8
pytest, pytest-cov, isort, pycodestyle

[options.packages.find]
where=src
Expand All @@ -53,8 +53,8 @@ where=src
* = *.txt, *.md

[options.extras_require]
dev = pytest>=7; pytest-cov>=3; isort>=5; black>=21; flake8>=4; pre-commit>=2; tox>=3
docs = sphinx>=4; sphinx-autobuild; sphinx_rtd_theme>=0.5; furo>=2023.03.23; sphinx-copybutton
dev = pytest>=7; pytest-cov>=3; isort>=5; pycodestyle>=2; pre-commit>=2; tox>=3
docs = sphinx>=4; sphinx-autobuild; sphinx_td_theme>=0.5; furo>=2023.03.23; sphinx-copybutton

[green]
file-pattern = test_*.py
Expand All @@ -66,7 +66,6 @@ run-coverage = true
[tool:pytest]
addopts = --cov=wxflow --cov-report=term-missing --cov-report=xml --cov-report=html

[tool:flake8]
exclude = .git,.github,venv,__pycache__,docs/conf.py,old,build,dist
[tool:pycodestyle]
exclude = .git,.github,venv,.vscode,docs/conf.py
max-line-length = 160
per-file-ignores = __init__.py: F401

0 comments on commit 654f63c

Please sign in to comment.