Skip to content

Commit 6f2525a

Browse files
committed
DEBUG CI: Introspection of python
1 parent aaf3cc9 commit 6f2525a

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ classifiers = [
1111
'Programming Language :: Python :: 3.12',
1212
'Programming Language :: Python :: 3.13',
1313
]
14-
dependencies = []
14+
dependencies = ["typing_extensions>=4.15"]
1515

1616
[project.optional-dependencies]
1717
dev = [

python/coglet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
try:
2-
from ._version import __version__
2+
from ._version import __version__ # type: ignore[import-untyped]
33
except ImportError:
44
__version__ = '0.0.0+unknown'

script/test.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,86 @@ test_go() {
1919
}
2020

2121
test_python() {
22+
echo "=== PYTHON ENVIRONMENT DEBUG ==="
23+
.venv/bin/python --version
24+
echo "Python executable: $(.venv/bin/python -c 'import sys; print(sys.executable)')"
25+
echo "Python path: $(.venv/bin/python -c 'import sys; print(sys.path)')"
26+
echo "Site packages: $(.venv/bin/python -c 'import site; print(site.getsitepackages())')"
27+
echo "User site: $(.venv/bin/python -c 'import site; print(site.getusersitepackages())')"
28+
echo
29+
echo "=== SITE-PACKAGES INSPECTION ==="
30+
echo "Contents of site-packages:"
31+
ls -la .venv/lib/python*/site-packages/ | head -20
32+
echo "Looking for typing_extensions:"
33+
find .venv -name "*typing_extensions*" -type f 2>/dev/null || echo "No typing_extensions found"
34+
echo "Looking for coglet:"
35+
find .venv -name "*coglet*" -type d 2>/dev/null || echo "No coglet found"
36+
echo "Looking for cog:"
37+
find .venv -name "cog" -type d 2>/dev/null || echo "No cog found"
38+
echo
39+
echo "=== TYPING_EXTENSIONS CHECK ==="
40+
.venv/bin/python -c "
41+
try:
42+
import typing_extensions
43+
print('typing_extensions imported successfully')
44+
print('typing_extensions location:', getattr(typing_extensions, '__file__', 'NO __file__'))
45+
print('typing_extensions version:', getattr(typing_extensions, '__version__', 'NO __version__'))
46+
print('typing_extensions dir:', [x for x in dir(typing_extensions) if 'Param' in x])
47+
48+
# Test ParamSpec specifically
49+
try:
50+
from typing_extensions import ParamSpec
51+
print('ParamSpec import: SUCCESS')
52+
except ImportError as pe:
53+
print('ParamSpec import FAILED:', pe)
54+
55+
except ImportError as e:
56+
print('typing_extensions FAILED:', e)
57+
"
58+
echo
59+
echo "=== PACKAGE INSTALLATION CHECK ==="
60+
.venv/bin/python -c "
61+
import pkg_resources
62+
try:
63+
dist = pkg_resources.get_distribution('typing_extensions')
64+
print('typing_extensions pkg_resources:', dist.version, 'at', dist.location)
65+
except:
66+
print('typing_extensions not found in pkg_resources')
67+
68+
try:
69+
dist = pkg_resources.get_distribution('coglet')
70+
print('coglet pkg_resources:', dist.version, 'at', dist.location)
71+
except:
72+
print('coglet not found in pkg_resources')
73+
"
74+
echo
75+
echo "=== COGLET IMPORT TEST ==="
76+
.venv/bin/python -c "
77+
try:
78+
print('Importing coglet...')
79+
import coglet
80+
print('SUCCESS: coglet imported')
81+
82+
print('Importing coglet.api...')
83+
import coglet.api
84+
print('SUCCESS: coglet.api imported')
85+
86+
print('Importing cog...')
87+
import cog
88+
print('SUCCESS: cog imported')
89+
90+
print('Importing cog.coder...')
91+
import cog.coder
92+
print('SUCCESS: cog.coder imported')
93+
94+
except Exception as e:
95+
print('IMPORT FAILED:', type(e).__name__, ':', e)
96+
import traceback
97+
traceback.print_exc()
98+
"
99+
echo
100+
echo "=== RUNNING TESTS ==="
101+
exit 0
22102
.venv/bin/pytest "$@" -vv
23103
}
24104

0 commit comments

Comments
 (0)