Skip to content

Commit d633ebb

Browse files
committed
modernize setup
1 parent 8d9de0f commit d633ebb

13 files changed

Lines changed: 575 additions & 435 deletions

File tree

.github/workflows/linting.yaml

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Linting
22

3-
# env:
4-
# POETRY_VERSION: "1.8.4"
5-
63
on:
74
pull_request:
85
types: [opened, reopened, synchronize]
@@ -19,6 +16,7 @@ jobs:
1916
run-tests:
2017
name: Python linters
2118
runs-on: ubuntu-latest
19+
timeout-minutes: 5
2220
strategy:
2321
matrix:
2422
python-version:
@@ -30,24 +28,14 @@ jobs:
3028
- "3.13"
3129
steps:
3230
- uses: actions/checkout@v4
31+
with:
32+
persist-credentials: false
33+
fetch-depth: 0
3334

3435
- name: Install the latest version of uv
3536
uses: astral-sh/setup-uv@v5
3637
with:
37-
version: "latest"
38-
39-
# - name: Set up Python
40-
# run: uv python install
41-
42-
# - name: "Set up Python"
43-
# uses: actions/setup-python@v5
44-
# with:
45-
# python-version-file: ".python-version"
46-
47-
# - name: "Set up Python"
48-
# uses: actions/setup-python@v5
49-
# with:
50-
# python-version-file: "pyproject.toml"
38+
version: "latest"
5139

5240
- name: Set up Python ${{ matrix.python-version }}
5341
run: uv python install ${{ matrix.python-version }}
@@ -56,63 +44,10 @@ jobs:
5644
run: uv sync --all-extras --dev
5745

5846
- name: Ruff check
59-
run: uv run ruff check .
60-
61-
- name: Flake8 check
62-
run: uv run flake8 src
47+
run: uv run ruff check src tests
6348

6449
# - name: Pylint
6550
# run: uv run pylint src
6651

6752
- name: Pyroma
6853
run: uv run pyroma .
69-
70-
# jobs:
71-
# run-tests:
72-
# name: Python linters
73-
# runs-on: ubuntu-latest
74-
# timeout-minutes: 5
75-
76-
# steps:
77-
# - uses: actions/checkout@v3
78-
# with:
79-
# persist-credentials: false
80-
# fetch-depth: 0
81-
82-
# - name: Set up Python 3.12
83-
# uses: actions/setup-python@v4
84-
# with:
85-
# python-version: "3.12"
86-
87-
# - name: Set up Poetry
88-
# run: |
89-
# pip install poetry==${{ env.POETRY_VERSION }}
90-
91-
# - name: Install
92-
# run: |
93-
# just install
94-
95-
# - name: Flake8
96-
# run: |
97-
# just flake8
98-
99-
# - name: Ruff
100-
# run: |
101-
# just ruff-check
102-
103-
# - name: Pylint
104-
# run: |
105-
# just pylint
106-
107-
# - name: Mypy
108-
# run: |
109-
# just mypy
110-
111-
# - name: Pyroma
112-
# run: |
113-
# just pyroma
114-
115-
# - name: Check poetry
116-
# run: |
117-
# just poetry-check
118-
# just poetry-lock-check

.github/workflows/testing.yaml

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ jobs:
3636
python-tests:
3737
name: python
3838
runs-on: ubuntu-latest
39+
timeout-minutes: 10
3940

4041
strategy:
42+
fail-fast: false
4143
matrix:
4244
python-version:
4345
- "3.8"
@@ -49,24 +51,14 @@ jobs:
4951

5052
steps:
5153
- uses: actions/checkout@v4
54+
with:
55+
persist-credentials: false
56+
fetch-depth: 0
5257

5358
- name: Install the latest version of uv
5459
uses: astral-sh/setup-uv@v5
5560
with:
56-
version: "latest"
57-
58-
# - name: Set up Python
59-
# run: uv python install
60-
61-
# - name: "Set up Python"
62-
# uses: actions/setup-python@v5
63-
# with:
64-
# python-version-file: ".python-version"
65-
66-
# - name: "Set up Python"
67-
# uses: actions/setup-python@v5
68-
# with:
69-
# python-version-file: "pyproject.toml"
61+
version: "latest"
7062

7163
- name: Set up Python ${{ matrix.python-version }}
7264
run: uv python install ${{ matrix.python-version }}
@@ -75,50 +67,9 @@ jobs:
7567
run: uv sync --all-extras --dev
7668

7769
- name: Run tests
78-
# For example, using `pytest`
79-
# run: uv run pytest tests
8070
run: uv run pytest tests --cov=src --cov-report html --cov-report xml --cov-report term -v
8171

8272

83-
# jobs:
84-
# python-tests:
85-
# name: Python tests
86-
# runs-on: ${{ matrix.os }}
87-
# timeout-minutes: 10
88-
89-
# strategy:
90-
# fail-fast: false
91-
# matrix:
92-
# os:
93-
# - ubuntu-latest
94-
# python-version:
95-
# - "3.8"
96-
# - "3.9"
97-
# - "3.10"
98-
# - "3.11"
99-
# - "3.12"
100-
# # include:
101-
# # # Run 3.12 tests with relaxed constraints
102-
# # - python-version: "3.12-dev"
103-
# # relax: true # ??
104-
105-
# steps:
106-
# - uses: actions/checkout@v3
107-
# with:
108-
# persist-credentials: false
109-
# fetch-depth: 0
110-
111-
# - name: Set up Python ${{ matrix.python-version }}
112-
# uses: actions/setup-python@v4
113-
# with:
114-
# python-version: ${{ matrix.python-version }}
115-
# # TODO: This appears to require poetry to be installed before usage
116-
# # cache: "poetry"
117-
118-
# - name: Set up Poetry
119-
# run: |
120-
# pip install poetry==${{ env.POETRY_VERSION }}
121-
12273
# - name: Install packages
12374
# run: |
12475
# just install

