Skip to content

Commit 99a1e1e

Browse files
committed
Update build system to use pyproject.toml
1 parent bc75204 commit 99a1e1e

File tree

8 files changed

+56
-68
lines changed

8 files changed

+56
-68
lines changed

.github/workflows/check.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install setuptools
27+
pip install tox
2828
- name: Run Tests
29-
run: python setup.py pytest
29+
run: tox
3030

3131
code-ql:
3232
strategy:

.github/workflows/codecov.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
- name: Generate Coverage Report
1616
run: |
1717
python -m pip install --upgrade pip
18-
pip install coverage setuptools
19-
coverage run --include=src/* setup.py pytest
18+
pip install coverage tox
19+
coverage run --include=src/* tox
2020
- name: Upload Coverage to Codecov
2121
uses: codecov/codecov-action@v5
2222
with:

.github/workflows/publish.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
23+
pip install build twine
2424
- name: Build
25-
run: python setup.py bdist_wheel
25+
run: python -m build
2626
- name: Publish to PyPI
2727
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel", "build"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "flake8-requirements"
7+
# NOTE: Keep in sync with src/flake8_requirements/checker.py file.
8+
version = "2.2.1"
9+
description = "Package requirements checker, plugin for flake8"
10+
readme = "README.rst"
11+
authors = [ { name = "Arkadiusz Bokowy", email = "[email protected]" } ]
12+
requires-python = ">=3.6"
13+
classifiers = [
14+
"Framework :: Flake8",
15+
"Intended Audience :: Developers",
16+
"License :: OSI Approved :: MIT License",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Topic :: Software Development :: Libraries :: Python Modules",
21+
"Topic :: Software Development :: Quality Assurance",
22+
]
23+
dependencies = [
24+
"flake8 >= 4.0.0",
25+
"setuptools >= 10.0.0",
26+
"tomli>=1.2.1; python_version < '3.11'",
27+
]
28+
29+
[project.optional-dependencies]
30+
pyproject = ["Flake8-pyproject"]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/arkq/flake8-requirements"
34+
35+
[project.entry-points."flake8.extension"]
36+
I90 = "flake8_requirements:Flake8Checker"
37+
38+
[tool.doc8]
39+
max-line-length = 99
40+
41+
[tool.isort]
42+
force_single_line = true

setup.cfg

-11
This file was deleted.

setup.py

-50
This file was deleted.

src/flake8_requirements/checker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .modules import KNOWN_3RD_PARTIES
2020
from .modules import STDLIB_PY3
2121

22-
# NOTE: Changing this number will alter package version as well.
22+
# NOTE: Keep in sync with pyproject.toml file.
2323
__version__ = "2.2.1"
2424
__license__ = "MIT"
2525

tox.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tox]
2+
isolated_build = true
3+
envlist = py3
4+
5+
[testenv]
6+
commands = pytest test
7+
deps = pytest

0 commit comments

Comments
 (0)