Skip to content

Commit

Permalink
Update build system to use pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Jan 13, 2025
1 parent bc75204 commit 99a1e1e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install tox
- name: Run Tests
run: python setup.py pytest
run: tox

code-ql:
strategy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Generate Coverage Report
run: |
python -m pip install --upgrade pip
pip install coverage setuptools
coverage run --include=src/* setup.py pytest
pip install coverage tox
coverage run --include=src/* tox
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
- name: Build
run: python setup.py bdist_wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[build-system]
requires = ["setuptools>=61.0", "wheel", "build"]
build-backend = "setuptools.build_meta"

[project]
name = "flake8-requirements"
# NOTE: Keep in sync with src/flake8_requirements/checker.py file.
version = "2.2.1"
description = "Package requirements checker, plugin for flake8"
readme = "README.rst"
authors = [ { name = "Arkadiusz Bokowy", email = "[email protected]" } ]
requires-python = ">=3.6"
classifiers = [
"Framework :: Flake8",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
]
dependencies = [
"flake8 >= 4.0.0",
"setuptools >= 10.0.0",
"tomli>=1.2.1; python_version < '3.11'",
]

[project.optional-dependencies]
pyproject = ["Flake8-pyproject"]

[project.urls]
Homepage = "https://github.com/arkq/flake8-requirements"

[project.entry-points."flake8.extension"]
I90 = "flake8_requirements:Flake8Checker"

[tool.doc8]
max-line-length = 99

[tool.isort]
force_single_line = true
11 changes: 0 additions & 11 deletions setup.cfg

This file was deleted.

50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/flake8_requirements/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .modules import KNOWN_3RD_PARTIES
from .modules import STDLIB_PY3

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

Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tox]
isolated_build = true
envlist = py3

[testenv]
commands = pytest test
deps = pytest

0 comments on commit 99a1e1e

Please sign in to comment.