Skip to content

Commit f038adf

Browse files
committed
Bump linters, drop 3.6 support
Signed-off-by: Bernát Gábor <[email protected]>
1 parent eb6221a commit f038adf

File tree

9 files changed

+122
-148
lines changed

9 files changed

+122
-148
lines changed

.github/workflows/check.yml

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,49 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
pre-commit:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18-
- uses: pre-commit/[email protected]
19-
2013
test:
2114
name: test ${{ matrix.py }} - ${{ matrix.os }}
22-
runs-on: ${{ matrix.os }}-latest
15+
runs-on: ${{ matrix.os }}
2316
strategy:
2417
fail-fast: false
2518
matrix:
26-
os:
27-
- Ubuntu
28-
- Windows
29-
- MacOs
3019
py:
31-
- 3.10.0-rc.2
32-
- 3.9
33-
- 3.8
34-
- 3.7
35-
- pypy-3.7-v7.3.5
20+
- "3.10"
21+
- "pypy-3.7-v7.3.7" # ahead to start it earlier because takes longer
22+
- "3.9"
23+
- "3.8"
24+
- "3.7"
25+
os:
26+
- ubuntu-20.04
27+
- windows-2022
28+
- macos-10.15
29+
3630
steps:
3731
- name: Setup python for tox
3832
uses: actions/setup-python@v2
3933
with:
40-
python-version: 3.10.0-rc.2
34+
python-version: "3.10"
4135
- name: Install tox
4236
run: python -m pip install tox
4337
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
4440
- name: Setup python for test ${{ matrix.py }}
4541
uses: actions/setup-python@v2
4642
with:
4743
python-version: ${{ matrix.py }}
4844
- name: Pick environment to run
4945
run: |
50-
import subprocess; import json; import os
51-
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
52-
with open(os.environ["GITHUB_ENV"], "a") as file_handler:
53-
file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}{minor}') + "\n")
46+
import codecs
47+
import os
48+
import platform
49+
import sys
50+
cpy = platform.python_implementation() == "CPython"
51+
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
52+
env = "TOXENV={}\n".format(base)
53+
print("Picked:\n{}for{}".format(env, sys.version))
54+
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
55+
file_handler.write(env)
5456
shell: python
5557
- name: Setup test suite
5658
run: tox -vv --notest
@@ -61,47 +63,50 @@ jobs:
6163
CI_RUN: "yes"
6264

6365
check:
64-
name: check ${{ matrix.tox_env }} - ${{ matrix.os }}
65-
runs-on: ${{ matrix.os }}-latest
66+
name: tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
67+
runs-on: ${{ matrix.os }}
6668
strategy:
6769
fail-fast: false
6870
matrix:
6971
os:
70-
- Ubuntu
71-
- Windows
72+
- ubuntu-20.04
73+
- windows-2022
7274
tox_env:
73-
- type
7475
- dev
75-
- pkg_desc
76+
- type
77+
- readme
7678
exclude:
77-
- { os: Windows, tox_env: pkg_desc }
78-
79+
- { os: windows-2022, tox_env: readme }
7980
steps:
8081
- uses: actions/checkout@v2
81-
- name: Setup python
82+
with:
83+
fetch-depth: 0
84+
- name: Setup Python "3.10"
8285
uses: actions/setup-python@v2
8386
with:
84-
python-version: 3.10.0-rc.2
87+
python-version: "3.10"
8588
- name: Install tox
8689
run: python -m pip install tox
87-
- name: Run check for ${{ matrix.tox_env }}
88-
run: python -m tox -e ${{ matrix.tox_env }}
89-
env:
90-
UPGRADE_ADVISORY: "yes"
90+
- name: Setup test suite
91+
run: tox -vv --notest -e ${{ matrix.tox_env }}
92+
- name: Run test suite
93+
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
9194

9295
publish:
9396
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94-
needs: [check, test, pre-commit]
97+
needs: [ check, test ]
9598
runs-on: ubuntu-latest
9699
steps:
97100
- name: Setup python to build package
98101
uses: actions/setup-python@v2
99102
with:
100-
python-version: 3.10.0-rc.2
103+
python-version: "3.10"
101104
- name: Install build
102-
run: python -m pip install 'build>=0.4'
105+
run: python -m pip install build
103106
- uses: actions/checkout@v2
104-
- name: Build package
107+
with:
108+
fetch-depth: 0
109+
- name: Build sdist and wheel
105110
run: python -m build -s -w . -o dist
106111
- name: Publish to PyPi
107112
uses: pypa/gh-action-pypi-publish@master

