Skip to content

Commit 2099e85

Browse files
committed
🎉 Added initial stubs and package structure
1 parent 6be784b commit 2099e85

File tree

9 files changed

+26397
-2
lines changed

9 files changed

+26397
-2
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_call:
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup UV
24+
uses: astral-sh/setup-uv@v6
25+
26+
- name: Setup Python
27+
run: uv python install ${{ matrix.python-version }}
28+
29+
- name: Install dependencies
30+
run: uv sync --dev
31+
32+
- name: Run Linting
33+
run: uv run ruff check .
34+
35+
- name: Run Type Checking
36+
run: uv run mypy src
37+
38+
- name: Run Unit Tests
39+
run: uv run pytest -v
40+
41+
- name: Test Package Build
42+
run: uv build

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
tests:
10+
uses: allrisc/stubs-pyslang/.github/workflows/ci.yml@main
11+
12+
build:
13+
name: Build Distro
14+
runs-on: ubuntu-latest
15+
needs: tests
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup UV
21+
uses: astral-sh/setup-uv@v6
22+
23+
- name: Build
24+
run: uv build
25+
26+
- name: Store the distro packages
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: Publish to PyPI
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: pypi
38+
url: https://pypi.org/p/stubs-pyslang
39+
permissions:
40+
id-token: write
41+
42+
steps:
43+
- name: Download distro packages
44+
uses: actions/download-artifact@v5
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
49+
- name: Publish Distro to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1
51+
52+
github-release:
53+
name: Sign the Python Distro ans Upload to GitHub Releases
54+
55+
needs:
56+
- publish-to-pypi
57+
runs-on: ubuntu-latest
58+
59+
permissions:
60+
contents: write
61+
id-token: write
62+
63+
steps:
64+
- name: Download all the distros
65+
uses: actions/download-artifact@v5
66+
with:
67+
name: python-package-distributions
68+
path: dist/
69+
70+
- name: Sign the dists with Sigstore
71+
uses: sigstore/[email protected]
72+
with:
73+
inputs: >-
74+
./dist/*.tar.gz
75+
./dist/*.whl
76+
77+
- name: Create GitHub Release
78+
env:
79+
GITHUB_TOKEN: ${{ github.token }}
80+
run: >-
81+
gh release create
82+
'${{ github.ref_name }}'
83+
--repo '${{ github.repository }}'
84+
--notes ""
85+
86+
- name: Upload artifact signatures to GitHub Release
87+
env:
88+
GITHUB_TOKEN: ${{ github.token }}
89+
# Upload to GitHub Release using the `gh` CLI.
90+
# `dist/` contains the built packages, and the
91+
# sigstore-produced signatures and certificates.
92+
run: >-
93+
gh release upload
94+
'${{ github.ref_name }}' dist/**
95+
--repo '${{ github.repository }}'

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
# stubs-pyslang
2-
A Python Stubs Library for the excellent pyslang SystemVerilog library
1+
# Typing Stubs for pyslang
2+
This is a [typing stub package](https://typing.python.org/en/latest/tutorials/external_libraries.html)
3+
for the [`pyslang`](https://github.com/MikePopoloski/slang) package.
4+
It can be used by type checkers to check code that uses `pyslang`.
5+
This version of `stubs-pyslang` aims to provide accurate annotations for `pyslang==9.0.*`.
6+
7+
8+
This package was tested with the following type checkers:
9+
* [mypy](https://github.com/python/mypy/)

0 commit comments

Comments
 (0)