Skip to content

Commit

Permalink
Modernize: use pyproject.toml
Browse files Browse the repository at this point in the history
 * Moving as much config as possible to `pyproject.toml`.
 * Migrating project to use `src` layout.
  • Loading branch information
robsdedude committed Sep 18, 2023
1 parent 6744556 commit f7fae44
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
- id: mypy
name: mypy static type check
entry: mypy
args: [ --show-error-codes, flake8_picky_parentheses, tests ]
args: [ --show-error-codes, src, tests ]
'types_or': [ python, pyi ]
language: system
pass_filenames: false
Expand Down
72 changes: 72 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[project]
name = "flake8-picky-parentheses"
description = "flake8 plugin to nitpick about parenthesis, brackets, and braces"
authors = [
{ name = "Ivan Prychantovskyi" },
{ name = "Rouven Bauer" },
]
readme = "README.md"
dependencies = [
"flake8~=3.7",
]
requires-python = ">=3.7"
classifiers = [
"Framework :: Flake8",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
]
keywords = [
"flake8",
"plugin",
"redundant",
"superfluous",
"extraneous",
"unnecessary",
"parentheses",
"parenthesis",
"parens",
"brackets",
"linter",
"linting",
"codestyle",
"code style",
]
license = {text = "Apache License 2.0"}
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/robsdedude/flake8-picky-parentheses"
"Issue Tracker" = "https://github.com/robsdedude/flake8-picky-parentheses/issues"
"Source Code" = "https://github.com/robsdedude/flake8-picky-parentheses"
"Changelog" = "https://github.com/robsdedude/flake8-picky-parentheses/blob/master/CHANGELOG.md"

[project.entry-points."flake8.extension"]
"PAR0" = "flake8_picky_parentheses:PluginRedundantParentheses"
"PAR1" = "flake8_picky_parentheses:PluginBracketsPosition"

[build-system]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = { attr = "flake8_picky_parentheses.__version__" }

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 2
use_parentheses = true
ensure_newline_before_comments = true
order_by_type = false
remove_redundant_aliases = true
force_sort_within_sections = true
12 changes: 2 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
[isort]
multi_line_output=3
include_trailing_comma=true
force_grid_wrap=2
use_parentheses=true
ensure_newline_before_comments=true
order_by_type=false
remove_redundant_aliases=true
force_sort_within_sections=true

# flake8 not supporting pyproject.toml
# https://github.com/PyCQA/flake8/issues/234
[flake8]
inline-quotes=double
ignore=D100,D101,D102,D103,D104,D105,D106,D107,W503
Expand Down
57 changes: 1 addition & 56 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,4 @@

from setuptools import setup

from flake8_picky_parentheses import __version__ as version

with open("README.md", "r") as fd:
long_description = fd.read()


install_requires = [
"flake8>=3.7",
]

github_project_url = "https://github.com/robsdedude/flake8-picky-parentheses"

setup(
name="flake8-picky-parentheses",
version=version,
description="flake8 plugin to nitpick about parenthesis, brackets, "
"and braces",
long_description=long_description,
long_description_content_type="text/markdown",
author="Ivan Prychantovskyi, Rouven Bauer",
url=github_project_url,
project_urls={
"Issue Tracker": f"{github_project_url}/issues",
"Source Code": github_project_url,
"Changelog": f"{github_project_url}/blob/master/CHANGELOG.md",
},
download_url="https://pypi.python.org/pypi/flake8-picky-parentheses",
packages=["flake8_picky_parentheses"],
entry_points={
"flake8.extension": [
"PAR0 = flake8_picky_parentheses:PluginRedundantParentheses",
"PAR1 = flake8_picky_parentheses:PluginBracketsPosition"
],
},
classifiers=[
"Framework :: Flake8",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
],
license="Apache License 2.0",
keywords="flake8, plugin, redundant, superfluous, extraneous, "
"unnecessary, parentheses, parenthesis, parens, brackets, "
"linter, linting, codestyle, code style",
install_requires=install_requires,
python_requires=">=3.7",
)
setup()
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[tox]
envlist = py37,py38,py39,py310
envlist = py37,py38,py39,py310,py311

[testenv]
# install pytest in the virtualenv where commands will be executed
deps = pytest
commands =
# NOTE: you can run any command line tool here - not just tests
pytest tests/test_redundant_parentheses.py
pytest tests/test_brackets_position.py
pytest tests

0 comments on commit f7fae44

Please sign in to comment.