diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 2b2a78997..bde4fba10 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -88,7 +88,13 @@ jobs: - name: Run uv sync run: ./img2num run uv sync - - name: Build Img2Num Python Package + - name: Build wheel + run: | + ./img2num run uv build + # Debug + ls -R dist || true + + - name: Verify import run: ./img2num run uv run python3 -c "import img2num;" - name: Build and run example-apps/console-py @@ -99,7 +105,7 @@ jobs: uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: py-build - path: packages/py/build-py/ + path: dist/ if-no-files-found: error - name: Upload example-apps/console-py output artifacts diff --git a/packages/py/pyproject.toml b/packages/py/pyproject.toml deleted file mode 100644 index 19bbd960f..000000000 --- a/packages/py/pyproject.toml +++ /dev/null @@ -1,33 +0,0 @@ -[project] -name = "img2num" -version = "0.0.0" -description = "A fast and accurate raster image to SVG conversion library" -requires-python = ">=3.10" -dependencies = [ - "numpy" -] - -[build-system] -requires = [ - "scikit-build-core>=0.10", - "pybind11>=2.10", - "numpy" -] -build-backend = "scikit_build_core.build" - -[tool.scikit-build] -cmake.source-dir = "../.." -cmake.build-type = "Release" -cmake.args = ["-DBUILD_PYTHON=ON"] -# Disable broken sdist isolation -sdist.include = [ - "../../CMakeLists.txt", - "../../core", - "../../bindings", - "../../cmake" -] -editable.rebuild = true -build-dir = "build-py" - -[tool.uv] -package = true diff --git a/pyproject.toml b/pyproject.toml index ac4e1e198..88990f1d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,55 @@ [project] -name = "img2num_uv_workspace" +name = "img2num" version = "0.0.0" -description = "Root level workspace for Img2Num's Python package and applications" +description = "A fast and accurate raster image to SVG conversion library" requires-python = ">=3.10" +license = { text = "MIT" } +readme = "README.md" +authors = [{ name = "Ryan Millard" }] dependencies = [ - "img2num" + "numpy>=1.23.5" +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] -[tool.uv] -package = false -no-build-isolation-package = ["img2num"] +[project.urls] +Homepage = "https://ryan-millard.github.io/Img2Num/" +Repository = "https://github.com/Ryan-Millard/Img2Num" + +[build-system] +requires = [ + "scikit-build-core>=0.10", + "pybind11>=2.10", + "numpy>=2.0" +] +build-backend = "scikit_build_core.build" + +[tool.scikit-build] +cmake.source-dir = "." +cmake.build-type = "Release" +cmake.args = [ + "-DBUILD_PYTHON=ON", + "-DPython3_FIND_VIRTUALENV=NEVER", +] -[tool.uv.sources] -img2num = { workspace = true } +wheel.packages = ["img2num"] + +sdist.include = [ + "CMakeLists.txt", + "core/**", + "bindings/py/**", + "packages/py/**" +] + +[tool.uv] +package = true [tool.uv.workspace] members = [ - # Python wrapper package - "packages/py", # All example apps with "-py" suffix "example-apps/*-py" ] @@ -25,8 +57,8 @@ members = [ [tool.ruff] target-version = "py310" line-length = 88 - exclude = ["third_party/", "docs/", ".venv/"] + [tool.ruff.lint] select = [ "E", # pycodestyle errors diff --git a/test.jpg b/test.jpg new file mode 100755 index 000000000..9af4a552e Binary files /dev/null and b/test.jpg differ diff --git a/uv.lock b/uv.lock index b738142d0..21a5c8353 100644 --- a/uv.lock +++ b/uv.lock @@ -5,7 +5,6 @@ requires-python = ">=3.10" members = [ "console-py", "img2num", - "img2num-uv-workspace", ] [[package]] @@ -26,24 +25,21 @@ requires-dist = [ [[package]] name = "img2num" version = "0.0.0" -source = { editable = "packages/py" } +source = { editable = "." } dependencies = [ { name = "numpy" }, ] -[package.metadata] -requires-dist = [{ name = "numpy" }] - -[[package]] -name = "img2num-uv-workspace" -version = "0.0.0" -source = { virtual = "." } -dependencies = [ - { name = "img2num" }, +[package.optional-dependencies] +dev = [ + { name = "ruff" }, ] [package.metadata] -requires-dist = [{ name = "img2num", editable = "packages/py" }] +requires-dist = [ + { name = "numpy" }, + { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.4.0" }, +] [[package]] name = "numpy" @@ -124,3 +120,28 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fb/17/de5458312bcb07ddf434d7bfcb24bb52c59635ad58c6e7c751b48949b009/opencv_python-4.13.0.92-cp37-abi3-win32.whl", hash = "sha256:372fe164a3148ac1ca51e5f3ad0541a4a276452273f503441d718fab9c5e5f59", size = 30932638 }, { url = "https://files.pythonhosted.org/packages/e9/a5/1be1516390333ff9be3a9cb648c9f33df79d5096e5884b5df71a588af463/opencv_python-4.13.0.92-cp37-abi3-win_amd64.whl", hash = "sha256:423d934c9fafb91aad38edf26efb46da91ffbc05f3f59c4b0c72e699720706f5", size = 40212062 }, ] + +[[package]] +name = "ruff" +version = "0.15.15" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/84/6f/a76f7d96e5c962f5b69cee865e49c15c1116897c01990faa8a57edb62e7f/ruff-0.15.15.tar.gz", hash = "sha256:b8dff018130b46d8e5bf0f926ef6b60cf871d6d5ae45fc9334e09632daa741d6", size = 4706985 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fa/9d/3a45c05b8ab04b4705989de70a79008e27c8003296a0feaee9edc18dd7e9/ruff-0.15.15-py3-none-linux_armv6l.whl", hash = "sha256:cf93e5388f412e1b108b1f8b34a6e036b70fe8aff89393befad96fe48670311b", size = 10710652 }, + { url = "https://files.pythonhosted.org/packages/05/66/da974431624bf3b49f6ee1f9543c02d929ff1cba78b0d5a79c38cf21f744/ruff-0.15.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac5a646d1f6a7dadd5d50842dae2c1f9862ac887ef5d1b1375e02def791fde6e", size = 11096615 }, + { url = "https://files.pythonhosted.org/packages/8c/09/7443452e5d290230a712103f2fdceeef7184f3ec99a2bd01c8be78aaceb5/ruff-0.15.15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:77d955a431430c66f72dd94e379ad38a16daea3d25094872ac4edf9e797be530", size = 10436683 }, + { url = "https://files.pythonhosted.org/packages/53/01/d330c26a57fa4f3943a14424904027428315b700fe4d14a84bb123a649e5/ruff-0.15.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7614ee79c69788cf6cedd568069ade9cecc22a1ad20494efe8d0c9ebb4b622d4", size = 10769064 }, + { url = "https://files.pythonhosted.org/packages/1d/85/cc8770f8bdff541b1da8392d1634141fe4a0e3f4ee596605959b7906c27f/ruff-0.15.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3cdb1679e06a1f6b47bc384714ae96f6e2fb65ca441eb78c43d2ca554176ce1f", size = 10511987 }, + { url = "https://files.pythonhosted.org/packages/7c/29/8c190c1472b63013583ba391f3342036e02010544c1270455ed8e519bdf3/ruff-0.15.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2728b93d7b23a603ea2c0ac6eb73d760bd38ec9de35f35fb41e18f7a3fee7622", size = 11275100 }, + { url = "https://files.pythonhosted.org/packages/9f/6b/7e145ce2cc8e63d6834eca03d83a0e18d121def5c69f91b4cf4011ed4879/ruff-0.15.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be582fcc0db438902c7792b08d6ddf6c9b9e21addaa10092c2c741cfb09e5a45", size = 12176903 }, + { url = "https://files.pythonhosted.org/packages/80/a3/d5974637f68e451f7fadf015cf3101d1cd7d8ba5027cffe0b9e3826ebe6b/ruff-0.15.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7aa77465b8ecaf1a27bea098d696f7fed5e1eccbd10b321b682d6de586ae5627", size = 11404550 }, + { url = "https://files.pythonhosted.org/packages/fe/1c/e6e5e568f22be4fb05d6244234aba384c06b451252453b821e1a529263cf/ruff-0.15.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48decfa11d740de4889de623be1463308346312f2409a56e24aa280c86162dc4", size = 11382027 }, + { url = "https://files.pythonhosted.org/packages/1d/01/170921b49fcd2e8858825593f91cf7146c3e40a5c3e6df763e4bb0484dde/ruff-0.15.15-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a5015088452ca0081387063649ec67f06d3d1d6b8b936a1f836b5e9657ecd48c", size = 11366041 }, + { url = "https://files.pythonhosted.org/packages/87/54/a7bad711d7de93254e15e06a4c375b89a03d18de45d3e5dcc86a4472fb1a/ruff-0.15.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5294aab6356c81600fcdea3a62bb1b924dfd5e91767c12318d3f68f86af57cd", size = 10741795 }, + { url = "https://files.pythonhosted.org/packages/c9/31/38c075963668f8b41c6914ee0f6f318727fbe30ab9145cb29e6df464c5fa/ruff-0.15.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:db5bd4d802415cca656dc1616070b725952d6ae95eb5d4831e49fbd94a38f75f", size = 10511117 }, + { url = "https://files.pythonhosted.org/packages/9d/96/6ff689e1f7e375d1d97075eca022f74c2bab59554a432fe4d2e6f091986a/ruff-0.15.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:587a6278ed42059191c1a466e490bd7930fb50bd2e255398bc29616c895a61cb", size = 10994867 }, + { url = "https://files.pythonhosted.org/packages/c3/c2/5dce0ab9f92a8d534fa62b9bf9caca3eddb8c1a81b616f5e195ada4f0d6e/ruff-0.15.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:df0c1c084f5f4be9812f61518a45c440d3c30d69ce4bf6c5270e66d38338f02a", size = 11482101 }, + { url = "https://files.pythonhosted.org/packages/b1/c0/1003b60edd697c649faf61f1a34094b1abb38fb3d1181e3f895781250a08/ruff-0.15.15-py3-none-win32.whl", hash = "sha256:29428ea79694afbe756d45fd59b36f22b6b020dc0443cf7de0173046236964b9", size = 10716774 }, + { url = "https://files.pythonhosted.org/packages/02/a8/1269eddd6945a06c23f055ef7848886e37cf9d6a8bebb386a3115f01470c/ruff-0.15.15-py3-none-win_amd64.whl", hash = "sha256:8df0323902e15e24bc4bf246da830573d3cf3352bd0b9a164eab335d111ff4a4", size = 11868463 }, + { url = "https://files.pythonhosted.org/packages/4e/b2/920464c907b191e37469d477a1aa8bc048b8f36c4c1610dfa4ab87b39e18/ruff-0.15.15-py3-none-win_arm64.whl", hash = "sha256:3c8ceca6792f38196b8f589bc92eccd03eef286602da92e5dc05cc42ef6441b7", size = 11138498 }, +]