Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert setup.py to pyproject.toml #1592

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
pip install -e .[lint]
- name: mypy 3.7
run: |
mypy --python-version 3.7 .
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
pip install -e .[lint]
- name: Code Format Check with Black
run: |
black --check --verbose .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
pip install -e .[lint]
- name: Code Format Check with Black
run: |
black --verbose .
Expand Down
6 changes: 3 additions & 3 deletions can/interfaces/ixxat/canlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
tseg1_dbr: int = None,
tseg2_dbr: int = None,
ssp_dbr: int = None,
**kwargs
**kwargs,
):
"""
:param channel:
Expand Down Expand Up @@ -116,7 +116,7 @@ def __init__(
tseg1_dbr=tseg1_dbr,
tseg2_dbr=tseg2_dbr,
ssp_dbr=ssp_dbr,
**kwargs
**kwargs,
)
else:
if rx_fifo_size is None:
Expand All @@ -132,7 +132,7 @@ def __init__(
rx_fifo_size=rx_fifo_size,
tx_fifo_size=tx_fifo_size,
bitrate=bitrate,
**kwargs
**kwargs,
)

super().__init__(channel=channel, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion can/interfaces/seeedstudio/seeedstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
operation_mode="normal",
bitrate=500000,
*args,
**kwargs
**kwargs,
):
"""
:param str channel:
Expand Down
2 changes: 1 addition & 1 deletion can/io/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
self,
file: Optional[Union[StringPathLike, TextIO]] = None,
append: bool = False,
**kwargs: Any
**kwargs: Any,
) -> None:
"""
:param file: An optional path-like object or a file-like object to "print"
Expand Down
143 changes: 133 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,142 @@
[build-system]
requires = [
"setuptools >= 40.8",
"wheel",
]
requires = ["setuptools >= 67.7.2"]
build-backend = "setuptools.build_meta"

[project]
name = "python-can"
dynamic = ["readme", "version"]
description = "Controller Area Network interface module for Python"
authors = [{ name = "python-can contributors" }]
dependencies = [
"wrapt~=1.10",
"packaging >= 23.1",
"setuptools >= 67.7.2",
"typing_extensions>=3.10.0.0",
"msgpack~=1.0.0; platform_system != 'Windows'",
"pywin32>=305; platform_system == 'Windows' and platform_python_implementation == 'CPython'",
]
requires-python = ">=3.7"
license = { text = "LGPL v3" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Manufacturing",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Natural Language :: English",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
Tbruno25 marked this conversation as resolved.
Show resolved Hide resolved
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: System :: Hardware :: Hardware Drivers",
"Topic :: System :: Logging",
"Topic :: System :: Monitoring",
"Topic :: System :: Networking",
"Topic :: Utilities",
]

[project.scripts]
"can_logconvert.py" = "scripts.can_logconvert:main"
"can_logger.py" = "scripts.can_logger:main"
"can_player.py" = "scripts.can_player:main"
"can_viewer.py" = "scripts.can_viewer:main"

[project.urls]
homepage = "https://github.com/hardbyte/python-can"
documentation = "https://python-can.readthedocs.io"
repository = "https://github.com/hardbyte/python-can"
changelog = "https://github.com/hardbyte/python-can/blob/develop/CHANGELOG.md"

[project.optional-dependencies]
lint = [
"pylint==2.16.4",
"ruff==0.0.260",
"black~=23.1.0",
"mypy==1.0.1",
"mypy-extensions==0.4.3",
"types-setuptools"
]
seeedstudio = ["pyserial>=3.0"]
serial = ["pyserial~=3.0"]
neovi = ["filelock", "python-ics>=2.12"]
canalystii = ["canalystii>=0.1.0"]
cantact = ["cantact>=0.0.7"]
cvector = ["python-can-cvector"]
gs_usb = ["gs_usb>=0.2.1"]
nixnet = ["nixnet>=0.3.2"]
pcan = ["uptime~=3.0.1"]
remote = ["python-can-remote"]
sontheim = ["python-can-sontheim>=0.1.2"]
canine = ["python-can-canine>=0.2.2"]
viewer = [
"windows-curses; platform_system == 'Windows' and platform_python_implementation=='CPython'"
]
mf4 = ["asammdf>=6.0.0"]

[tool.setuptools.dynamic]
readme = { file = "README.rst" }
version = { attr = "can.__version__" }

[tool.setuptools.package-data]
"*" = ["README.rst", "CONTRIBUTORS.txt", "LICENSE.txt", "CHANGELOG.md"]
doc = ["*.*"]
examples = ["*.py"]
can = ["py.typed"]

[tool.setuptools.packages.find]
include = ["can*", "scripts"]

[tool.mypy]
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
no_implicit_optional = true
disallow_incomplete_defs = true
warn_redundant_casts = true
warn_unused_ignores = false
exclude = [
"venv",
"^doc/conf.py$",
"^build",
"^test",
"^setup.py$",
"^can/interfaces/__init__.py",
"^can/interfaces/etas",
"^can/interfaces/gs_usb",
"^can/interfaces/ics_neovi",
"^can/interfaces/iscan",
"^can/interfaces/ixxat",
"^can/interfaces/kvaser",
"^can/interfaces/nican",
"^can/interfaces/neousys",
"^can/interfaces/pcan",
"^can/interfaces/serial",
"^can/interfaces/slcan",
"^can/interfaces/socketcan",
"^can/interfaces/systec",
"^can/interfaces/udp_multicast",
"^can/interfaces/usb2can",
"^can/interfaces/virtual",
]

[tool.ruff]
select = [
"F401", # unused-imports
"UP", # pyupgrade
"I", # isort
]
"F401", # unused-imports
"UP", # pyupgrade
"I", # isort

# Assume Python 3.7.
target-version = "py37"
]

[tool.ruff.isort]
known-first-party = ["can"]
6 changes: 0 additions & 6 deletions requirements-lint.txt

This file was deleted.

35 changes: 0 additions & 35 deletions setup.cfg

This file was deleted.

104 changes: 0 additions & 104 deletions setup.py

This file was deleted.