Skip to content

Commit cc853c3

Browse files
authored
PR: Update code structure and build files to modern standards (#529)
2 parents 89674f6 + 55bdd59 commit cc853c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+109
-195
lines changed

.coveragerc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[run]
22
omit =
33
# Omit tests
4-
*/tests/*
4+
*tests/*
55
# Omit other files
66
*/__init__.py
77
*/compat.py
8-
*/_version.py

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ repos:
2626
exclude: .*\.md
2727
- id: debug-statements
2828
- id: mixed-line-ending
29-
- repo: https://github.com/asottile/setup-cfg-fmt
30-
rev: v2.5.0
31-
hooks:
32-
- id: setup-cfg-fmt
33-
args: ["--include-version-classifiers", "--max-py-version", "3.13", "--min-py-version", "3.9"]
3429

3530
ci:
3631
autoupdate_schedule: monthly

MANIFEST.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
include AUTHORS*
2-
include CHANGELOG*
3-
include LICENSE*
4-
include README*
5-
include SECURITY*
1+
include CHANGELOG.md
2+
include SECURITY.md
63
include pytest.ini
7-
recursive-include qtpy/tests *.py *.ui
8-
include qtpy/py.typed
4+
recursive-include tests *.py *.ui

pyproject.toml

Lines changed: 65 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,64 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
]
2+
requires = ["setuptools>=42"]
53
build-backend = "setuptools.build_meta"
64

5+
[project]
6+
name = "QtPy"
7+
dynamic = ["version"]
8+
description = "Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6)."
9+
readme = "README.md"
10+
requires-python = ">=3.9"
11+
authors = [
12+
{ name = "Colin Duquesnoy and the Spyder Development Team", email = "spyder.python@gmail.com" }
13+
]
14+
maintainers = [
15+
{ name = "Spyder Development Team and QtPy Contributors", email = "spyder.python@gmail.com" }
16+
]
17+
license = "MIT"
18+
keywords = ["qt", "PyQt5", "PyQt6", "PySide2", "PySide6"]
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: MacOS X",
22+
"Environment :: Win32 (MS Windows)",
23+
"Environment :: X11 Applications :: Qt",
24+
"Intended Audience :: Developers",
25+
"Operating System :: OS Independent",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3 :: Only",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Topic :: Software Development :: Libraries",
34+
"Topic :: Software Development :: User Interfaces",
35+
"Topic :: Software Development :: Widget Sets",
36+
]
37+
dependencies = ["packaging"]
38+
39+
[project.urls]
40+
"Github" = "https://github.com/spyder-ide/qtpy"
41+
"Bug Tracker" = "https://github.com/spyder-ide/qtpy/issues"
42+
"Parent Project" = "https://www.spyder-ide.org/"
43+
44+
[project.optional-dependencies]
45+
test = [
46+
"pytest>=6,!=7.0.0,!=7.0.1",
47+
"pytest-cov>=3.0.0",
48+
"pytest-qt",
49+
]
50+
51+
[project.scripts]
52+
qtpy = "qtpy.__main__:main"
53+
54+
[tool.setuptools.dynamic]
55+
version = { attr = "qtpy.__version__" }
56+
57+
[tool.setuptools.packages.find]
58+
include = ["qtpy"]
59+
60+
[tool.setuptools.package-data]
61+
qtpy = ["py.typed"]
762

863
[tool.black]
964
target-version = ['py39', 'py310', 'py311', 'py312']
@@ -31,11 +86,13 @@ exclude = '''
3186
)
3287
'''
3388

34-
3589
[tool.ruff]
3690
line-length = 79
91+
target-version = "py39"
92+
93+
[tool.ruff.lint]
3794
select = [
38-
"E", "F", "W", #flake8
95+
"E", "F", "W", # flake8
3996
"UP", # pyupgrade
4097
"I", # isort
4198
"YTT", #flake8-2020
@@ -54,45 +111,19 @@ select = [
54111
"Q", # flake8-quotes
55112
"RSE", # flake8-raise
56113
"RET", # flake8-return
57-
"TID", # flake8-tidy-imports # replace absolutify import
114+
"TID", # flake8-tidy-imports, replace absolutify import
58115
"TRY", # tryceratops
59116
"ICN", # flake8-import-conventions
60117
"RUF", # ruff specyfic rules
61118
]
62119
ignore = [
63-
"F403", # star impoert
120+
"F403", # star import
64121
"E501", # line too long - black will handle it
65122
"F405", # star import
66123
"F401", # unused import - cannot determine wole list of symbols to export and use in __all__
67124
]
68125

69-
exclude = [
70-
".bzr",
71-
".direnv",
72-
".eggs",
73-
".git",
74-
".mypy_cache",
75-
".pants.d",
76-
".ruff_cache",
77-
".svn",
78-
".tox",
79-
".venv",
80-
"__pypackages__",
81-
"_build",
82-
"buck-out",
83-
"build",
84-
"dist",
85-
"node_modules",
86-
"venv",
87-
"*vendored*",
88-
"*_vendor*",
89-
]
90-
91-
target-version = "py39"
92-
fix = true
93-
94-
95-
[tool.ruff.per-file-ignores]
126+
[tool.ruff.lint.per-file-ignores]
96127
"qtpy/QtCore.py" = ["F821"]
97128
"qtpy/__init__.py" = ["TRY003", "F811"]
98129
"qtpy/uic.py" = ["TRY003"]

pytest.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ filterwarnings =
77
log_auto_indent = True
88
log_level = INFO
99
minversion = 6.0
10-
testpaths =
11-
qtpy/tests
10+
testpaths = tests
1211
xfail_strict = True

setup.cfg

Lines changed: 0 additions & 62 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)