.pre-commit-config.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
1414
- repo: https://github.com/asottile/pyupgrade
15-
rev: v2.29.1
15+
rev: v2.30.0
1616
hooks:
1717
- id: pyupgrade
18-
args: ["--py37-plus"]
18+
args: [ "--py36-plus" ]
1919
- repo: https://github.com/PyCQA/isort
2020
rev: 5.10.1
2121
hooks:
@@ -24,35 +24,35 @@ repos:
2424
rev: 21.12b0
2525
hooks:
2626
- id: black
27+
args: [ --safe ]
2728
- repo: https://github.com/asottile/blacken-docs
2829
rev: v1.12.0
2930
hooks:
3031
- id: blacken-docs
31-
additional_dependencies: [ black==21.9b0 ]
32+
additional_dependencies: [ black==21.12b0 ]
3233
- repo: https://github.com/pre-commit/pygrep-hooks
3334
rev: v1.9.0
3435
hooks:
3536
- id: rst-backticks
36-
- repo: https://github.com/asottile/setup-cfg-fmt
37-
rev: v1.20.0
38-
hooks:
39-
- id: setup-cfg-fmt
40-
args: [--min-py3-version, "3.6", "--max-py-version", "3.10"]
4137
- repo: https://github.com/tox-dev/tox-ini-fmt
4238
rev: "0.5.1"
4339
hooks:
4440
- id: tox-ini-fmt
45-
args: ["-p", "fix"]
41+
args: [ "-p", "fix" ]
42+
- repo: https://github.com/asottile/setup-cfg-fmt
43+
rev: v1.20.0
44+
hooks:
45+
- id: setup-cfg-fmt
46+
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ]
4647
- repo: https://github.com/PyCQA/flake8
47-
rev: "4.0.1"
48+
rev: 4.0.1
4849
hooks:
4950
- id: flake8
5051
additional_dependencies:
51-
- flake8-bugbear==21.9.2
52-
- flake8-comprehensions==3.6.1
53-
- flake8-pytest-style==1.5
54-
- flake8-spellcheck==0.24
55-
- flake8-unused-arguments==0.0.6
56-
- flake8-noqa==1.1.0
57-
- flake8-eradicate==1.1.0
58-
- pep8-naming==0.12.1
52+
- flake8-bugbear==21.11.29
53+
- flake8-comprehensions==3.7
54+
- flake8-pytest-style==1.6
55+
- flake8-spellcheck==0.24
56+
- flake8-unused-arguments==0.0.9
57+
- flake8-noqa==1.2.1
58+
- pep8-naming==0.12.1

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Changelog
22

3-
## [0.1](https://github.com/gaborbernat/devpi-process/tree/0.1) (2021-06-17)
3+
## 0.2 (2021-12-29)
44

