Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved support for moved/renamed/deprecated modules #3385

Open
wants to merge 186 commits into
base: main
Choose a base branch
from

Conversation

jsiirola
Copy link
Member

Fixes # .

Summary/Motivation:

NOTE: This PR is built on #3382. Please review / merge that PR before looking at this one. If you want to get a head start, you can compare this branch against the doc-reorg branch.

This PR replaces pyomo.common.deprecation.relocated_module() with pyomo.common.deprecation.moved_module(). The new functionality supports renamed / moved / deprecated modules through a plugin to the importlib system (instead of hacking sys.modules). This:

  • is more robust
  • allows us to remove stub files that have been accumulating in the codebase
  • silence all deprecation warnings that are currently being emitted when building the documentation
  • removes the deprecated modules from the online documentation Library Reference
  • supports deprecation paths for more complex module reorganizations (e.g., converting all plugins directories into plugins.py modules)

Changes proposed in this PR:

  • deprecate pyomo.common.deprecation.relocated_module()
  • add pyomo.common.deprecation.moved_module().
  • remove deprecated "stub" modules
  • move deprecated modules that import specific functionality into the pyomo._archive directory
  • rename pyomo/__future__.py -> pyomo.future.py
    • continue to support from pyomo.__future__ import ...
    • this resolves exceptions when attempting to run python within the pyomo/pyomo directory.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

jsiirola and others added 30 commits June 4, 2024 11:06
jsiirola and others added 30 commits October 11, 2024 13:58
Alternative Solutions documentation add
This prevents conflicts with the main Python __future__ when the CWD is pyomo/pyomo
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.

4 participants