Make marinholab and marinholab.sas namespace packages - #12
Merged
Merged
Conversation
marinholab/__init__.py and marinholab/sas/__init__.py made both regular packages. Installed next to another distribution with a marinholab.* package, the regular package wins and hides the other: with marinholab-sas-core installed, `import marinholab.ur3e_r820` fails (MarinhoLab/ur3e_r820), and so would marinholab.solvers if marinholab-solvers-qpoases were installed in a directory searched later. marinholab-solvers-qpoases already leaves its marinholab/ without an __init__.py. - Delete both __init__.py; they held only a docstring. - pyproject: packages.find with namespaces = true (the default, now explicit and explained) is the one package list; setup.py's explicit `packages=` list, which also missed marinholab.sas.core.modeling, goes. - CI smoke test: import marinholab.sas.core next to a marinholab.other_package on PYTHONPATH and assert that neither marinholab nor marinholab.sas has a __file__. It fails on the published 26.9.13 and passes here. The wheel holds the same files as before minus the two __init__.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
marinholab/__init__.pyandmarinholab/sas/__init__.pymade bothmarinholabandmarinholab.sasregular packages. Whenmarinholab-sas-coreis installed alongside another distribution that has amarinholab.*package, Python finds the regular package first and hides the other distribution's subpackages:This currently breaks mmmarinho/ur3e_r820:
marinholab.ur3e_r820can't be imported in any environment that hasmarinholab-sas-core. That includesghcr.io/marinholab/sas-full:jazzy, whose ROSsas_corepackage needsmarinholab-sas-core.marinholab-solvers-qpoasesalready leaves itsmarinholab/without an__init__.py.Changes
marinholab/__init__.pyandmarinholab/sas/__init__.py. They held only a docstring. Both directories are now PEP 420 namespace packages.[tool.setuptools.packages.find]inpyproject.tomlis now the only list, withnamespaces = true(the default, now explicit, with a comment explaining why). The explicitpackages=list insetup.pyis removed; it also left outmarinholab.sas.core.modeling.marinholab.sas.corenext to amarinholab.other_packageonPYTHONPATH, and asserts that neithermarinholabnormarinholab.sashas a__file__.Testing
python -m build --wheel(macOS arm64, Python 3.14) gives the same files as before, minus the two__init__.py.marinholab.*packages: I installed this wheel withmarinholab-solvers-qpoases26.4.0.64 anddqrobotics26.4.0a7, plusmarinholab.ur3e_r820from source.marinholab.sas.core,marinholab.solvers.qpoasesandmarinholab.ur3e_r820import together. curve_revolution_vfi's tests that useSerialManipulatorSimulatorFriendlypass (27), and ur3e_r820's Python tests pass (33).cd docker && docker compose run --rm --build marinholab_sas_corepasses all its checks: API, finite-difference Jacobian, examples, no linked dqrobotics shared library, installed files.🤖 Generated with Claude Code