Skip to content

Commit 5bae5ef

Browse files
committed
Drop support for Python 2, replace setup.cfg with pyproject.toml
1 parent cf00a6a commit 5bae5ef

File tree

9 files changed

+134
-152
lines changed

9 files changed

+134
-152
lines changed

.github/workflows/static-analysis-and-test.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install tox
30+
python -m pip install tox coverage[toml]
3131
3232
- name: Lint with flake8
3333
run: tox -e flake8
3434

3535
- name: Format with black
3636
run: tox -e black
3737

38-
- name: Py 2 and 3 compatibility
39-
run: tox -e modernize
40-
4138

4239
test:
4340
# We want to run on external PRs, but not on our own internal PRs as they'll
@@ -49,9 +46,9 @@ jobs:
4946

5047
strategy:
5148
matrix:
52-
os: ['ubuntu-latest']
49+
os: ['ubuntu-latest', 'windows-latest']
5350
python: ['3.8', '3.9', '3.10', '3.11']
54-
# Works around the depreciation of python 3.6, 3.7 for ubuntu
51+
# Works around the depreciation of python 3.7 for ubuntu
5552
# https://github.com/actions/setup-python/issues/544
5653
include:
5754
- os: 'ubuntu-22.04'
@@ -85,7 +82,6 @@ jobs:
8582
include-hidden-files: true
8683
retention-days: 1
8784

88-
8985
coverage:
9086
# We want to run on external PRs, but not on our own internal PRs as they'll
9187
# be run by the push to the branch. Without this if check, checks are

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
ci:
3+
autoupdate_schedule: quarterly
4+
skip: [black, flake8]
5+
26
repos:
37

48
- repo: https://github.com/psf/black
@@ -12,14 +16,9 @@ repos:
1216
- id: flake8
1317
additional_dependencies:
1418
- flake8-bugbear==22.12.6
19+
- Flake8-pyproject
1520
- pep8-naming==0.13.3
1621

17-
- repo: https://github.com/asottile/setup-cfg-fmt
18-
rev: v2.2.0
19-
hooks:
20-
- id: setup-cfg-fmt
21-
args: [--min-py3-version=3.6]
22-
2322
- repo: https://github.com/pre-commit/pre-commit-hooks
2423
rev: v4.4.0
2524
hooks:

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ A set of GitHub Action workflows are in place to perform the following style and
5656

5757
**Styling**
5858

59-
Styling or linting is performed via [flake8] along with the plugins [flake8-bugbear] & [pep8-naming]. A minor amount of configuration has been added to _[setup.cfg]_ in order to provide better compatibility with our formatter black (see next section).
59+
Styling or linting is performed via [flake8] along with the plugins [flake8-bugbear], [Flake8-pyproject] & [pep8-naming]. A minor amount of configuration has been added to _[pyproject.toml]_ in order to provide better compatibility with our formatter black (see next section).
6060

6161
**Formatting**
6262

@@ -69,8 +69,9 @@ Releases are made manually by project managers and will automatically be uploade
6969

7070
[flake8]: https://github.com/PyCQA/flake8
7171
[flake8-bugbear]: https://github.com/PyCQA/flake8-bugbear
72+
[Flake8-pyproject]: https://github.com/john-hen/Flake8-pyproject
7273
[pep8-naming]: https://github.com/PyCQA/pep8-naming
73-
[setup.cfg]: https://github.com/blurstudio/preditor/blob/master/setup.cfg
74+
[pyproject.toml]: https://github.com/blurstudio/hab/blob/master/pyproject.toml
7475
[black]: https://github.com/psf/black
7576
[Issues]: https://github.com/blurstudio/preditor/issues
7677
[create a new issue]: https://github.com/blurstudio/preditor/issues/new

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ The more mature QScintilla workbox requires a few extra dependencies that must
128128
be passed manually. It hasn't been added to `extras_require` because we plan to
129129
split it into its own pip module due to it requiring PyQt5 which is a little hard
130130
to get working inside of DCC's that ship with PySide2 by default. Here is the
131-
python 3 pip install command(For python 2 you will need to compile QScintilla
132-
yourself.)
131+
python 3 pip install command.
133132

134133
- `pip install preditor PyQt5, QScintilla>=2.11.4 aspell-python-py3`
135134

