Skip to content

Commit 3977343

Browse files
committed
Rename package to sqlglot-mypy
1 parent 412c19a commit 3977343

3 files changed

Lines changed: 100 additions & 39 deletions

File tree

.github/workflows/build_wheels.yml

Lines changed: 95 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,109 @@
1-
name: Trigger wheel build
1+
name: Build and publish wheels
22

33
on:
44
push:
5-
branches: [main, master, 'release*']
6-
tags: ['*']
5+
branches: ['release-*']
6+
tags: ['v*']
7+
pull_request:
8+
branches: ['release-*']
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
714

815
permissions:
916
contents: read
1017

1118
jobs:
12-
build-wheels:
13-
if: github.repository == 'python/mypy'
19+
generate_wheels_matrix:
20+
name: Generate wheels matrix
21+
runs-on: ubuntu-latest
22+
outputs:
23+
include: ${{ steps.set-matrix.outputs.include }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Install cibuildwheel and pypyp
27+
run: |
28+
pipx install cibuildwheel==3.3.1
29+
pipx install pypyp==1.3.0
30+
- id: set-matrix
31+
run: |
32+
MATRIX=$(
33+
{
34+
cibuildwheel --print-build-identifiers --platform linux --archs x86_64 \
35+
| pyp 'json.dumps({"only": x, "os": "ubuntu-latest"})' \
36+
&& cibuildwheel --print-build-identifiers --platform linux --archs aarch64 \
37+
| pyp 'json.dumps({"only": x, "os": "ubuntu-24.04-arm"})' \
38+
&& cibuildwheel --print-build-identifiers --platform macos \
39+
| pyp 'json.dumps({"only": x, "os": "macos-latest"})' \
40+
&& cibuildwheel --print-build-identifiers --platform windows \
41+
| pyp 'json.dumps({"only": x, "os": "windows-latest"})' \
42+
&& cibuildwheel --print-build-identifiers --platform windows --archs ARM64 \
43+
| pyp 'json.dumps({"only": x, "os": "windows-11-arm"})'
44+
} | pyp 'json.dumps(list(map(json.loads, lines)))'
45+
)
46+
echo "include=$MATRIX" | tee -a $GITHUB_OUTPUT
47+
env:
48+
CIBW_ARCHS_MACOS: x86_64 arm64
49+
50+
build_wheels:
51+
name: Build ${{ matrix.only }}
52+
needs: generate_wheels_matrix
53+
runs-on: ${{ matrix.os }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
include: ${{ fromJson(needs.generate_wheels_matrix.outputs.include) }}
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
submodules: recursive
62+
- uses: pypa/cibuildwheel@v3.3.1
63+
with:
64+
only: ${{ matrix.only }}
65+
- uses: actions/upload-artifact@v4
66+
with:
67+
name: dist-${{ matrix.only }}
68+
path: ./wheelhouse/*.whl
69+
overwrite: true
70+
71+
build_sdist:
72+
name: Build sdist and pure Python wheel
1473
runs-on: ubuntu-latest
1574
steps:
1675
- uses: actions/checkout@v4
1776
with:
18-
persist-credentials: false
77+
submodules: recursive
1978
- uses: actions/setup-python@v5
2079
with:
21-
python-version: '3.11'
22-
- name: Trigger script
23-
env:
24-
WHEELS_PUSH_TOKEN: ${{ secrets.WHEELS_PUSH_TOKEN }}
25-
run: ./misc/trigger_wheel_build.sh
80+
python-version: "3.13"
81+
- name: Build sdist and wheel
82+
run: |
83+
pip install --upgrade setuptools build
84+
python -m build
85+
- uses: actions/upload-artifact@v4
86+
with:
87+
name: dist-sdist
88+
path: |
89+
dist/*.whl
90+
dist/*.tar.gz
91+
overwrite: true
92+
93+
publish:
94+
name: Publish to PyPI
95+
if: startsWith(github.ref, 'refs/tags/v')
96+
needs: [build_wheels, build_sdist]
97+
runs-on: ubuntu-latest
98+
environment: pypi
99+
permissions:
100+
id-token: write
101+
steps:
102+
- name: Download all artifacts
103+
uses: actions/download-artifact@v4
104+
with:
105+
pattern: dist-*
106+
path: dist
107+
merge-multiple: true
108+
- name: Publish to PyPI
109+
uses: pypa/gh-action-pypi-publish@release/v1

misc/trigger_wheel_build.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requires = [
1717
build-backend = "setuptools.build_meta"
1818

1919
[project]
20-
name = "mypy"
20+
name = "sqlglot-mypy"
2121
description = "Optional static typing for Python"
2222
readme = {text = """
2323
Mypy -- Optional Static Typing for Python
@@ -67,11 +67,11 @@ install-types = ["pip"]
6767
faster-cache = ["orjson"]
6868

6969
[project.urls]
70-
Homepage = "https://www.mypy-lang.org/"
70+
Homepage = "https://github.com/vaggelisd/sqlglot-mypy"
7171
Documentation = "https://mypy.readthedocs.io/en/stable/index.html"
72-
Repository = "https://github.com/python/mypy"
73-
Changelog = "https://github.com/python/mypy/blob/master/CHANGELOG.md"
74-
Issues = "https://github.com/python/mypy/issues"
72+
Repository = "https://github.com/vaggelisd/sqlglot-mypy"
73+
Changelog = "https://github.com/vaggelisd/sqlglot-mypy/blob/master/CHANGELOG.md"
74+
Issues = "https://github.com/vaggelisd/sqlglot-mypy/issues"
7575

7676
[project.scripts]
7777
mypy = "mypy.__main__:console_entry"

0 commit comments

Comments
 (0)