Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/allow-overr…
Browse files Browse the repository at this point in the history
…iding-black-version-in-github-action
  • Loading branch information
ichard26 committed May 18, 2021
2 parents 224ab8f + 7190d4f commit c27ccb4
Show file tree
Hide file tree
Showing 116 changed files with 9,732 additions and 9,292 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Expand Up @@ -3,3 +3,7 @@ omit =
src/blib2to3/*
tests/data/*
*/site-packages/*
.tox/*

[run]
relative_files = True
6 changes: 1 addition & 5 deletions .flake8
@@ -1,11 +1,7 @@
[flake8]
extend-ignore = E203, E266, E501
# line length is intentionally set to 80 here because black uses Bugbear
# See https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length for more details
# See https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length for more details
max-line-length = 80
max-complexity = 18
select = B,C,E,F,W,T4,B9
# We need to configure the mypy.ini because the flake8-mypy's default
# options don't properly override it, so if we don't specify it we get
# half of the config from mypy.ini and half from flake8-mypy.
mypy_config = mypy.ini
21 changes: 11 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -11,25 +11,26 @@ assignees: ""
**To Reproduce** Steps to reproduce the behavior:

1. Take this file '...'
2. Run _Black_ on it with these arguments '....'
3. See error
1. Run _Black_ on it with these arguments '....'
1. See error

**Expected behavior** A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**

- Version: [e.g. master]
- OS and Python version: [e.g. Linux/Python 3.7.4rc1]
- Version: \[e.g. main\]
- OS and Python version: \[e.g. Linux/Python 3.7.4rc1\]

**Does this bug also happen on master?** To answer this, you have two options:
**Does this bug also happen on main?** To answer this, you have two options:

1. Use the online formatter at https://black.now.sh/?version=master, which will use the
latest master branch.
2. Or run _Black_ on your machine:
1. Use the online formatter at <https://black.vercel.app/?version=main>, which will use
the latest main branch.
1. Or run _Black_ on your machine:
- create a new virtualenv (make sure it's the same Python version);
- clone this repository;
- run `pip install -e .`;
- make sure it's sane by running `python -m unittest`; and
- run `pip install -e .[d,python2]`;
- run `pip install -r test_requirements.txt`
- make sure it's sane by running `python -m pytest`; and
- run `black` like you did last time.

**Additional context** Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Expand Up @@ -7,7 +7,7 @@ assignees: ""
---

**Is your feature request related to a problem? Please describe.** A clear and concise
description of what the problem is. Ex. I'm always frustrated when [...]
description of what the problem is. Ex. I'm always frustrated when \[...\]

**Describe the solution you'd like** A clear and concise description of what you want to
happen.
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/doc.yml
@@ -1,18 +1,6 @@
name: Documentation Build

on:
push:
paths:
- "docs/**"
- "README.md"
- "CHANGES.md"
- "CONTRIBUTING.md"
pull_request:
paths:
- "docs/**"
- "README.md"
- "CHANGES.md"
- "CONTRIBUTING.md"
on: [push, pull_request]

jobs:
build:
Expand All @@ -35,8 +23,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e "."
python -m pip install -e ".[d]"
python -m pip install -r "docs/requirements.txt"
- name: Build documentation
run: sphinx-build -a -b html -W docs/ docs/_build/
run: sphinx-build -a -b html -W --keep-going docs/ docs/_build
43 changes: 43 additions & 0 deletions .github/workflows/docker.yml
@@ -0,0 +1,43 @@
name: docker

on:
push:
branches:
- "main"
release:
types: created

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Check + set version tag
run:
echo "GIT_TAG=$(git describe --candidates=0 --tags 2> /dev/null || echo
latest_non_release)" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: pyfound/black:latest,pyfound/black:${{ env.GIT_TAG }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Expand Up @@ -22,8 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
python -m pip install -e '.[d]'
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
uses: pre-commit/action@v2.0.2
11 changes: 10 additions & 1 deletion .github/workflows/primer.yml
@@ -1,6 +1,15 @@
name: Primer

on: [push, pull_request]
on:
push:
paths-ignore:
- "docs/**"
- "*.md"

pull_request:
paths-ignore:
- "docs/**"
- "*.md"

jobs:
build:
Expand Down
44 changes: 42 additions & 2 deletions .github/workflows/test.yml
@@ -1,6 +1,15 @@
name: Test

on: [push, pull_request]
on:
push:
paths-ignore:
- "docs/**"
- "*.md"

pull_request:
paths-ignore:
- "docs/**"
- "*.md"

jobs:
build:
Expand Down Expand Up @@ -33,4 +42,35 @@ jobs:
- name: Unit tests
run: |
tox -e py
tox -e py -- -v --color=yes
- name: Publish coverage to Coveralls
# If pushed / is a pull request against main repo AND
# we're running on Linux (this action only supports Linux)
if:
((github.event_name == 'push' && github.repository == 'psf/black') ||
github.event.pull_request.base.repo.full_name == 'psf/black') && matrix.os ==
'ubuntu-latest'

uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: py${{ matrix.python-version }}-${{ matrix.os }}
debug: true

coveralls-finish:
needs: build
# If pushed / is a pull request against main repo
if:
(github.event_name == 'push' && github.repository == 'psf/black') ||
github.event.pull_request.base.repo.full_name == 'psf/black'

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Coveralls finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel-finished: true
debug: true
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -16,4 +16,4 @@ src/_black_version.py
.dmypy.json
*.swp
.hypothesis/
venv/
venv/
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Expand Up @@ -28,4 +28,3 @@ repos:
rev: v2.2.1
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
3 changes: 3 additions & 0 deletions .prettierrc.yaml
@@ -0,0 +1,3 @@
proseWrap: always
printWidth: 88
endOfLine: auto
9 changes: 8 additions & 1 deletion readthedocs.yml → .readthedocs.yaml
@@ -1,7 +1,14 @@
version: 2

formats:
- htmlzip

python:
version: 3.8
install:
- requirements: docs/requirements.txt
- method: setuptools

- method: pip
path: .
extra_requirements:
- d
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

0 comments on commit c27ccb4

Please sign in to comment.