Skip to content

Commit d8f2f0a

Browse files
committed
v0.3.4, setup.py to pyproject.toml for build
1 parent 09bb151 commit d8f2f0a

File tree

4 files changed

+58
-50
lines changed

4 files changed

+58
-50
lines changed

README.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Version History
175175
======= ============ ===========================================================
176176
Version Release date Changes
177177
------- ------------ -----------------------------------------------------------
178+
v0.3.4 2022-11-17 - Replaces ``setup.py`` with ``pyproject.toml`` for build.
178179
v0.3.3 2022-05-16 - Cope with line-length as string in pyproject.toml config.
179180
v0.3.2 2022-02-25 - Use ``tomli`` library to match black, contribution from
180181
`Brian Helba <https://github.com/brianhelba>`_.
@@ -223,10 +224,15 @@ Developers
223224

224225
This plugin is on GitHub at https://github.com/peterjc/flake8-black
225226

227+
Developers may install the plugin from the git repository with optional build
228+
dependencies::
229+
230+
$ pip install -e .[develop]
231+
226232
To make a new release once tested locally and online::
227233

228234
$ git tag vX.Y.Z
229-
$ python setup.py sdist --formats=gztar && python setup.py bdist_wheel
235+
$ python -m build
230236
$ git push origin master --tags
231237
$ twine upload dist/flake8?black-X.Y.Z*
232238

flake8_black.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from flake8 import LOG
1515

1616

17-
__version__ = "0.3.3"
17+
__version__ = "0.3.4"
1818

1919
black_prefix = "BLK"
2020

@@ -223,7 +223,7 @@ def run(self):
223223
except BadBlackConfig as err:
224224
msg = "997 Invalid TOML file: %s" % err
225225
except Exception as err:
226-
msg = "999 Unexpected exception: %s" % err
226+
msg = "999 Unexpected exception: %r" % err
227227
else:
228228
assert (
229229
new_code != source

pyproject.toml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[build-system]
2+
requires = ['pip>=21.3', 'setuptools>=61', 'wheel']
3+
build-backend = 'setuptools.build_meta'
4+
5+
[project]
6+
name = 'flake8-black'
7+
description = 'flake8 plugin to call black as a code style validator'
8+
keywords = ['black', 'formatting', 'style', 'flake8']
9+
license = {text = 'MIT'}
10+
readme = 'README.rst'
11+
authors = [
12+
{name = 'Peter J. A. Cock'}
13+
]
14+
maintainers = [
15+
{name = 'Peter J. A. Cock', email = '[email protected]'}
16+
]
17+
classifiers = [
18+
'Intended Audience :: Developers',
19+
'Framework :: Flake8',
20+
'License :: OSI Approved :: MIT License',
21+
'Operating System :: OS Independent',
22+
'Topic :: Software Development :: Libraries :: Python Modules',
23+
'Topic :: Software Development :: Quality Assurance',
24+
'Programming Language :: Python',
25+
'Programming Language :: Python :: 3',
26+
'Programming Language :: Python :: 3 :: Only'
27+
]
28+
requires-python = '>=3.7'
29+
dependencies = [
30+
'flake8>=3',
31+
'black>=22.1.0',
32+
'tomli',
33+
]
34+
dynamic = ['version']
35+
[project.entry-points]
36+
'flake8.extension' = {RST = 'flake8_black:BlackStyleChecker'}
37+
[project.optional-dependencies]
38+
develop = ['build', 'twine']
39+
[project.urls]
40+
Homepage = 'https://github.com/peterjc/flake8-black'
41+
'Source Code' = 'https://github.com/peterjc/flake8-black/'
42+
'Bug Tracker' = 'https://github.com/peterjc/flake8-black/issues'
43+
Documentation = 'https://github.com/peterjc/flake8-black/blob/master/README.rst'
44+
45+
[tool.setuptools]
46+
py-modules = ['flake8_black']
47+
zip-safe = true
48+
[tool.setuptools.dynamic]
49+
version = {attr = 'flake8_black.__version__'}

setup.py

-47
This file was deleted.

0 commit comments

Comments
 (0)