Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Darken action to check for pep8 violations in diffs #3954

Merged
merged 29 commits into from
Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c9fa623
darken our futures
IAlibay Dec 8, 2022
a9e47a3
update pypi_check workflow
IAlibay Dec 8, 2022
c268521
Don't specify revision?
IAlibay Dec 8, 2022
2c79085
Intentional pep8 violation
IAlibay Dec 8, 2022
128b47c
try triggering violation again
IAlibay Dec 8, 2022
b5aad83
maybe it's a shell thing?
IAlibay Dec 8, 2022
52f554a
a code based violation
IAlibay Dec 8, 2022
740cc09
Add another line change to see if it'll still complain
IAlibay Dec 8, 2022
d088fbb
check empty line pep8 violations in testsuite
IAlibay Dec 8, 2022
8413105
Add a flake8 linter on top?
IAlibay Dec 8, 2022
3c5544f
try just passing the develop branch as revision?
IAlibay Dec 8, 2022
1825db5
try to just use the default definition
IAlibay Dec 8, 2022
6ee1442
Try to violate pep8 in testsuite for char length
IAlibay Dec 8, 2022
5895887
visual indentation trigger
IAlibay Dec 8, 2022
eb22820
what if it doesn't just see blank lines?
IAlibay Dec 8, 2022
a64a56e
why is the line not triggered?
IAlibay Dec 8, 2022
a477bac
fix two out of three problems
IAlibay Dec 8, 2022
a30daba
remove test dictionary
IAlibay Dec 8, 2022
dbe31f5
revert large char count line
IAlibay Dec 8, 2022
35d7ccf
I'm sorry :(
IAlibay Dec 8, 2022
02d5ef5
I went too far
IAlibay Dec 8, 2022
28587bb
undo demonstration code
IAlibay Dec 9, 2022
47a157b
Make test checks run even if package checks fail
IAlibay Dec 9, 2022
2887f3a
add flake8 config and a quick test code for it
IAlibay Dec 9, 2022
07e474f
Revert unit change
IAlibay Dec 9, 2022
34300d1
update darker version to master
IAlibay Dec 9, 2022
d598fab
add master version in start code testing
IAlibay Dec 9, 2022
95145de
check flake8 limit works
IAlibay Dec 11, 2022
46233f3
revert 89 char test
IAlibay Dec 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 88
74 changes: 48 additions & 26 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
- uses: actions/setup-python@v4
with:
python-version: 3.8
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
architecture: x64

- name: install
run: |
which pip
which python
pip install pylint
python -m pip install pylint

- name: pylint
env:
Expand All @@ -250,37 +242,67 @@ jobs:
pylint package/MDAnalysis && pylint testsuite/MDAnalysisTests


darker_lint:
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: darker main code
uses: akaihola/[email protected]
with:
version: "@master"
options: "--check --diff --color"
src: "./package/MDAnalysis"
revision: "HEAD^"
lint: "flake8"

- name: darker test code
uses: akaihola/[email protected]
if: success() || failure()
with:
version: "@master"
options: "--check --diff --color"
src: "./testsuite/MDAnalysisTests"
revision: "HEAD^"
lint: "flake8"


pypi_check:
if: "github.repository == 'MDAnalysis/mdanalysis'"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./package

steps:
- uses: actions/checkout@v3

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
- uses: actions/setup-python@v4
with:
python-version: 3.8
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
# mamba not enabled as install longer than deps install
architecture: x64

- name: install_pip_conda
- name: install_deps
run: |
# Issue 3612 - readme_renderer is outdated on conda-forge
conda install setuptools cython numpy twine
pip install "readme-renderer>=34.0"
python -m pip install twine "readme-renderer>=34.0"

- name: install_mdanalysis
- name: build_sdist
run: |
cd package && python setup.py sdist
pipx run build --sdist

- name: check_package_build
run: |
DISTRIBUTION=$(ls -t1 package/dist/MDAnalysis-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution package/dist/MDAnalysis-*.tar.gz found"; exit 1; }
DISTRIBUTION=$(ls -t1 dist/MDAnalysis-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/MDAnalysis-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION