Skip to content

Commit

Permalink
Merge branch 'main' into mypyc-support-pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 committed Oct 28, 2021
2 parents f103dc0 + 5434407 commit 5fc39fe
Show file tree
Hide file tree
Showing 61 changed files with 2,192 additions and 1,262 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ contact_links:
url: https://discord.gg/RtVdv86PrH
about: |
User support, questions, and other lightweight requests can be
handled via the \#black-formatter text channel we have on Python
handled via the #black-formatter text channel we have on Python
Discord.
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more
smoothly we would appreciate that you go through this template. -->

### Description

<!-- Good things to put here include: reasoning for the change (please link
any relevant issues!), any noteworthy (or hacky) choices to be aware of,
or what the problem resolved here looked like ... we won't mind a ranty
story :) -->

### Checklist - did you ...

<!-- If any of the following items aren't relevant for your contribution
please still tick them so we know you've gone through the checklist.
All user-facing changes should get an entry. Otherwise, signal to us
this should get the magical label to silence the CHANGELOG entry check.
Tests are required for bugfixes and new features. Documentation changes
are necessary for formatting and most enhancement changes. -->

- [ ] Add a CHANGELOG entry if necessary?
- [ ] Add / update tests if necessary?
- [ ] Add new / update outdated documentation?

<!-- Just as a reminder, everyone in all psf/black spaces including PRs
must follow the PSF Code of Conduct (link below).
Finally, once again thanks for your time and effort. If you have any
feedback in regards to your experience contributing here, please
let us know!
Helpful links:
PSF COC: https://www.python.org/psf/conduct/
Contributing docs: https://black.readthedocs.io/en/latest/contributing/index.html
Chat on Python Discord: https://discord.gg/RtVdv86PrH -->
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- "main"
release:
types: created
types: [published]

jobs:
docker:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
tags: pyfound/black:latest,pyfound/black:${{ env.GIT_TAG }}

- name: Build and push latest_release tag
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
uses: docker/build-push-action@v2
with:
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/primer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pypi_upload

on:
release:
types: created
types: [published]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/upload_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
pathsep: ";"
asset_name: black_windows.exe
executable_mime: "application/vnd.microsoft.portable-executable"
platform: windows
- os: ubuntu-20.04
pathsep: ":"
asset_name: black_linux
executable_mime: "application/x-executable"
platform: unix
- os: macos-latest
pathsep: ":"
asset_name: black_macos
executable_mime: "application/x-mach-binary"
platform: macos

steps:
- uses: actions/checkout@v2
Expand All @@ -40,8 +43,10 @@ jobs:
python -m pip install pyinstaller
- name: Build binary
run: |
python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
run: >
python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data
'src/blib2to3${{ matrix.pathsep }}blib2to3' --hidden-import platformdirs.${{
matrix.platform }} src/black/__main__.py
- name: Upload binary as release asset
uses: actions/upload-release-asset@v1
Expand Down
24 changes: 22 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,46 @@ repos:
require_serial: true
types_or: [python, pyi]

- id: check-pre-commit-rev-in-example
name: Check pre-commit rev in example
language: python
entry: python -m scripts.check_pre_commit_rev_in_example
files: '(CHANGES\.md|source_version_control\.md)$'
additional_dependencies:
&version_check_dependencies [
commonmark==0.9.1,
pyyaml==5.4.1,
beautifulsoup4==4.9.3,
]

- id: check-version-in-the-basics-example
name: Check black version in the basics example
language: python
entry: python -m scripts.check_version_in_basics_example
files: '(CHANGES\.md|the_basics\.md)$'
additional_dependencies: *version_check_dependencies

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.902
rev: v0.910
hooks:
- id: mypy
exclude: ^docs/conf.py
additional_dependencies:
- types-dataclasses >= 0.1.3
- types-PyYAML
- tomli >= 0.2.6, < 2.0.0
- types-typed-ast >= 1.4.1
- click >= 8.0.0
- platformdirs >= 2.1.0

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.1
rev: v2.3.2
hooks:
- id: prettier
exclude: ^Pipfile\.lock
Expand Down
2 changes: 0 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]
Expand All @@ -13,7 +12,6 @@
"Black: The uncompromising Python code formatter (with Jupyter Notebook support)"
entry: black
language: python
language_version: python3
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi, jupyter]
Expand Down
50 changes: 50 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,58 @@

