From 71aa306ef7652b7c84967872624e04fe80f74a74 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Wed, 15 Jan 2025 10:21:55 -0700 Subject: [PATCH] remove DesiTest --- doc/changes.rst | 4 +++- setup.py | 52 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/doc/changes.rst b/doc/changes.rst index b02eadf7..a79a1eef 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -6,7 +6,9 @@ fiberassign change log 5.7.3 (unreleased) ------------------ -* No changes yet. +* Remove ``DesiTest`` from setup.py and warn about other deprecated features (PR `#466`_). + +.. _`#466`: https://github.com/desihub/fiberassign/pull/466 5.7.2 (2023-10-04) ------------------ diff --git a/setup.py b/setup.py index 5254df1a..3fa0446f 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # # DESI support code. # -from desiutil.setup import DesiTest, DesiVersion, get_version +from desiutil.setup import get_version # # Begin setup # @@ -77,8 +77,7 @@ # setup_keywords['use_2to3'] = False setup_keywords['packages'] = find_packages('py') setup_keywords['package_dir'] = {'': 'py'} -setup_keywords['cmdclass'] = {'version': DesiVersion, 'test': DesiTest, - 'sdist': DistutilsSdist} +setup_keywords['cmdclass'] = {'sdist': DistutilsSdist} test_suite_name = \ '{name}.test.{name}_test_suite.{name}_test_suite'.format(**setup_keywords) setup_keywords['test_suite'] = test_suite_name @@ -226,11 +225,56 @@ def build_extensions(self): setup_keywords['ext_modules'] = ext_modules setup_keywords['cmdclass']['build_ext'] = BuildExt setup_keywords['cmdclass']['clean'] = RealClean - +# # Add internal data directories # setup_keywords['package_data'] = {'fiberassign': ['data/*',],} +# +# Warning about old features. +# +VERSION_HELP = """ +Note: Generating version strings is no longer done using 'python setup.py version'. Instead +you will need to run: + + desi_update_version [-t TAG] desiutil + +which is part of the desiutil package. If you don't already have desiutil installed, you can install it with: + + pip install desiutil +""" + +TEST_HELP = """ +Note: running tests is no longer done using 'python setup.py test'. Instead +you will need to run: + + pytest + +If you don't already have pytest installed, you can install it with: + + pip install pytest +""" + +DOCS_HELP = """ +Note: building the documentation is no longer done using +'python setup.py {0}'. Instead you will need to run: + + sphinx-build -W --keep-going -b html doc doc/_build/html + +If you don't already have Sphinx installed, you can install it with: + + pip install Sphinx +""" + +message = {'test': TEST_HELP, + 'version': VERSION_HELP, + 'build_docs': DOCS_HELP.format('build_docs'), + 'build_sphinx': DOCS_HELP.format('build_sphinx'), } + +for m in message: + if m in sys.argv: + print(message[m]) + sys.exit(1) # # Run setup command.