From 9bd07530c174c3071bdd09ed07db571a3503d6fa Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Tue, 6 Apr 2021 18:41:56 +1000 Subject: [PATCH] Core version for Python --- .github/workflows/python.yml | 7 +++++-- python/.gitignore | 1 + python/Cargo.core.toml | 21 +++++++++++++++++++++ python/{Cargo.toml => Cargo.js.toml} | 0 version | 2 +- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 python/Cargo.core.toml rename python/{Cargo.toml => Cargo.js.toml} (100%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6cca024..2c2c282 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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' diff --git a/python/.gitignore b/python/.gitignore index 5e92e23..7aaa10e 100644 --- a/python/.gitignore +++ b/python/.gitignore @@ -1,4 +1,5 @@ /Cargo.lock +/Cargo.toml /target/ __pycache__/ diff --git a/python/Cargo.core.toml b/python/Cargo.core.toml new file mode 100644 index 0000000..89bfb26 --- /dev/null +++ b/python/Cargo.core.toml @@ -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 "] +edition = "2018" + +[lib] +name = "minify_html_core" +crate-type = ["cdylib"] + +[dependencies] +minify-html = { path = "..", features = [] } +[dependencies.pyo3] +version = "0.13.0" +features = ["extension-module"] diff --git a/python/Cargo.toml b/python/Cargo.js.toml similarity index 100% rename from python/Cargo.toml rename to python/Cargo.js.toml diff --git a/version b/version index aca93e6..cc328e9 100755 --- a/version +++ b/version @@ -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}"`); }