Skip to content

Conversation

@aryanpatel2121
Copy link

What this PR does

This PR updates python-brlcad to work with modern Python 3 versions.
While trying to install the package on Python 3, I ran into several
issues related to Python 2–only syntax, deprecated modules, and outdated
packaging assumptions. This PR fixes those problems so the project can
be installed and used with current Python tooling.

Changes included

  • Updated Python 2 syntax to Python 3:
    • print statements → print()
    • raw_input()input()
    • xrange()range()
  • Replaced the deprecated imp module with importlib.util
  • Updated ctypesgencore usage to match the current ctypesgen
    package structure available on PyPI
  • Fixed relative imports in the install scripts
  • Modernized setup.py by:
    • Replacing ctypesgen-dev with ctypesgen
    • Removing deprecated dependency_links
    • Making library path detection work with wheel-based installs
      (not only .egg layouts)

Why this change is needed

On Python 3.11 (macOS), pip install . fails due to Python 2 syntax
and deprecated modules that have been removed in recent Python
versions. These changes allow the package to install and progress
to the expected runtime checks for an existing BRL-CAD installation.

Testing

  • Tested locally on macOS with Python 3.11
  • Verified that the package installs and compiles without syntax errors
  • Runtime still requires BRL-CAD to be installed, which appears to be
    the expected behavior

Please let me know if you’d like this split into smaller PRs or
adjusted in any way. I’m happy to update it based on feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant