Skip to content

Commit 931bad7

Browse files
authored
feat: add session-info2 command for uvx (#147)
1 parent 60d659e commit 931bad7

2 files changed

Lines changed: 34 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,51 @@ env:
1010
JUPYTER_PLATFORM_DIRS: '1'
1111

1212
jobs:
13+
get-environments:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
envs: ${{ steps.get-envs.outputs.envs }}
17+
steps:
18+
- uses: actions/checkout@v6
19+
with: { filter: blob:none, fetch-depth: 0 }
20+
- uses: astral-sh/setup-uv@v7
21+
with: { enable-cache: false }
22+
- id: get-envs
23+
run: |
24+
ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries
25+
| map(
26+
select(.key | startswith("hatch-test"))
27+
| { name: .key, python: .value.python }
28+
)')
29+
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
30+
1331
test:
32+
needs: [get-environments]
1433
runs-on: ubuntu-latest
1534
strategy:
1635
matrix:
17-
include:
18-
- python-version: '3.10'
19-
- python-version: '3.13'
20-
- python-version: '3.13'
21-
extras: min
36+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
2237
steps:
23-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@v6
39+
with: { filter: blob:none, fetch-depth: 0 }
40+
- uses: actions/setup-python@v6
2441
with:
25-
fetch-depth: 0
26-
filter: blob:none
27-
- uses: actions/setup-python@v5
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
- uses: astral-sh/setup-uv@v6
31-
with:
32-
enable-cache: true
33-
- run: uv pip install --system -e .[${{ matrix.extras == 'min' && 'test' || 'test,jupyter' }}]
42+
python-version: ${{ matrix.env.python-version }}
43+
- uses: astral-sh/setup-uv@v7
44+
with: { enable-cache: true }
45+
- run: uvx hatch env create ${{ matrix.env.name }}
3446
- uses: pavelzw/pytest-action@v2
3547
with:
36-
custom-arguments: --color=yes
48+
custom-pytest: uvx hatch run ${{ matrix.env.name }}:run --color=yes
3749
click-to-expand: false
3850
verbose: true
3951
job-summary: true
4052
emoji: false
4153
check:
4254
if: always()
43-
needs:
44-
- test
55+
needs: [test]
4556
runs-on: ubuntu-latest
4657
steps:
47-
- uses: re-actors/alls-green@release/v1
48-
with:
49-
jobs: ${{ toJSON(needs) }}
58+
- uses: re-actors/alls-green@release/v1
59+
with:
60+
jobs: ${{ toJSON(needs) }}

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ urls.Documentation = "https://github.com/flying-sheep/session-info2#readme"
5555
urls.Issues = "https://github.com/flying-sheep/session-info2/issues"
5656
urls.Source = "https://github.com/flying-sheep/session-info2"
5757
scripts.session-info = "session_info2.cli:main"
58+
scripts.session-info2 = "session_info2.cli:main" # So `uvx session-info2` works
5859

5960
[tool.hatch.envs.docs]
6061
installer = "uv"
@@ -70,7 +71,7 @@ overrides.matrix.deps.features = [
7071
]
7172

7273
[[tool.hatch.envs.hatch-test.matrix]]
73-
python = [ "3.10", "3.11", "3.12", "3.13" ]
74+
python = [ "3.14", "3.10" ]
7475
deps = [ "all", "min" ]
7576

7677
[tool.hatch.envs.notebook]

0 commit comments

Comments
 (0)