Skip to content

Commit 299168c

Browse files
committed
ci: fix ci
1 parent 56d5744 commit 299168c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/ci-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ jobs:
3737
poetry install --no-interaction --no-ansi
3838
poetry run pip install -e .
3939
40+
# DEBUG: Check package installation
41+
- name: Debug package installation
42+
run: |
43+
echo "=== Installed packages ==="
44+
poetry run pip list | grep -i leetcode || true
45+
echo "=== Package metadata ==="
46+
poetry run python -c "import importlib.metadata; print([p for p in importlib.metadata.distributions() if 'leetcode' in p.metadata['Name'].lower()])" || true
47+
echo "=== Direct version check ==="
48+
poetry run python -c "from importlib.metadata import version; print(version('leetcode-py'))" || echo "leetcode-py not found"
49+
poetry run python -c "from importlib.metadata import version; print(version('leetcodepy'))" || echo "leetcodepy not found"
50+
poetry run python -c "from importlib.metadata import version; print(version('leetcode_py'))" || echo "leetcode_py not found"
51+
4052
- name: Cache Graphviz installation
4153
id: cache-graphviz
4254
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4

leetcode_py/cli/main.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@
1010

1111

1212
def show_version():
13-
typer.echo(f"lcpy version {version('leetcode-py')}")
13+
# Try different package name variations
14+
package_names = ["leetcode-py-sdk", "leetcode-py", "leetcodepy", "leetcode_py"]
15+
for name in package_names:
16+
try:
17+
ver = version(name)
18+
typer.echo(f"lcpy version {ver}")
19+
raise typer.Exit()
20+
except Exception:
21+
continue
22+
23+
# Fallback if no package found
24+
typer.echo("lcpy version unknown (package not found)")
1425
raise typer.Exit()
1526

1627

0 commit comments

Comments
 (0)