### _Black_

- Document stability policy, that will apply for non-beta releases (#2529)
- Add new `--workers` parameter (#2514)
- Fixed feature detection for positional-only arguments in lambdas (#2532)
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatiblity (#2519)

### _Blackd_

- Remove dependency on aiohttp-cors (#2500)
- Bump required aiohttp version to 3.7.4 (#2509)

### _Black-Primer_

- Add primer support for --projects (#2555)
- Print primer summary after individual failures (#2570)

### Integrations

- Allow to pass `target_version` in the vim plugin (#1319)

## 21.9b0

### Packaging

- Fix missing modules in self-contained binaries (#2466)
- Fix missing toml extra used during installation (#2475)

## 21.8b0

### _Black_

- Add support for formatting Jupyter Notebook files (#2357)
- Move from `appdirs` dependency to `platformdirs` (#2375)
- Present a more user-friendly error if .gitignore is invalid (#2414)
- The failsafe for accidentally added backslashes in f-string expressions has been
hardened to handle more edge cases during quote normalization (#2437)
- Avoid changing a function return type annotation's type to a tuple by adding a
trailing comma (#2384)
- Parsing support has been added for unparenthesized walruses in set literals, set
comprehensions, and indices (#2447).
- Pin `setuptools-scm` build-time dependency version (#2457)
- Exclude typing-extensions version 3.10.0.1 due to it being broken on Python 3.10
(#2460)

### _Blackd_

- Replace sys.exit(-1) with raise ImportError as it plays more nicely with tools that
scan installed packages (#2440)

### Integrations

- The provided pre-commit hooks no longer specify `language_version` to avoid overriding
`default_language_version` (#2430)

## 21.7b0

Expand Down
42 changes: 27 additions & 15 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,47 @@ url = "https://pypi.python.org/simple"
verify_ssl = true

[dev-packages]
Sphinx = ">=3.1.2"
coverage = "*"
docutils = "==0.15" # not a direct dependency, see https://github.com/pypa/pipenv/issues/3865
flake8 = "*"
# Testing related requirements.
coverage = ">= 5.3"
pytest = " >= 6.1.1"
pytest-xdist = ">= 2.2.1"
pytest-cov = ">= 2.11.1"
tox = "*"

# Linting related requirements.
pre-commit = ">=2.9.2"
flake8 = ">=3.9.2"
flake8-bugbear = "*"
mypy = ">=0.812"
mypy = ">=0.910"
types-dataclasses = ">=0.1.3"
types-typed-ast = ">=1.4.1"
pre-commit = "*"
readme_renderer = "*"
MyST-Parser = ">=0.13.7"
types-PyYAML = ">=5.4.1"

# Documentation related requirements.
Sphinx = ">=4.1.2"
MyST-Parser = ">=0.15.1"
sphinxcontrib-programoutput = ">=0.17"
sphinx-copybutton = ">=0.3.0"
sphinx-copybutton = ">=0.4.0"
docutils = "==0.17.1" # not a direct dependency, see https://github.com/pypa/pipenv/issues/3865

# Packaging related requirements.
setuptools = ">=39.2.0"
setuptools-scm = "*"
twine = ">=1.11.0"
wheel = ">=0.31.1"
black = {editable = true, extras = ["d"], path = "."}
readme_renderer = "*"

black = {editable = true, extras = ["d", "jupyter"], path = "."}

[packages]
aiohttp = ">=3.6.0"
aiohttp-cors = ">=0.4.0"
aiohttp = ">=3.7.4"
platformdirs= ">=2"
click = ">=8.0.0"
mypy_extensions = ">=0.4.3"
pathspec = ">=0.8.1"
regex = ">=2020.1.8"
tomli = ">=0.2.6, <2.0.0"
typed-ast = "==1.4.2"
typing_extensions = {"python_version <" = "3.10","version >=" = "3.10.0.0"}
typed-ast = "==1.4.3"
typing_extensions = {markers = "python_version < '3.10'", version = ">=3.10.0.0"}
black = {editable = true,extras = ["d"],path = "."}
dataclasses = {"python_version <" = "3.7","version >" = "0.1.3"}
dataclasses = {markers = "python_version < '3.7'", version = ">0.1.3"}
Loading

0 comments on commit 5fc39fe

Please sign in to comment.