pyproject.toml

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,128 @@
11
[build-system]
22
requires = [
33
"setuptools >= 44.1.1",
4-
"setuptools_scm[toml] >= 4, <6",
4+
"setuptools_scm[toml] >= 4",
55
"wheel >= 0.36",
66
]
77
build-backend = "setuptools.build_meta"
88

9+
[project]
10+
name = "PrEditor"
11+
description = "A python REPL and Editor and console based on Qt."
12+
authors = [{name = "Blur Studio", email = "[email protected]"}]
13+
license = {text = "LGPL-3.0"}
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Developers",
17+
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: Implementation :: CPython",
22+
"Programming Language :: Python :: Implementation :: PyPy",
23+
]
24+
requires-python = ">=3.7"
25+
dependencies = [
26+
"Qt.py",
27+
"configparser>=4.0.2",
28+
"future>=0.18.2",
29+
"signalslot>=0.1.2",
30+
"importlib-metadata>=4.8.3",
31+
]
32+
dynamic = ["version"]
33+
34+
[project.readme]
35+
file = "README.md"
36+
content-type = "text/markdown"
37+
38+
[project.urls]
39+
Homepage = "https://github.com/blurstudio/PrEditor"
40+
Source = "https://github.com/blurstudio/PrEditor"
41+
Tracker = "https://github.com/blurstudio/PrEditor/issues"
42+
43+
[project.optional-dependencies]
44+
cli =[
45+
"click>=7.1.2",
46+
"click-default-group",
47+
]
48+
dev =[
49+
"black",
50+
"build",
51+
"covdefaults",
52+
"coverage",
53+
"flake8",
54+
"flake8-bugbear",
55+
"Flake8-pyproject",
56+
"pep8-naming",
57+
"pytest",
58+
"tox",
59+
]
60+
shortcut =[
61+
"casement>=0.1.0;platform_system=='Windows'",
62+
]
63+
64+
[project.scripts]
65+
preditor = "preditor.cli:cli"
66+
67+
[project.gui-scripts]
68+
preditorw = "preditor.cli:cli"
69+
70+
[project.entry-points."preditor.plug.about_module"]
71+
PrEditor = "preditor.about_module:AboutPreditor"
72+
Qt = "preditor.about_module:AboutQt"
73+
Python = "preditor.about_module:AboutPython"
74+
Exe = "preditor.about_module:AboutExe"
75+
76+
[project.entry-points."preditor.plug.editors"]
77+
TextEdit = "preditor.gui.workbox_text_edit:WorkboxTextEdit"
78+
QScintilla = "preditor.gui.workboxwidget:WorkboxWidget"
79+
80+
[project.entry-points."preditor.plug.logging_handlers"]
81+
PrEditor = "preditor.gui.logger_window_handler:LoggerWindowHandler"
82+
83+
84+
[tool.setuptools]
85+
include-package-data = true
86+
platforms = ["any"]
87+
license-files = ["LICENSE"]
88+
89+
[tool.setuptools.packages.find]
90+
exclude = ["tests"]
91+
namespaces = false
92+
993
[tool.setuptools_scm]
1094
write_to = "preditor/version.py"
1195
version_scheme = "release-branch-semver"
1296

97+
[tool.flake8]
98+
select = ["B", "C", "E", "F", "N", "W", "B9"]
99+
extend-ignore = [
100+
"E203",
101+
"E501",
102+
"E722",
103+
"N802",
104+
"N803",
105+
"N806",
106+
"N815",
107+
"N816",
108+
"W503",
109+
]
110+
max-line-length = "80"
111+
exclude = [
112+
"*.egg-info",
113+
"*.pyc",
114+
".cache",
115+
".eggs",
116+
".git",
117+
".tox",
118+
"__pycache__",
119+
"build",
120+
"dist",
121+
"docs",
122+
"shared-venv",
123+
]
124+
125+
13126
[tool.black]
14127
skip-string-normalization = true
15128

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
build
12
configparser>=4.0.2
23
future>=0.18.2
3-
importlib-metadata>=4.8.3;python_version>="3.6"
4+
importlib-metadata>=4.8.3
45
Qt.py
56
signalslot>=0.1.2

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)