Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build wheels for Python package #549

Merged
merged 26 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4c6fd5
ci: publish `taplo-cli` to PyPI with maturin.rs
redeboer Feb 4, 2024
58f8b54
chore: update to `actions/checkout@v4`
redeboer Feb 4, 2024
c2a0124
chore: update upload/download actions
redeboer Feb 4, 2024
28305eb
ci: merge wheel files in intermediate job
redeboer Feb 4, 2024
55c7e96
chore: update locked dependencies
redeboer Feb 4, 2024
2ef0d97
fix: build openssl
redeboer Feb 4, 2024
d975aa1
TEMP: build Python package on all branches
redeboer Feb 4, 2024
438003f
ci: build linux distributions with and without vendored openssl
redeboer Feb 4, 2024
a10ac6a
ci: test pip package on different OS
redeboer Feb 4, 2024
66cc4e4
ci: bump `taplo-cli` to 0.9.1-rc.1
redeboer Feb 4, 2024
a998432
TEMP: rename Python package to `taplo-test`
redeboer Feb 4, 2024
ebe50e3
fix: upload files from `wheels/*` folder
redeboer Feb 4, 2024
72f4b60
Revert "TEMP: rename Python package to `taplo-test`"
redeboer Feb 7, 2024
dd14809
chore: clean up `.gitignore`
redeboer Feb 7, 2024
ebdb3e3
Revert "TEMP: build Python package on all branches"
redeboer Feb 7, 2024
3487ebe
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Apr 18, 2024
3b4b7c6
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Aug 19, 2024
b57045a
chore: update `openssl`
redeboer Aug 19, 2024
a24682a
chore: fix formatting
redeboer Aug 19, 2024
ffd444a
ci: merge Python workflow into release workflow
redeboer Aug 19, 2024
a9e7a4a
Merge branch 'master' into linux-shared-and-static-openssl
redeboer Aug 19, 2024
2ed2723
fix: only publish on tags
redeboer Aug 19, 2024
cdb6a3a
ci: publish via `pypa/gh-action-pypi-publish`
redeboer Aug 20, 2024
52376a4
fix: remove unnecessary changes
panekj Aug 20, 2024
26e00f9
ci: fix artefact names, clean-up naming
panekj Aug 20, 2024
48175dc
ci: fix sdist check [ci skip]
panekj Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,79 @@ jobs:
working-directory: editors/vscode
env:
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}

pypi_build_taplo_cli:
name: Build python wheels
needs: ["wait_for_ci"]
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
arch: [x86, x64, aarch64]
exclude:
- os: windows
arch: aarch64
- os: ubuntu
arch: aarch64
- os: macos
arch: x86
steps:
- uses: actions/checkout@v4
- name: Build sdist
if: matrix.os == 'ubuntu' && matrix.arch == 'x64'
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.arch }}
args: --release --out dist
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: dist

pypi_test_taplo_cli:
name: Test python wheels
needs: ["pypi_build_taplo_cli"]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: wheels
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: "3"
- run: pip install taplo --no-index --find-links wheels/
- run: taplo help

pypi_publish_taplo_cli:
name: PyPI publish taplo
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-taplo-cli-0')
needs: ["pypi_test_taplo_cli"]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ target
.vscode/settings.json
.cargo/config.toml
yarn-error.log

# Python
__pycache__/
*venv/
dist/
wheels/
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/taplo-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ license = { workspace = true }
repository = { workspace = true }

[features]
default = ["rustls-tls", "lsp", "toml-test"]
lsp = ["taplo-lsp", "async-ctrlc"]
default = ["lsp", "rustls-tls", "toml-test"]
lsp = ["async-ctrlc", "taplo-lsp"]
native-tls = ["taplo-common/native-tls", "taplo-lsp?/native-tls"]
rustls-tls = ["taplo-common/rustls-tls", "taplo-lsp?/rustls-tls"]
toml-test = []
Expand Down
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[build-system]
requires = ["maturin>=1.4"]
build-backend = "maturin"

[project]
name = "taplo"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python",
"Programming Language :: Rust",
"Topic :: Software Development :: Quality Assurance",
]
dynamic = ["version"]

[tool.maturin]
bindings = "bin"
manifest-path = "crates/taplo-cli/Cargo.toml"