Skip to content

Commit

Permalink
Merge branch 'main' into feat/pyproject-config
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Nov 14, 2021
2 parents 5f0147a + 1e0ec54 commit 87dd4d1
Show file tree
Hide file tree
Showing 35 changed files with 2,252 additions and 911 deletions.
59 changes: 38 additions & 21 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,58 @@ labels: "T: bug"
assignees: ""
---

<!--
Please make sure that the bug is not already fixed either in newer versions or the
current development version. To confirm this, you have three options:
1. Update Black's version if a newer release exists: `pip install -U black`
2. Use the online formatter at <https://black.vercel.app/?version=main>, which will use
the latest main branch.
3. 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 .[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.
-->

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**

<!-- Steps to reproduce the behavior:
<!--
Minimal steps to reproduce the behavior with source code and Black's configuration.
-->

For example:
1. Take this file '...'
1. Run _Black_ on it with these arguments '...'
1. See error -->
For example, take this code:

**Expected behavior**
```python
this = "code"
```

<!-- A clear and concise description of what you expected to happen. -->
And run it with these arguments:

**Environment (please complete the following information):**
```sh
$ black file.py --target-version py39
```

- Version: <!-- e.g. [main] -->
- OS and Python version: <!-- e.g. [Linux/Python 3.7.4rc1] -->
The resulting error is:

**Does this bug also happen on main?**
> cannot format file.py: INTERNAL ERROR: ...
<!-- To answer this, you have two options:
**Expected behavior**

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 .[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. -->
<!-- A clear and concise description of what you expected to happen. -->

**Environment**

<!-- Please complete the following information: -->

- Black's version: <!-- e.g. [main] -->
- OS and Python version: <!-- e.g. [Linux/Python 3.7.4rc1] -->

**Additional context**

Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ _build
.vscode
docs/_static/pypi.svg
__pycache__

# Packaging artifacts
black.egg-info
black.dist-info
build/
dist/
pip-wheel-metadata/
.eggs

src/_black_version.py
.idea
.eggs

.dmypy.json
*.swp
venv/
Expand Down
27 changes: 24 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
# Change Log

## Unreleased
## _Unreleased_

### _Black_

- Warn about Python 2 deprecation in more cases by improving Python 2 only syntax
detection (#2592)
- Add partial support for the match statement. As it's experimental, it's only enabled
when `--target-version py310` is explicitly specified (#2586)
- Add support for parenthesized with (#2586)
- Allow specifying `config` in config files (#2525)

## 21.10b0

### _Black_

- Document stability policy, that will apply for non-beta releases (#2529)
- Add new `--workers` parameter (#2514)
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatibility (#2519)
- Fixed feature detection for positional-only arguments in lambdas (#2532)
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatiblity (#2519)
- Allow specifying `config` in config files (#2525)
- Bumped typed-ast version minimum to 1.4.3 for 3.10 compatibility (#2519)
- Fixed a Python 3.10 compatibility issue where the loop argument was still being passed
even though it has been removed (#2580)
- Deprecate Python 2 formatting support (#2523)

### _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)
- Install build tools in docker file and use multi-stage build to keep the image size
down (#2582)

## 21.9b0

Expand Down
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM python:3-slim
FROM python:3-slim AS builder

RUN mkdir /src
COPY . /src/
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
&& apt update && apt install -y git \
# Install build tools to compile dependencies that don't have prebuilt wheels
&& apt update && apt install -y git build-essential \
&& cd /src \
&& pip install --no-cache-dir .[colorama,d] \
&& rm -rf /src \
&& apt remove -y git \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
&& pip install --user --no-cache-dir .[colorama,d]

FROM python:3-slim

# copy only Python packages to limit the image size
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH

CMD ["black"]

0 comments on commit 87dd4d1

Please sign in to comment.