Commit Graph

85 Commits

Author SHA1 Message Date
Tushar Sadhwani
5342d2eeda
Replace the blib2to3 tokenizer with pytokens (#4536) 2025-03-15 17:41:19 -07:00
sobolevn
256f3420b1
Add --local-partial-types and --strict-bytes to mypy (#4583) 2025-02-20 15:27:23 -08:00
Jelle Zijlstra
b844c8a136
unhack pyproject.toml (#4566) 2025-01-28 21:54:46 -08:00
Jelle Zijlstra
d82da0f0e9
Fix hatch build (#4565) 2025-01-28 20:52:03 -08:00
Shantanu
f54f34799b
Use released mypy (#4490) 2024-10-19 18:01:05 -07:00
Marc Mueller
9995bffbe4
Store license identifier inside the License-Expression metadata field (#4479) 2024-10-11 14:40:49 -07:00
Shantanu
a22b1ebbfd
Add mypyc 3.13 wheel build (#4449) 2024-10-07 07:32:53 -07:00
Shantanu
b4d6d8632d
Drop Python 3.8 support (#4452) 2024-09-15 18:21:21 -07:00
Shantanu
ac018c16ca
Require newer aiohttp for blackd (#4451) 2024-09-15 18:05:23 -07:00
Shantanu
26aeebe9fb
Update mypy/c (#4450) 2024-09-07 17:32:47 -07:00
Ewout ter Hoeven
ac28187bf4
Fully support Python 3.13, including CI testing and wheel building (#4436) 2024-08-26 10:07:54 -07:00
Shantanu
9ff047a957
Fix wheel build by using newer manylinux image (#4394) 2024-07-04 16:40:28 -07:00
Jelle Zijlstra
c801cd60b1
Format docs/ and scripts/ in CI (#4348) 2024-05-04 13:26:36 -07:00
Michael R. Crusoe
75eb55764e
packaging metadata: link to the docs, issue tracker (#4345)
See https://github.com/pypi/warehouse/issues/5947
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#urls
2024-05-03 06:51:33 -07:00
Henry Schreiner
2bc5ce8ae1
feat: add schema and validate-pyproject support (#4181)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-01-29 07:56:48 -08:00
Jelle Zijlstra
4f47cac192
Add --unstable flag (#4096) 2024-01-25 17:00:47 -08:00
Bryce Willey
8fec1c3085
Adds paren to deps for hidden extra constraint (#4108)
Fix #4107
2023-12-14 00:28:28 -08:00
Alex Waygood
a0e270d0f2
Build mypycified wheels for Python 3.12 (#4070) 2023-11-24 10:05:59 -08:00
Alex Waygood
69d49c5a6f
Bump mypy to 1.7.1 (#4069) 2023-11-24 06:19:54 -08:00
Cooper Lees
80a166f2e1
Make black[d] install + test run with 3.12 (#4035)
* Make black[d] install + test run with 3.12

- With aiohttp >= 3.9.0 we can now install all dependencies with 3.12
- Add actions to run 3.12
- Lint still needs to be 3.11

Test:
- `python3.12 -m venv /tmp/tb --upgrade-deps`
- `/tmp/tb/bin/pip install tox`
- `/tmp/tb/bin/pip install .[d]`
- `/tmp/tb/bin/tox -e py312`
```
  py312: OK (37.61=setup[3.98]+cmd[3.83,0.36,19.54,6.46,3.00,0.44] seconds)
  congratulations :) (37.63 seconds)
```

* Move to pypy-3.9

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-18 12:09:55 -08:00
Alex Waygood
d93a942a79
Upgrade mypy to 1.6.1 (#4049) 2023-11-18 11:42:36 -08:00
Alex Waygood
85b1c71a34
Block aiohttp==3.9.0 from being installed in CI on Windows/pypy (#4051) 2023-11-18 11:15:07 -08:00
Shantanu
9e3daa1107
Fix arm wheels on macOS (#4017) 2023-11-05 18:29:37 -08:00
Ran Benita
448324637d
Enable branch coverage (#4022)
When trying to understand the code logic, and looking at coverage
reports, branch coverage is very helpful.
2023-11-04 13:49:12 -07:00
Charles Patel
6f84f65285
Migrate mypy config to pyproject.toml (#3936)
Co-authored-by: Charles Patel <charles.patel@apkudo.com>
2023-10-16 05:24:16 -07:00
Shantanu
004fb79706
mypyc build improvements (#3881)
Build in separate jobs. This makes it clearer if e.g. a single Python
version is failing. It also potentially gets you more parallelism.

Build everything on push to master.

Only build Linux 3.8 and 3.11 wheels on PRs.
2023-09-11 13:36:37 -07:00
Shantanu
62dca32dc5
mypyc builds on PRs, skip mypyc wheels for 3.12 (#3870)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-10 16:47:08 -07:00
Jelle Zijlstra
0b62b9c9a4
Ignore aiohttp DeprecationWarning for 3.12 (#3876)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-09-10 15:45:13 -07:00
Shantanu
4e93f2aa01
Add classifier for 3.12 (#3866) 2023-09-08 22:16:25 -07:00
Jelle Zijlstra
716fa08090
Upgrade mypy (#3864) 2023-09-08 22:16:15 -07:00
Johnny.H
58f1bf69d2
Move coverage configurations to pyproject.toml (#3858) 2023-09-02 22:46:23 -04:00
Marc Mueller
c6a031e623
Improve caching by comparing file hashes as fallback for mtime and size (#3821)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-08-18 19:26:36 -07:00
Shantanu
c1e30d97fe
Fix most blib2to3 lint (#3794) 2023-07-16 21:33:58 -07:00
Nicola Soranzo
027afda403
Remove Python 3.7 from classifiers (#3784)
Follow-up on https://github.com/psf/black/pull/3765
2023-07-11 07:21:15 -07:00
Shantanu
4130c65578
Fix CI for Click typing issue (#3770)
https://github.com/pallets/click/issues/2558
2023-07-09 08:14:38 -07:00
Shantanu
b4dca26c7d
Drop support for Python 3.7 (#3765) 2023-07-05 10:08:04 -07:00
Stian Jensen
c732a1f13a
Build with mypyc 1.3 (#3697)
Several new versions of mypyc has been released since the last upgrade, and they include some performance improvements which could make the compiled version of Black run faster.

https://mypy-lang.org/news.html

The latest version of hatch-mypyc allows being installed next the 1.x series of mypy.
2023-06-22 21:22:28 -07:00
Jelle Zijlstra
3aad6e385b
Add support for PEP 695 syntax (#3703) 2023-06-01 18:37:08 -07:00
Stijn de Gooijer
69ca0a4c7a
Infer target version based on project metadata (#3219)
Co-authored-by: Richard Si <sichard26@gmail.com>
2023-01-31 18:00:17 -08:00
Jelle Zijlstra
cd9fef8bab
tomli: Don't worry about specific alpha releases (#3448)
This prevents bugs due to pypa/packaging#522.

Fixes #3447.
2022-12-17 19:02:01 -08:00
Richard Si
80de2372e4
Bump mypy[c] from 0.971 to 0.991 (#3380) 2022-12-10 12:56:34 -08:00
Amethyst Reese
d923945513
Fix license metadata to follow PEP 621 (#3326) 2022-10-11 10:54:49 +11:00
Richard Si
141291a1d8
Enable build isolation under CIWB (#3297)
No idea how this is still here after the Hatchling PR, but it is no
longer useful and is breaking the build.
2022-09-28 22:56:28 -04:00
Richard Si
2189bcaac0
Fix outdated references to 3.6 and run pyupgrade (#3286)
I also missed the accidental removal of the 3.11 classifier in the PR.
2022-09-25 17:24:18 -07:00
Ofek Lev
468ceafca5
Switch build backend to Hatchling (#3233)
This implements PEP 621, obviating the need for `setup.py`, `setup.cfg`,
and `MANIFEST.in`. The build backend Hatchling (of which I am a
maintainer in the PyPA) is now used as that is the default in the
official Python packaging tutorial. Hatchling is available on all the
major distribution channels such as Debian, Fedora, and many more.

## Python support

The earliest supported Python 3 version of Hatchling is 3.7, therefore
I've also set that as the minimum here. Python 3.6 is EOL and other
build backends like flit-core and setuptools also dropped support.
Python 3.6 accounted for 3-4% of downloads in the last month.

## Plugins 

Configuration is now completely static with the help of 3 plugins:

### Readme

hynek's hatch-fancy-pypi-readme allows for the dynamic construction of
the readme which was previously coded up in `setup.py`. Now it's simply:

```toml
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
fragments = [
  { path = "README.md" },
  { path = "CHANGES.md" },
]
```

### Versioning

hatch-vcs is currently just a wrapper around setuptools-scm (which
despite the legacy naming is actually now decoupled from setuptools):

```toml
[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/_black_version.py"
template = '''
version = "{version}"
'''
```

### mypyc

hatch-mypyc offers many benefits over the existing approach:

- No need to manually select files for inclusion
- Avoids the need for the current CI workaround for https://github.com/mypyc/mypyc/issues/946
- Intermediate artifacts (like `build/`) from setuptools and mypyc
  itself no longer clutter the project directory
- Runtime dependencies required at build time no longer need to be
  manually redeclared as this is a built-in option of Hatchling

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-09-25 17:54:33 -04:00
Richard Si
75d5c0e3fb
Build mypyc wheels for CPython 3.11 (#3276)
Bumps cibuildwheel from 2.8.1 to 2.10.0 which has 3.11 building enabled
by default. Unfortunately mypyc errors out on 3.11:

src/black/files.py:29:9: error: Name "tomllib" already defined (by an import)  [no-redef]

... so we have to also hide the fallback import of tomli on older 3.11
alphas from mypy[c].
2022-09-22 20:11:56 -07:00
Zsolt Dollenstein
d852af7167
Fix mypyc build errors on newer manylinux2014_x86_64 images (#3272)
Make sure `gcc` is installed in the build env

The mypyc build requires `gcc` to be installed even if it's being built with `clang`, otherwise `clang` fails to find `libgcc`.
2022-09-15 21:08:26 +01:00
Cooper Lees
383b228a16
Move 3.11 tests to install aiohttp without C extensions (#3258)
* Move 311 tests to install aiohttp without C extensions

- Configure tox to install aiohttp without extensions
  - i.e. use `AIOHTTP_NO_EXTENSIONS=1` for pip install
  - This allows us to reenable blackd tests that use aiohttp testing helpers etc.
- Had to ignore `cgi` module deprecation warning
  - Filed issue for aiohttp to fix: https://github.com/aio-libs/aiohttp/issues/6905

Test:
- `/tmp/tb/bin/tox -e 311`

* Fix formatting + linting

* Add latest aiohttp for loop fix + Try to exempt deprecation warning but failed - will ask for help

* Remove unnecessary warning ignore

Co-authored-by: Cooper Ry Lees <me@wcooperlees.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-09-06 08:27:39 +10:00
Richard Si
062e644aae
Mitigate deprecation of aiohttp's @middleware decorator (#3259)
This is deprecated since aiohttp 4.0. If it doesn't exist just define a
no-op decorator that does nothing (after the other aiohttp imports
though!). By doing this, it's safe to ignore the DeprecationWarning
without needing to require the latest aiohttp once they remove
`@middleware`.
2022-09-05 16:27:05 -04:00
Richard Si
e7b967132f
Port & upstream mypyc wheel build workflow (#3197) 2022-08-12 20:33:17 -07:00