From 023842a66bdac4fcf3c53ccbf9476a4d2a71ff29 Mon Sep 17 00:00:00 2001 From: Stephen McGinty Date: Tue, 6 Aug 2024 15:57:38 +0100 Subject: [PATCH] Another OM release attempt --- .github/workflows/publish.yml | 3 +-- python/origen_metal/pyproject.toml | 16 ++++++------ python/origen_metal/setup.py | 41 ++++++++++++++++++++++++++++++ rust/origen_metal/Cargo.toml | 2 +- rust/pyapi/Cargo.lock | 12 ++++++++- rust/pyapi_metal/Cargo.lock | 12 ++++++++- rust/pyapi_metal/Cargo.toml | 2 +- rust/pyapi_metal/pyproject.toml | 1 + 8 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 python/origen_metal/setup.py create mode 120000 rust/pyapi_metal/pyproject.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9a189fbf..5fb8e8df 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -101,12 +101,11 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: - working-directory: python/origen_metal target: x86_64 manylinux: auto # This is required to fix an SSL build error before-script-linux: yum install perl-IPC-Cmd -y - args: --release --strip --out dist --manifest-path ../../rust/pyapi_metal/Cargo.toml --interpreter python${{ matrix.python-version }} + args: --release --strip --out dist --manifest-path rust/pyapi_metal/Cargo.toml --interpreter python${{ matrix.python-version }} - name: Install Poetry run: | pip install poetry==1.3.2 diff --git a/python/origen_metal/pyproject.toml b/python/origen_metal/pyproject.toml index 1b7aeaa0..3667817d 100644 --- a/python/origen_metal/pyproject.toml +++ b/python/origen_metal/pyproject.toml @@ -1,15 +1,11 @@ [tool.poetry] name = "origen_metal" -version = "0.4.1-dev2" +version = "0.4.1-dev3" description = "Bare metal APIs for the Origen SDK" homepage = "https://origen-sdk.org/o2" license = "MIT" readme = "README.md" authors = ["Origen-SDK"] -#include = [ -# "origen_metal/_origen_metal.pyd", # Windows -# "origen_metal/_origen_metal.so", # Linux -#] [tool.poetry.dependencies] python = ">=3.7.0,<3.13" @@ -32,9 +28,13 @@ markers = [ "ldap: marks tests requiring/using the external ldap", ] -[tool.poetry.build] -script = "poetry_build.py" -generate-setup-file = false +# SMcG - Commented out, breaks regression (setting up test/python_app env) +#[tool.poetry.build] +#script = "poetry_build.py" +#generate-setup-file = false + +[tool.maturin] +module-name = "origen_metal._origen_metal" # This needs to be present to build for Linux, but does not work # for the current Windows build flow diff --git a/python/origen_metal/setup.py b/python/origen_metal/setup.py new file mode 100644 index 00000000..8a454938 --- /dev/null +++ b/python/origen_metal/setup.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +from setuptools import setup + +packages = \ +['origen_metal', + 'origen_metal._helpers', + 'origen_metal.framework', + 'origen_metal.frontend', + 'origen_metal.utils', + 'origen_metal.utils.revision_control', + 'origen_metal.utils.revision_control.supported'] + +package_data = \ +{'': ['*'], 'origen_metal': ['.pytest_cache/*', '.pytest_cache/v/cache/*']} + +install_requires = \ +['colorama>=0.4.4', 'importlib-metadata>=6.7.0', 'termcolor>=1.1.0'] + +extras_require = \ +{':sys_platform == "win32"': ['pyreadline3>=3.3,<4.0']} + +setup_kwargs = { + 'name': 'origen-metal', + 'version': '0.4.1.dev2', + 'description': 'Bare metal APIs for the Origen SDK', + 'long_description': '', + 'author': 'Origen-SDK', + 'author_email': 'None', + 'maintainer': 'None', + 'maintainer_email': 'None', + 'url': 'https://origen-sdk.org/o2', + 'packages': packages, + 'package_data': package_data, + 'install_requires': install_requires, + 'extras_require': extras_require, + 'python_requires': '>=3.7.0,<3.13', +} +from poetry_build import * +build(setup_kwargs) + +setup(**setup_kwargs) diff --git a/rust/origen_metal/Cargo.toml b/rust/origen_metal/Cargo.toml index bcc0f910..6ff9bbcb 100644 --- a/rust/origen_metal/Cargo.toml +++ b/rust/origen_metal/Cargo.toml @@ -24,7 +24,7 @@ time = "0.1" termcolor = "1" regex = "1" tempfile = "3" -pyo3 = {version = "0.19.1", features = ["extension-module"], optional = true} +pyo3 = {version = "0.19.1", features = ["extension-module", "generate-import-lib"], optional = true} serde = {version = "1.0", features = ["derive"]} toml = "0.5" toml_edit = "0.21.0" diff --git a/rust/pyapi/Cargo.lock b/rust/pyapi/Cargo.lock index 468dd9fa..ca9fccab 100644 --- a/rust/pyapi/Cargo.lock +++ b/rust/pyapi/Cargo.lock @@ -2579,7 +2579,7 @@ dependencies = [ [[package]] name = "origen-metal" -version = "0.4.0" +version = "0.4.1-dev3" dependencies = [ "built", "curl-sys", @@ -3080,6 +3080,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" dependencies = [ "once_cell", + "python3-dll-a", "target-lexicon", ] @@ -3116,6 +3117,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "python3-dll-a" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0b78171a90d808b319acfad166c4790d9e9759bbc14ac8273fe133673dd41b" +dependencies = [ + "cc", +] + [[package]] name = "quick-error" version = "1.2.3" diff --git a/rust/pyapi_metal/Cargo.lock b/rust/pyapi_metal/Cargo.lock index fb8cf03a..582947f3 100644 --- a/rust/pyapi_metal/Cargo.lock +++ b/rust/pyapi_metal/Cargo.lock @@ -1997,7 +1997,7 @@ dependencies = [ [[package]] name = "origen-metal" -version = "0.4.1-dev2" +version = "0.4.1-dev3" dependencies = [ "built", "curl-sys", @@ -2384,6 +2384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076c73d0bc438f7a4ef6fdd0c3bb4732149136abd952b110ac93e4edb13a6ba5" dependencies = [ "once_cell", + "python3-dll-a", "target-lexicon", ] @@ -2420,6 +2421,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "python3-dll-a" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0b78171a90d808b319acfad166c4790d9e9759bbc14ac8273fe133673dd41b" +dependencies = [ + "cc", +] + [[package]] name = "quote" version = "1.0.36" diff --git a/rust/pyapi_metal/Cargo.toml b/rust/pyapi_metal/Cargo.toml index cb983f71..98d3701c 100644 --- a/rust/pyapi_metal/Cargo.toml +++ b/rust/pyapi_metal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "origen-metal" -version = "0.4.1-dev2" +version = "0.4.1-dev3" edition = "2021" authors = ["Origen-SDK"] diff --git a/rust/pyapi_metal/pyproject.toml b/rust/pyapi_metal/pyproject.toml new file mode 120000 index 00000000..e095ff7a --- /dev/null +++ b/rust/pyapi_metal/pyproject.toml @@ -0,0 +1 @@ +../../python/origen_metal/pyproject.toml \ No newline at end of file