.readthedocs.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
version: 2
99

1010
build:
11-
os: ubuntu-24.04
12-
tools:
13-
python: "3.12"
11+
os: ubuntu-24.04
12+
tools:
13+
python: "3.12"
1414
jobs:
15-
create_environment:
16-
- asdf plugin add uv
17-
- asdf install uv latest
18-
- asdf global uv latest
19-
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --only-group docs
20-
install:
21-
- "true"
15+
create_environment:
16+
- asdf plugin add uv
17+
- asdf install uv latest
18+
- asdf global uv latest
19+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --only-group docs
20+
install:
21+
- "true"
2222

2323
formats:
24-
- htmlzip
25-
- pdf
26-
# - epub
27-
# - all
24+
- htmlzip
25+
- pdf
26+
# - epub
27+
# - all
2828

2929
sphinx:
30-
configuration: docs/conf.py
31-
fail_on_warning: false # true is too strict
30+
configuration: docs/conf.py
31+
fail_on_warning: false # true is too strict

.vscode/settings.json

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,64 @@
11
{
2-
// oh-my-posh uses special font (CaskaydiaCove) to display icons in the console
3-
"editor.fontFamily": "Consolas, 'Courier New', monospace,'DejaVu Sans Mono for Powerline','CaskaydiaCove NF'",
2+
"editor.codeActionsOnSave": {
3+
"source.organizeImports": "explicit",
4+
"source.fixAll": "explicit"
5+
},
46
"editor.detectIndentation": false,
7+
// "editor.formatOnSave": true, // avoid removing all blank lines in json-files
58
"editor.insertSpaces": true,
69
"editor.tabSize": 4,
10+
711
"files.associations": {
812
".env": "dotenv",
913
".env.template": "dotenv"
1014
},
11-
"makefile.extensionOutputFolder": "./var/cache/vscode",
12-
"[makefile]": { // per-language config
13-
"editor.insertSpaces": false,
15+
"files.exclude": {
16+
"**/__pycache__": true
17+
},
18+
"files.trimTrailingWhitespace": true,
19+
20+
"[json]": {
21+
"editor.formatOnSave": false
22+
},
23+
24+
// "jupyter.defaultKernel": "${workspaceFolder}/.venv/bin/python",
25+
// "jupyter.jupyterServerType": "local",
26+
27+
"mypy-type-checker.args": ["--config-file", "${workspaceFolder}/pyproject.toml"],
28+
"mypy-type-checker.cwd": "${workspaceFolder}/",
29+
"mypy-type-checker.importStrategy": "fromEnvironment",
30+
31+
"[python]": {
32+
"editor.defaultFormatter": "charliermarsh.ruff",
33+
"editor.formatOnSave": true
1434
},
15-
"makefile.defaultLaunchConfiguration": {},
16-
"makefile.makefilePath": "makefile", // Makefile is default
17-
"makefile.configurations": [],
18-
// https://code.visualstudio.com/docs/python/settings-reference
1935
"python.envFile": "${workspaceFolder}/.env",
2036
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
21-
"python.linting.enabled": true,
2237
"python.terminal.activateEnvironment": true,
2338
"python.testing.unittestEnabled": false,
2439
"python.testing.pytestEnabled": true,
2540
"python.testing.pytestArgs": [
41+
"--color=yes",
2642
"--cov=src",
27-
"--cov-report=xml",
28-
"--cov-report=html",
29-
"--pdb",
43+
// "--cov=httpclient_logging",
44+
// "--cov-fail-under=90",
45+
// "--cov-report xml:${workspaceFolder}/var/coverage/pytest-cobertura.xml",
46+
// "--cov-report html:${workspaceFolder}/var/coverage/html",
47+
// "--cov-report term-missing",
48+
// "--junit-xml=${workspaceFolder}/var/coverage/pytest-junit.xml",
49+
// "--pdb",
3050
"-v",
3151
"${workspaceFolder}/tests/",
3252
],
33-
"yaml.customTags": [
34-
"!env"
35-
]
36-
}
53+
"ruff.configuration": "${workspaceFolder}/pyproject.toml",
54+
// "ruff.lint.args": ["--extend-ignore=F401"],
55+
"ruff.nativeServer": "on",
56+
57+
"[yaml]": { // per-language config
58+
"editor.insertSpaces": true,
59+
"editor.tabSize": 4,
60+
},
61+
62+
"vscode-just.runInTerminal": true,
63+
"vscode-just.useSingleTerminal": true,
64+
}

docs/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55

66
## Unreleased (YYYY-MM-DD)
77

8+
## 1.1 (2025-03-13)
89
- Remove ``httpclient_logging.patch.cancel``-function, since this is now available in ``sitecustomize-entrypoints>=1.1.0``
910

1011
- Depend on ``sitecustomize-entrypoints>=1.1.0``

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# pylint: disable=invalid-name
2-
"""
3-
This file is execfile()d with the current directory set to its containing dir.
2+
"""This file is execfile()d with the current directory set to its containing dir.
43
Note that not all possible configuration values are present in this autogenerated file.
54
All configuration values have a default; values that are commented out serve to show the default.
65
"""
@@ -50,7 +49,8 @@ def read_version(*names: str) -> str:
5049
if line.startswith("__version__ = "):
5150
version_ = line.split("=")[1].strip().strip('"').strip("'")
5251
return version_
53-
raise RuntimeError("Unable to find version string.")
52+
msg = "Unable to find version string."
53+
raise RuntimeError(msg)
5454

5555

5656
autoclass_content = "both"

0 commit comments

Comments
 (0)