Merge pull request #422 from henryiii/ci/format

ci: format updates
This commit is contained in:
Yannick Jadoul
2020-08-16 23:02:19 +02:00
committed by GitHub
9 changed files with 45 additions and 48 deletions
-17
View File
@@ -1,22 +1,6 @@
version: 2 version: 2
jobs: jobs:
flake8-mypy:
docker:
- image: circleci/python:3.6
steps:
- checkout
- run:
name: Install flake8 & mypy
command: sudo python -m pip install flake8 mypy
- run:
name: flake8
command: flake8
- run:
name: mypy
command: mypy
osx-python3.6: osx-python3.6:
macos: macos:
xcode: "9.4.1" xcode: "9.4.1"
@@ -54,6 +38,5 @@ workflows:
version: 2 version: 2
all-tests: all-tests:
jobs: jobs:
- flake8-mypy
- osx-python3.6 - osx-python3.6
- linux-python3.6 - linux-python3.6
+8
View File
@@ -7,6 +7,14 @@ on:
- 'docs/**' - 'docs/**'
jobs: jobs:
pre-commit:
name: Pre-commit checks (mypy, flake8, etc.)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
test: test:
# skip branch builds on joerick/cibuildwheel, but always build `master` and pull requests # skip branch builds on joerick/cibuildwheel, but always build `master` and pull requests
if: github.repository != 'joerick/cibuildwheel' || github.ref == 'refs/heads/master' || github.event_name == 'pull_request' if: github.repository != 'joerick/cibuildwheel' || github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
+24 -20
View File
@@ -1,21 +1,25 @@
repos: repos:
- repo: https://gitlab.com/pycqa/flake8 - repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1 rev: 3.8.3
hooks: hooks:
- id: flake8 - id: flake8
pass_filenames: true exclude: cibuildwheel/resources/
# this seems to need to be here in addition to setup.cfg additional_dependencies: [flake8-bugbear]
exclude: cibuildwheel/resources/
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0 rev: v3.2.0
hooks: hooks:
- id: check-yaml - id: check-case-conflict
- id: check-merge-conflict - id: check-merge-conflict
- id: end-of-file-fixer - id: check-yaml
exclude: cibuildwheel/resources/pinned_docker_images.cfg - id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-mypy exclude: cibuildwheel/resources/pinned_docker_images.cfg
rev: '' # Use the sha / tag you want to point at - id: mixed-line-ending
hooks: - id: trailing-whitespace
- id: mypy
files: cibuildwheel|test - repo: https://github.com/pre-commit/mirrors-mypy
exclude: cibuildwheel/resources rev: v0.782
hooks:
- id: mypy
files: cibuildwheel/|test/
pass_filenames: false
+3 -3
View File
@@ -1,5 +1,5 @@
environment: environment:
# workaround an appveyor bug on macos # workaround an appveyor bug on macos
# see https://github.com/appveyor/ci/issues/3376#issuecomment-611314299 # see https://github.com/appveyor/ci/issues/3376#issuecomment-611314299
APPVEYOR_CONSOLE_DISABLE_PTY: true APPVEYOR_CONSOLE_DISABLE_PTY: true
matrix: matrix:
@@ -11,8 +11,8 @@ environment:
APPVEYOR_JOB_NAME: "python37-x64-macos-mojave" APPVEYOR_JOB_NAME: "python37-x64-macos-mojave"
# while pypy libffi dependency is failing the build, allow failures on macos # while pypy libffi dependency is failing the build, allow failures on macos
matrix: matrix:
allow_failures: allow_failures:
- APPVEYOR_BUILD_WORKER_IMAGE: macos-mojave - APPVEYOR_BUILD_WORKER_IMAGE: macos-mojave
stack: python 3.7 stack: python 3.7
+3 -2
View File
@@ -117,11 +117,12 @@ class DockerContainer:
return [PurePath(p) for p in path_strs] return [PurePath(p) for p in path_strs]
def call(self, args: Sequence[Union[str, PathLike]], env: Dict[str, str] = {}, def call(self, args: Sequence[Union[str, PathLike]], env: Optional[Dict[str, str]] = None,
capture_output=False, cwd: Optional[Union[str, PathLike]] = None) -> str: capture_output=False, cwd: Optional[Union[str, PathLike]] = None) -> str:
chdir = f'cd {cwd}' if cwd else '' chdir = f'cd {cwd}' if cwd else ''
env_assignments = ' '.join(f'{shlex.quote(k)}={shlex.quote(v)}' env_assignments = ' '.join(f'{shlex.quote(k)}={shlex.quote(v)}'
for k, v in env.items()) for k, v in env.items()) if env is not None else ''
command = ' '.join(shlex.quote(str(a)) for a in args) command = ' '.join(shlex.quote(str(a)) for a in args)
end_of_message = str(uuid.uuid4()) end_of_message = str(uuid.uuid4())
+2 -2
View File
@@ -9,14 +9,14 @@ After you've built your wheels, you'll probably want to deliver them to PyPI.
On your development machine, do the following... On your development machine, do the following...
```bash ```bash
# Clear out your 'dist' folder. # Clear out your 'dist' folder.
rm -rf dist rm -rf dist
# Make a source distribution # Make a source distribution
python setup.py sdist python setup.py sdist
# 🏃🏻 # 🏃🏻
# Go and download your wheel files from wherever you put them. e.g. your CI # Go and download your wheel files from wherever you put them. e.g. your CI
# provider can be configured to store them for you. Put them all into the # provider can be configured to store them for you. Put them all into the
# 'dist' folder. # 'dist' folder.
# Upload using 'twine' (you may need to 'pip install twine') # Upload using 'twine' (you may need to 'pip install twine')
+1 -1
View File
@@ -59,7 +59,7 @@ h1, h2, h3, h4, h5, h6 {
background-color: #eff1f3; background-color: #eff1f3;
font-size: 85%; font-size: 85%;
font-weight: bold; font-weight: bold;
border-top-left-radius: 3px; border-top-left-radius: 3px;
border-top-right-radius: 3px; border-top-right-radius: 3px;
+2 -2
View File
@@ -2,9 +2,9 @@
title: Home title: Home
--- ---
{% {%
includemarkdown "../README.md" includemarkdown "../README.md"
start="<!--intro-start-->" start="<!--intro-start-->"
end="<!--intro-end-->" end="<!--intro-end-->"
%} %}
+2 -1
View File
@@ -1,5 +1,6 @@
[flake8] [flake8]
ignore = E501,W503,E741,E226 ignore = E501,W503,E741,E226,B950
select = C,E,F,W,B,B9
application-import-names = cibuildwheel application-import-names = cibuildwheel
exclude = exclude =
cibuildwheel/resources/, cibuildwheel/resources/,