8000 Merge remote-tracking branch 'upstream/master' into add-format-lines · python-lsp/python-lsp-black@06fb124 · GitHub
[go: up one dir, main page]

Skip to content

Commit 06fb124

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-format-lines
2 parents 526ec12 + 007172c commit 06fb124

File tree

6 files changed

+13
-35
lines changed

6 files changed

+13
-35
lines changed

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.8, 3.9, "3.10", "3.11"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python ${{ matrix.python-version }}

pylsp_black/plugin.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,6 @@ def _load_config(filename: str, client_config: Config) -> Dict:
189189
target_version = set(
190190
black.TargetVersion[x.upper()] for x in file_config["target_version"]
191191
)
192-
elif file_config.get("py36"):
193-
target_version = {
194-
black.TargetVersion.PY36,
195-
black.TargetVersion.PY37,
196-
black.TargetVersion.PY38,
197-
black.TargetVersion.PY39,
198-
black.TargetVersion.PY310,
199-
}
200192
else:
201193
target_version = set()
202194

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.black]
2-
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
2+
target-version = ['py38', 'py39', 'py310', 'py311']
33
exclude = '''
44
/(
55
\.venv

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ install_requires =
2222
python-lsp-server>=1.4.0
2323
black>=23.11.0
2424
tomli; python_version<'3.11'
25-
python_requires = >= 3.7
25+
python_requires = >= 3.8
2626

2727
[options.entry_points]
2828
pylsp = pylsp_black = pylsp_black.plugin

tests/fixtures/py36/pyproject.toml

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

tests/test_plugin.py

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ def config_with_skip_options(workspace):
6161
@pytest.fixture
6262
def unformatted_document(workspace):
6363
path = fixtures_dir / "unformatted.txt"
64-
uri = f"file:/{path}"
64+
uri = f"file:/{path}" # noqa
6565
return Document(uri, workspace)
6666

6767

6868
@pytest.fixture
6969
def unformatted_pyi_document(workspace):
7070
path = fixtures_dir / "unformatted.pyi"
71-
uri = f"file:/{path}"
71+
uri = f"file:/{path}" # noqa
7272
return Document(uri, workspace)
7373

7474

7575
@pytest.fixture
7676
def unformatted_crlf_document(workspace):
7777
path = fixtures_dir / "unformatted-crlf.py"
78-
uri = f"file:/{path}"
78+
uri = f"file:/{path}" # noqa
7979
with open(path, "r", newline="") as f:
8080
source = f.read()
8181
return Document(uri, workspace, source=source)
@@ -84,21 +84,21 @@ def unformatted_crlf_document(workspace):
8484
@pytest.fixture
8585
def formatted_document(workspace):
8686
path = fixtures_dir / "formatted.txt"
87-
uri = f"file:/{path}"
87+
uri = f"file:/{path}" # noqa
8888
return Document(uri, workspace)
8989

9090

9191
@pytest.fixture
9292
def formatted_pyi_document(workspace):
9393
path = fixtures_dir / "formatted.pyi"
94-
uri = f"file:/{path}"
94+
uri = f"file:/{path}" # noqa
9595
return Document(uri, workspace)
9696

9797

9898
@pytest.fixture
9999
def formatted_crlf_document(workspace):
100100
path = fixtures_dir / "formatted-crlf.py"
101-
uri = f"file:/{path}"
101+
uri = f"file:/{path}" # noqa
102102
with open(path, "r", newline="") as f:
103103
source = f.read()
104104
return Document(uri, workspace, source=source)
@@ -107,28 +107,28 @@ def formatted_crlf_document(workspace):
107107
@pytest.fixture
108108
def invalid_document(workspace):
109109
path = fixtures_dir / "invalid.txt"
110-
uri = f"file:/{path}"
110+
uri = f"file:/{path}" # noqa
111111
return Document(uri, workspace)
112112

113113

114114
@pytest.fixture
115115
def config_document(workspace):
116116
path = fixtures_dir / "config" / "config.txt"
117-
uri = f"file:/{path}"
117+
uri = f"file:/{path}" # noqa
118118
return Document(uri, workspace)
119119

120120

121121
@pytest.fixture
122122
def unformatted_line_length(workspace):
123123
path = fixtures_dir / "unformatted-line-length.py"
124-
uri = f"file:/{path}"
124+
uri = f"file:/{path}" # noqa
125125
return Document(uri, workspace)
126126

127127

128128
@pytest.fixture
129129
def formatted_line_length(workspace):
130130
path = fixtures_dir / "formatted-line-length.py"
131-
uri = f"file:/{ BDA6 path}"
131+
uri = f"file:/{path}" # noqa
132132
return Document(uri, workspace)
133133

134134

@@ -275,18 +275,6 @@ def test_load_config_target_version(config):
275275
assert config["target_version"] == {black.TargetVersion.PY39}
276276

277277

278-
def test_load_config_py36(config):
279-
config = load_config(str(fixtures_dir / "py36" / "example.py"), config)
280-
281-
assert config["target_version"] == {
282-
black.TargetVersion.PY36,
283-
black.TargetVersion.PY37,
284-
black.TargetVersion.PY38,
285-
black.TargetVersion.PY39,
286-
black.TargetVersion.PY310,
287-
}
288-
289-
290278
def test_load_config_defaults(config):
291279
config = load_config(str(fixtures_dir / "example.py"), config)
292280

0 commit comments

Comments
 (0)
0