5-
[Full Changelog](https://github.com/gaborbernat/devpi-process/compare/7a3226e048c90b86d7902c373b364a9b16e51a48...0.1)
5+
* Drop 3.6 support and bump linters
6+
* Index URL now ends with `/` to avoid redirect when sending a GET
67

8+
## 0.1 (2021-06-17)
79

8-
9-
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
10+
* First release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/devpi-process?style=flat-square)](https://pypi.org/project/devpi-process)
66
[![PyPI - Downloads](https://img.shields.io/pypi/dm/devpi-process?style=flat-square)](https://pypistats.org/packages/devpi-process)
77
[![PyPI - License](https://img.shields.io/pypi/l/devpi-process?style=flat-square)](https://opensource.org/licenses/MIT)
8-
[![check](https://github.com/gaborbernat/devpi-process/workflows/check/badge.svg)](https://github.com/gaborbernat/devpi-process/actions?query=workflow%3Acheck)
8+
[![check](https://github.com/tox-dev/devpi-process/workflows/check/badge.svg)](https://github.com/tox-dev/devpi-process/actions?query=workflow%3Acheck)
99
[![Code style:
1010
black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
1111

setup.cfg

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = devpi_process
33
description = devpi process provides a programmatic API to create and use a devpi server process
44
long_description = file: README.md
55
long_description_content_type = text/markdown
6-
url = https://github.com/gaborbernat/devpi_process
6+
url = https://github.com/tox-dev/devpi-process
77
maintainer = Bernat Gabor
88
maintainer_email = [email protected]
99
license = MIT
@@ -18,7 +18,6 @@ classifiers =
1818
Operating System :: POSIX
1919
Programming Language :: Python :: 3
2020
Programming Language :: Python :: 3 :: Only
21-
Programming Language :: Python :: 3.6
2221
Programming Language :: Python :: 3.7
2322
Programming Language :: Python :: 3.8
2423
Programming Language :: Python :: 3.9
@@ -27,15 +26,15 @@ classifiers =
2726
Topic :: Utilities
2827
keywords = devpi, programmatic
2928
project_urls =
30-
Source=https://github.com/gaborbernat/devpi-process
31-
Tracker=https://github.com/gaborbernat/devpi-process
29+
Source=https://github.com/tox-dev/devpi-process
30+
Tracker=https://github.com/tox-dev/devpi-process
3231

3332
[options]
3433
packages = find:
3534
install_requires =
3635
devpi-client>=5.2
3736
devpi-server>=6
38-
python_requires = >=3.6
37+
python_requires = >=3.7
3938
include_package_data = True
4039
package_dir =
4140
=src
@@ -46,9 +45,10 @@ where = src
4645

4746
[options.extras_require]
4847
test =
49-
coverage>=5
48+
covdefaults>=2
5049
httpx>=0.18
5150
pytest>=6
51+
pytest-cov>=3
5252

5353
[options.package_data]
5454
devpi_process = py.typed
@@ -66,55 +66,25 @@ ignore =
6666
E203 # whitespace before :
6767

6868
[coverage:run]
69-
source =
70-
${_COVERAGE_SRC}
71-
${_COVERAGE_TEST}
72-
parallel = True
73-
branch = True
74-
dynamic_context = test_function
75-
76-
[coverage:report]
77-
fail_under = 100
78-
skip_covered = true
79-
show_missing = true
80-
81-
[coverage:html]
82-
show_contexts = True
83-
skip_covered = False
84-
skip_empty = False
69+
plugins = covdefaults
70+
parallel = true
8571

8672
[coverage:paths]
87-
source =
73+
src =
8874
src
89-
.tox*/*/lib/python*/site-packages
90-
.tox*/pypy*/site-packages
91-
.tox*\*\Lib\site-packages\
75+
.tox/*/lib/python*/site-packages
76+
.tox/pypy*/site-packages
77+
.tox\*\Lib\site-packages\
9278
*/src
9379
*\src
80+
other =
81+
.
82+
*/devpi-process
83+
*\devpi-process
9484

95-
[tool:pytest]
96-
addopts = -ra --showlocals
97-
testpaths = tests
98-
junit_family = xunit2
99-
100-
[mypy]
101-
python_version = 3.7
102-
disallow_any_generics = True
103-
disallow_subclassing_any = True
104-
disallow_untyped_calls = True
105-
disallow_untyped_defs = True
106-
disallow_incomplete_defs = True
107-
disallow_untyped_decorators = True
108-
show_error_codes = True
109-
no_implicit_optional = True
110-
warn_redundant_casts = True
111-
warn_unused_ignores = False
112-
warn_no_return = True
113-
warn_return_any = True
114-
implicit_reexport = False
115-
strict_equality = True
116-
warn_unused_configs = True
117-
pretty = True
85+
[coverage:report]
86+
fail_under = 100
11887

119-
[mypy-httpx.*]
120-
ignore_missing_imports = True
88+
[coverage:html]
89+
show_contexts = true
90+
skip_covered = false

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24

35
setup()

src/devpi_process/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, base_url: str, name: str, user: str, client_cmd_base: list[st
2424

2525
@property
2626
def url(self) -> str:
27-
return f"{self._server_url}/{self.name}/+simple"
27+
return f"{self._server_url}/{self.name}/+simple/"
2828

2929
def use(self) -> None:
3030
check_call(self._client_cmd_base + ["use", f"{self.user}/{self.name}"], stdout=PIPE, stderr=PIPE)
@@ -51,7 +51,7 @@ def __init__(self, path: Path, with_root_pypi: bool = False, start_args: Sequenc
5151
raise RuntimeError("could not get scripts folder of host interpreter") # pragma: no cover
5252

5353
def _exe(name: str) -> str:
54-
return str(Path(cast(str, scripts_dir)) / f"{name}{'.exe' if sys.platform == 'win32' else ''}")
54+
return str(Path(scripts_dir) / f"{name}{'.exe' if sys.platform == 'win32' else ''}")
5555

5656
self._init: str = _exe("devpi-init")
5757
self._server: str = _exe("devpi-server")

0 commit comments

Comments
 (0)