MonkeyCanCode opened a new pull request, #2557: URL: https://github.com/apache/polaris/pull/2557
This PR addresses the binary distribution issue described in [#2419](https://github.com/apache/polaris/issues/2419) . The goal is to include only the files required for an end-user to build the client locally (the repository already supports wheel distribution). For the `sdist` build, this PR takes a slightly different approach than the symbolic link solution proposed in [#2419]. Instead of using symbolic links, it copies the necessary files from the project root into the client directory (if they do not already exist) and then uses that directory during `sdist` mode. This approach avoids errors caused by Poetry’s path checks, since symbolic links pointing outside the client directory fail validation. Tests: Setup environment and build client distribution: ``` ➜ polaris git:(client_openapi_symbolic_link) ✗ make client-build Setting up Python virtual environment at .venv... Virtual environment created. Installing Poetry and project dependencies into .venv... .... Installing the current project: polaris (1.0.0)Preparing build environment with build-system requirements poetry-core>=2.0.0,<3.0.0, openapi-generator-cli==7.11.0.post0 Preparing spec directory... Spec directory already exists. Deleting old tests... Old test deletion complete. Re-applying license headers... License fix complete. Installing the current project: polaris (1.0.0) Poetry and dependencies installed. --- Building client distribution --- Building polaris (1.0.0) Building sdist Building wheel --- Client distribution build complete --- ``` Setup venv for testing sdist installation and install via sdist: ``` ➜ Desktop mkdir polaris_distribution_test_tar_gz && polaris_distribution_test_tar_gz ➜ polaris_distribution_test_tar_gz python3 -m venv venv ➜ polaris_distribution_test_tar_gz source venv/bin/activate (venv) ➜ polaris_distribution_test_tar_gz pip install ~/Desktop/GitHome/polaris/client/python/dist/*.tar.gz Processing /Users/yong/Desktop/GitHome/polaris/client/python/dist/polaris-1.0.0.tar.gz Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting boto3<1.41.0,>=1.40.6 (from polaris==1.0.0) Using cached boto3-1.40.30-py3-none-any.whl.metadata (6.7 kB) Collecting pydantic>=2.0.0 (from polaris==1.0.0) Using cached pydantic-2.11.9-py3-none-any.whl.metadata (68 kB) Collecting python-dateutil>=2.8.2 (from polaris==1.0.0) Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB) Collecting typing-extensions>=4.7.1 (from polaris==1.0.0) Using cached typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB) Collecting urllib3<3.0.0,>=1.25.3 (from polaris==1.0.0) Using cached urllib3-2.5.0-py3-none-any.whl.metadata (6.5 kB) Collecting botocore<1.41.0,>=1.40.30 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached botocore-1.40.30-py3-none-any.whl.metadata (5.7 kB) Collecting jmespath<2.0.0,>=0.7.1 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB) Collecting s3transfer<0.15.0,>=0.14.0 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached s3transfer-0.14.0-py3-none-any.whl.metadata (1.7 kB) Collecting annotated-types>=0.6.0 (from pydantic>=2.0.0->polaris==1.0.0) Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB) Collecting pydantic-core==2.33.2 (from pydantic>=2.0.0->polaris==1.0.0) Using cached pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl.metadata (6.8 kB) Collecting typing-inspection>=0.4.0 (from pydantic>=2.0.0->polaris==1.0.0) Using cached typing_inspection-0.4.1-py3-none-any.whl.metadata (2.6 kB) Collecting six>=1.5 (from python-dateutil>=2.8.2->polaris==1.0.0) Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB) Using cached boto3-1.40.30-py3-none-any.whl (139 kB) Using cached pydantic-2.11.9-py3-none-any.whl (444 kB) Using cached pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB) Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB) Using cached typing_extensions-4.15.0-py3-none-any.whl (44 kB) Using cached urllib3-2.5.0-py3-none-any.whl (129 kB) Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB) Using cached botocore-1.40.30-py3-none-any.whl (14.0 MB) Using cached jmespath-1.0.1-py3-none-any.whl (20 kB) Using cached s3transfer-0.14.0-py3-none-any.whl (85 kB) Using cached six-1.17.0-py2.py3-none-any.whl (11 kB) Using cached typing_inspection-0.4.1-py3-none-any.whl (14 kB) Building wheels for collected packages: polaris Building wheel for polaris (pyproject.toml) ... done Created wheel for polaris: filename=polaris-1.0.0-cp313-cp313-macosx_15_0_arm64.whl size=533930 sha256=c8bf7bc870b91fb5a6038a84ff2433d30a0344f545c2889fd6ccf0bbfecc58b8 Stored in directory: /Users/yong/Library/Caches/pip/wheels/b8/f1/20/1dd4b05f93820742954b32d0d44f211007e0d06e5742927628 Successfully built polaris Installing collected packages: urllib3, typing-extensions, six, jmespath, annotated-types, typing-inspection, python-dateutil, pydantic-core, pydantic, botocore, s3transfer, boto3, polaris Successfully installed annotated-types-0.7.0 boto3-1.40.30 botocore-1.40.30 jmespath-1.0.1 polaris-1.0.0 pydantic-2.11.9 pydantic-core-2.33.2 python-dateutil-2.9.0.post0 s3transfer-0.14.0 six-1.17.0 typing-extensions-4.15.0 typing-inspection-0.4.1 urllib3-2.5.0 [notice] A new release of pip is available: 24.2 -> 25.2 [notice] To update, run: pip install --upgrade pip ``` Setup venv for testing wheel installation and install via wheel: ``` ➜ Desktop mkdir polaris_distribution_test_wheel && polaris_distribution_test_wheel ➜ polaris_distribution_test_wheel python3 -m venv venv ➜ polaris_distribution_test_wheel source venv/bin/activate (venv) ➜ polaris_distribution_test_wheel pip install ~/Desktop/GitHome/polaris/client/python/dist/*.whl Processing /Users/yong/Desktop/GitHome/polaris/client/python/dist/polaris-1.0.0-cp313-cp313-macosx_15_0_arm64.whl Collecting boto3<1.41.0,>=1.40.6 (from polaris==1.0.0) Using cached boto3-1.40.30-py3-none-any.whl.metadata (6.7 kB) Collecting pydantic>=2.0.0 (from polaris==1.0.0) Using cached pydantic-2.11.9-py3-none-any.whl.metadata (68 kB) Collecting python-dateutil>=2.8.2 (from polaris==1.0.0) Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB) Collecting typing-extensions>=4.7.1 (from polaris==1.0.0) Using cached typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB) Collecting urllib3<3.0.0,>=1.25.3 (from polaris==1.0.0) Using cached urllib3-2.5.0-py3-none-any.whl.metadata (6.5 kB) Collecting botocore<1.41.0,>=1.40.30 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached botocore-1.40.30-py3-none-any.whl.metadata (5.7 kB) Collecting jmespath<2.0.0,>=0.7.1 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB) Collecting s3transfer<0.15.0,>=0.14.0 (from boto3<1.41.0,>=1.40.6->polaris==1.0.0) Using cached s3transfer-0.14.0-py3-none-any.whl.metadata (1.7 kB) Collecting annotated-types>=0.6.0 (from pydantic>=2.0.0->polaris==1.0.0) Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB) Collecting pydantic-core==2.33.2 (from pydantic>=2.0.0->polaris==1.0.0) Using cached pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl.metadata (6.8 kB) Collecting typing-inspection>=0.4.0 (from pydantic>=2.0.0->polaris==1.0.0) Using cached typing_inspection-0.4.1-py3-none-any.whl.metadata (2.6 kB) Collecting six>=1.5 (from python-dateutil>=2.8.2->polaris==1.0.0) Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB) Using cached boto3-1.40.30-py3-none-any.whl (139 kB) Using cached pydantic-2.11.9-py3-none-any.whl (444 kB) Using cached pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB) Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB) Using cached typing_extensions-4.15.0-py3-none-any.whl (44 kB) Using cached urllib3-2.5.0-py3-none-any.whl (129 kB) Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB) Using cached botocore-1.40.30-py3-none-any.whl (14.0 MB) Using cached jmespath-1.0.1-py3-none-any.whl (20 kB) Using cached s3transfer-0.14.0-py3-none-any.whl (85 kB) Using cached six-1.17.0-py2.py3-none-any.whl (11 kB) Using cached typing_inspection-0.4.1-py3-none-any.whl (14 kB) Installing collected packages: urllib3, typing-extensions, six, jmespath, annotated-types, typing-inspection, python-dateutil, pydantic-core, pydantic, botocore, s3transfer, boto3, polaris Successfully installed annotated-types-0.7.0 boto3-1.40.30 botocore-1.40.30 jmespath-1.0.1 polaris-1.0.0 pydantic-2.11.9 pydantic-core-2.33.2 python-dateutil-2.9.0.post0 s3transfer-0.14.0 six-1.17.0 typing-extensions-4.15.0 typing-inspection-0.4.1 urllib3-2.5.0 [notice] A new release of pip is available: 24.2 -> 25.2 [notice] To update, run: pip install --upgrade pip ``` Validation: ``` (venv) ➜ polaris_distribution_test_tar_gz echo $? 0 (venv) ➜ polaris_distribution_test_tar_gz polaris --profile dev principals list {"name": "root", "clientId": "root", "properties": {}, "createTimestamp": 1757783585213, "lastUpdateTimestamp": 1757783585213, "entityVersion": 1} (venv) ➜ polaris_distribution_test_wheel polaris --profile dev principals list {"name": "root", "clientId": "root", "properties": {}, "createTimestamp": 1757783585213, "lastUpdateTimestamp": 1757783585213, "entityVersion": 1} (venv) ➜ polaris_distribution_test_wheel echo $? 0 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org