Skip to content

Commit

Permalink
DEP: refactored out runtime dependency on setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jul 19, 2024
1 parent 2a27dff commit 01be4bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ Infrastructure, Utility and Other Changes and Additions

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

- Dropped ``setuptools`` as a runtime dependency. [#3071]

utils.tap
^^^^^^^^^

Expand Down
9 changes: 4 additions & 5 deletions astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import string
import requests
import warnings
import importlib.resources as importlib_resources

from pkg_resources import resource_filename
from bs4 import BeautifulSoup
import pyvo
from urllib.parse import urljoin
Expand Down Expand Up @@ -1183,10 +1183,9 @@ def cycle0_table(self):
Stoehr.
"""
if not hasattr(self, '_cycle0_table'):
filename = resource_filename(
'astroquery.alma', 'data/cycle0_delivery_asdm_mapping.txt')

self._cycle0_table = Table.read(filename, format='ascii.no_header')
ref = importlib_resources.files('astroquery.alma') / 'data' / 'cycle0_delivery_asdm_mapping.txt'
with importlib_resources.as_file(ref) as path:
self._cycle0_table = Table.read(path, format='ascii.no_header')
self._cycle0_table.rename_column('col1', 'ID')
self._cycle0_table.rename_column('col2', 'uid')
return self._cycle0_table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from urllib.parse import urlencode

import astropy.units as u
import pkg_resources
import pytest
import requests

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

MAIN_DATA = pkg_resources.resource_filename("astroquery.ipac.nexsci.nasa_exoplanet_archive", "data")
TEST_DATA = pkg_resources.resource_filename(__name__, "data")
TEST_DATA = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))
RESPONSE_FILE = os.path.join(TEST_DATA, "responses.json")

# API accessible tables will gradually transition to TAP service
Expand Down

0 comments on commit 01be4bd

Please sign in to comment.