ovld 0.3.6__tar.gz → 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,18 +30,32 @@ jobs:
30
30
  runs-on: ubuntu-latest
31
31
  strategy:
32
32
  matrix:
33
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
33
+ settings:
34
+ - python: '3.8'
35
+ coverage: false
36
+ - python: '3.9'
37
+ coverage: false
38
+ - python: '3.10'
39
+ coverage: false
40
+ - python: '3.11'
41
+ coverage: false
42
+ - python: '3.12'
43
+ coverage: true
34
44
  steps:
35
45
  - name: Check out the code
36
46
  uses: actions/checkout@v3
37
47
  - name: Install rye
38
48
  uses: eifinger/setup-rye@v4
39
49
  - name: Pin Python version
40
- run: rye pin ${{ matrix.python-version }}
50
+ run: rye pin ${{ matrix.settings.python }}
41
51
  - name: Sync dependencies
42
52
  run: rye sync
43
53
  - name: Test with pytest
44
- run: rye run pytest --cov=ovld --cov-report term-missing
54
+ if: ${{ !matrix.settings.coverage }}
55
+ run: rye run pytest
56
+ - name: Test with pytest and coverage
57
+ if: ${{ matrix.settings.coverage }}
58
+ run: rye run pytest --cov=src --cov-report term-missing
45
59
  - name: Verify coverage
46
- if: ${{ matrix.python-version == '3.12' }}
60
+ if: ${{ matrix.settings.coverage }}
47
61
  run: rye run coverage report | tail -1 | egrep "TOTAL +[0-9]+ +0 +100%"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ovld
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Overloading Python functions
5
5
  Author-email: Olivier Breuleux <breuleux@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ovld"
3
- version = "0.3.6"
3
+ version = "0.3.7"
4
4
  description = "Overloading Python functions"
5
5
  authors = [
6
6
  { name = "Olivier Breuleux", email = "breuleux@gmail.com" }
@@ -19,9 +19,10 @@ build-backend = "hatchling.build"
19
19
  [tool.rye]
20
20
  managed = true
21
21
  dev-dependencies = [
22
- "codefind>=0.1.6",
22
+ "codefind~=0.1.6",
23
23
  "pytest>=8.3.2",
24
24
  "pytest-cov>=5.0.0",
25
+ "uv>=0.2.30",
25
26
  ]
26
27
 
27
28
  [tool.hatch.metadata]
@@ -22,3 +22,4 @@ pluggy==1.5.0
22
22
  pytest==8.3.2
23
23
  # via pytest-cov
24
24
  pytest-cov==5.0.0
25
+ uv==0.2.30
@@ -115,6 +115,8 @@ class MultiTypeMap(dict):
115
115
  def transform(self, obj):
116
116
  if isinstance(obj, GenericAlias):
117
117
  return type[obj.__origin__]
118
+ elif obj is typing.Any:
119
+ return type[object]
118
120
  elif isinstance(obj, type):
119
121
  return type[obj]
120
122
  else:
@@ -0,0 +1 @@
1
+ version = "0.3.7"
@@ -1108,6 +1108,22 @@ def test_generic_type_argument():
1108
1108
  assert f(dict[str, int]) == "dict"
1109
1109
 
1110
1110
 
1111
+ @pytest.mark.skipif(
1112
+ sys.version_info < (3, 9),
1113
+ reason="type[...] syntax requires python3.9 or higher",
1114
+ )
1115
+ def test_any():
1116
+ @ovld
1117
+ def f(t: type[dict]):
1118
+ return "no"
1119
+
1120
+ @ovld
1121
+ def f(t: type[object]):
1122
+ return "yes"
1123
+
1124
+ assert f(typing.Any) == "yes"
1125
+
1126
+
1111
1127
  @pytest.mark.skipif(
1112
1128
  sys.version_info < (3, 9),
1113
1129
  reason="type[...] syntax requires python3.9 or higher",
@@ -1 +0,0 @@
1
- version = "0.3.6"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes