Skip to content

Commit 471053f

Browse files
authored
Merge pull request #3071 from neutrinoceros/dep/ditch_setuptools
DEP: refactored out runtime dependency on setuptools
2 parents d347559 + 01be4bd commit 471053f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Infrastructure, Utility and Other Changes and Additions
140140

141141
- Versions of PyVO <1.5 are no longer supported. [#3002]
142142

143+
- Dropped ``setuptools`` as a runtime dependency. [#3071]
144+
143145
utils.tap
144146
^^^^^^^^^
145147

astroquery/alma/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import string
99
import requests
1010
import warnings
11+
import importlib.resources as importlib_resources
1112

12-
from pkg_resources import resource_filename
1313
from bs4 import BeautifulSoup
1414
import pyvo
1515
from urllib.parse import urljoin
@@ -1183,10 +1183,9 @@ def cycle0_table(self):
11831183
Stoehr.
11841184
"""
11851185
if not hasattr(self, '_cycle0_table'):
1186-
filename = resource_filename(
1187-
'astroquery.alma', 'data/cycle0_delivery_asdm_mapping.txt')
1188-
1189-
self._cycle0_table = Table.read(filename, format='ascii.no_header')
1186+
ref = importlib_resources.files('astroquery.alma') / 'data' / 'cycle0_delivery_asdm_mapping.txt'
1187+
with importlib_resources.as_file(ref) as path:
1188+
self._cycle0_table = Table.read(path, format='ascii.no_header')
11901189
self._cycle0_table.rename_column('col1', 'ID')
11911190
self._cycle0_table.rename_column('col2', 'uid')
11921191
return self._cycle0_table

astroquery/ipac/nexsci/nasa_exoplanet_archive/tests/test_nasa_exoplanet_archive.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from urllib.parse import urlencode
66

77
import astropy.units as u
8-
import pkg_resources
98
import pytest
109
import requests
1110

@@ -17,8 +16,7 @@
1716
except ImportError:
1817
pytest.skip("Install mock for the nasa_exoplanet_archive tests.", allow_module_level=True)
1918

20-
MAIN_DATA = pkg_resources.resource_filename("astroquery.ipac.nexsci.nasa_exoplanet_archive", "data")
21-
TEST_DATA = pkg_resources.resource_filename(__name__, "data")
19+
TEST_DATA = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))
2220
RESPONSE_FILE = os.path.join(TEST_DATA, "responses.json")
2321

2422
# API accessible tables will gradually transition to TAP service

0 commit comments

Comments
 (0)