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

DEP: drop runtime dependency on setuptools #2511

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions glue/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
# where ``setup`` is a function that does whatever is needed to set up the
# plugin, such as add items to various registries.

import setuptools
logger.info("Loading external plugins using "
"setuptools=={0}".format(setuptools.__version__))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep 'Loading external plugins' - just don't give the setuptools version

logger.info("Loading external plugins")

from glue._plugin_helpers import iter_plugin_entry_points, PluginConfig
config = PluginConfig.load()
Expand Down Expand Up @@ -72,21 +70,9 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
if not config.plugins[item.name]:
continue

# We don't use item.load() because that then checks requirements of all
# the imported packages, which can lead to errors like this one that
# don't really matter:
#
# Exception: (pytest 2.6.0 (/Users/tom/miniconda3/envs/py27/lib/python2.7/site-packages),
# Requirement.parse('pytest>=2.8'), set(['astropy']))
#
# Just to be clear, this kind of error does indicate that there is an
# old version of a package in the environment, but this can confuse
# users as importing astropy directly would work (as setuptools then
# doesn't do a stringent test of dependency versions). Often this kind
# of error can occur if there is a conda version of a package and an
# older pip version.

try:
# item.load() (importlib.metadata.EntryPoint.load) doesn't *always*
# return a module, so, using import_module is safer here.
module = import_module(item.module)
function = getattr(module, item.attr)
function()
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ install_requires =
echo>=0.6
astropy>=4.0
fast_histogram>=0.12
setuptools>=30.3.0
ipython>=4.0
dill>=0.2
h5py>=2.10; python_version<'3.11'
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ deps =
legacy: pandas==1.2.*
legacy: echo==0.5.*
legacy: astropy==4.0.*
legacy: setuptools==30.3.*
legacy: ipython==7.16.*
legacy: ipykernel==5.3.*
legacy: dill==0.2.*
legacy: xlrd==1.2.*
legacy: h5py==2.10.*
legacy: mpl-scatter-density==0.7.*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is now a natural follow up to #2521

legacy: mpl-scatter-density==0.8.*
legacy: openpyxl==3.0.*
extras =
test
Expand Down
Loading