diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 5cd9dd3..8f7b682 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -16,28 +16,28 @@ permissions: contents: read jobs: - # linux: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] - # steps: - # - uses: actions/checkout@v3 - # - uses: actions/setup-python@v4 - # with: - # python-version: '3.10' - # - name: Build wheels - # uses: PyO3/maturin-action@v1 - # with: - # target: ${{ matrix.target }} - # args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter - # sccache: 'true' - # manylinux: auto - # - name: Upload wheels - # uses: actions/upload-artifact@v3 - # with: - # name: wheels - # path: dist + linux: + runs-on: ubuntu-latest + strategy: + matrix: + target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter + sccache: 'true' + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist windows: runs-on: windows-latest @@ -54,7 +54,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter + args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v3 @@ -76,7 +76,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: -m cmdapp/Cargo.toml --release --features=python-binding --out dist --find-interpreter + args: -m cmdapp/Cargo.toml --release --out dist --find-interpreter sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v3 @@ -108,7 +108,7 @@ jobs: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write if: "startsWith(github.ref, 'refs/tags/')" - needs: [windows, macos, sdist] # linux + needs: [windows, macos, sdist, linux] steps: - uses: actions/download-artifact@v3 with: diff --git a/cmdapp/Cargo.toml b/cmdapp/Cargo.toml index b775d9e..82f80e4 100644 --- a/cmdapp/Cargo.toml +++ b/cmdapp/Cargo.toml @@ -18,4 +18,8 @@ fastrand = "1.8" pyo3 = { version = "0.19.0", optional = true } [features] -python-binding = ["pyo3"] \ No newline at end of file +python-binding = ["pyo3"] + +[lib] +name = "vtracer" +crate-type = ["cdylib"] \ No newline at end of file diff --git a/cmdapp/pyproject.toml b/cmdapp/pyproject.toml index f5c4a5a..4f2a6d4 100644 --- a/cmdapp/pyproject.toml +++ b/cmdapp/pyproject.toml @@ -23,6 +23,6 @@ requires = ["maturin>=1.2,<2.0"] build-backend = "maturin" [tool.maturin] -features = ["pyo3/extension-module"] +features = ["pyo3/extension-module", "python-binding"] compatibility = "manylinux2014" sdist-include = ["LICENSE-MIT", "vtracer/README.md"] \ No newline at end of file diff --git a/cmdapp/src/main.rs b/cmdapp/src/main.rs index 230d524..07a3c80 100644 --- a/cmdapp/src/main.rs +++ b/cmdapp/src/main.rs @@ -1,8 +1,10 @@ -use vtracer::{Config, convert_image_to_svg}; +mod config; +mod converter; +mod svg; fn main() { - let config = Config::from_args(); - let result = convert_image_to_svg(config); + let config = config::Config::from_args(); + let result = converter::convert_image_to_svg(config); match result { Ok(()) => { println!("Conversion successful.");