Core version for Python

This commit is contained in:
Wilson Lin 2021-04-06 18:41:56 +10:00
parent 12ce72448b
commit 9bd07530c1
5 changed files with 28 additions and 3 deletions

View File

@ -9,11 +9,12 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
feature: [core, js]
os: [macos-11.0, ubuntu-latest, windows-latest]
python: [3.7, 3.8, 3.9]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Set up Python
@ -44,7 +45,9 @@ jobs:
- name: Build native module
working-directory: ./python
run: cargo build --release
run: |
cp Cargo.${{ matrix.feature }}.toml Cargo.toml
cargo build --release
- name: Install Python build tools (macOS)
if: runner.os == 'macOS'

1
python/.gitignore vendored
View File

@ -1,4 +1,5 @@
/Cargo.lock
/Cargo.toml
/target/
__pycache__/

21
python/Cargo.core.toml Normal file
View File

@ -0,0 +1,21 @@
[package]
publish = false
name = "minify_html_core"
description = "Extremely fast and smart HTML minifier"
license = "MIT"
homepage = "https://github.com/wilsonzlin/minify-html"
readme = "README.md"
repository = "https://github.com/wilsonzlin/minify-html.git"
version = "0.4.3"
authors = ["Wilson Lin <code@wilsonl.in>"]
edition = "2018"
[lib]
name = "minify_html_core"
crate-type = ["cdylib"]
[dependencies]
minify-html = { path = "..", features = [] }
[dependencies.pyo3]
version = "0.13.0"
features = ["extension-module"]

View File

@ -69,7 +69,7 @@ cmd('git', 'pull');
cmd('bash', './prebuild.sh');
cmd('cargo', 'test', '--features', 'js-esbuild');
for (const f of ['Cargo.toml', 'cli/Cargo.toml', 'nodejs/native/Cargo.toml', 'java/Cargo.toml', 'python/Cargo.toml', 'ruby/Cargo.toml']) {
for (const f of ['Cargo.toml', 'cli/Cargo.toml', 'nodejs/native/Cargo.toml', 'java/Cargo.toml', 'python/Cargo.core.toml', 'python/Cargo.js.toml', 'ruby/Cargo.toml']) {
replaceInFile(f, /^version = "\d+\.\d+\.\d+"\s*$/m, `version = "${NEW_VERSION}"`);
}