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

Discontinue package #14

Merged
merged 1 commit into from
Dec 6, 2023
Merged

Discontinue package #14

merged 1 commit into from
Dec 6, 2023

Conversation

taldcroft
Copy link
Member

Description

This addresses one action in sot/kadi#230.

Interface impacts

Importing package raises an exception unless SKA_ALLOW_DISCONTINUED_PACKAGES=1.

Testing

Unit tests

No testing on discontinued package.

Functional tests

No functional testing.

(ska3) ➜  ska_parsecm git:(master) ✗ ipython
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:27:35) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ska_parse_cm
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ska_parse_cm

ModuleNotFoundError: No module named 'ska_parse_cm'

In [2]: import ska_parsecm
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[2], line 1
----> 1 import ska_parsecm

File ~/git/ska_parsecm/ska_parsecm/__init__.py:19
     17     warnings.warn(message_warn, FutureWarning)
     18 else:
---> 19     raise RuntimeError(message_warn + message_error)
     21 import ska_helpers
     23 from .ParseCM import *  # noqa

RuntimeError: 
The ska_parsecm package is no longer supported and is replaced
by parse_cm. Please update your code accordingly.

To temporarily continue using this package set the environment variable
SKA_ALLOW_DISCONTINUED_PACKAGES=1

In [3]: import os

In [4]: os.environ["SKA_ALLOW_DISCONTINUED_PACKAGES"] = "1"

In [5]: import ska_parsecm
/Users/aldcroft/git/ska_parsecm/ska_parsecm/__init__.py:17: FutureWarning: 
The ska_parsecm package is no longer supported and is replaced
by parse_cm. Please update your code accordingly.

  warnings.warn(message_warn, FutureWarning)
/Users/aldcroft/git/ska_parsecm/ska_parsecm/ParseCM.py:8: FutureWarning: ska_parsecm is deprecated, use parse_cm instead
  warnings.warn('ska_parsecm is deprecated, use parse_cm instead', FutureWarning)

In [6]:                                                                                                                                                      

@javierggt
Copy link
Contributor

javierggt commented Dec 6, 2023

One detail I realized after approving is that documentation will not build unless SKA_ALLOW_DISCONTINUED_PACKAGES is set.

One would need to add the following to .github/workflows/docs.yml or make the docs by hand:

    env:
      SKA_ALLOW_DISCONTINUED_PACKAGES: 1

However, I have not tested that this change to docs.yml actually works.

@jeanconn
Copy link

jeanconn commented Dec 6, 2023

With regard to really deprecating things, I was worried that we might have old bin-files hanging around, like get_cmd_states from Chandra.cmd_states/chandra_cmd_states that hadn't been removed. But I can't actually find that in ska3/flight so I guess we don't need to worry about anybody using it!

@javierggt
Copy link
Contributor

Scratch that, the change in docs.yml does not work. We can just build the docs by hand.

@jeanconn
Copy link

jeanconn commented Dec 6, 2023

And in a review of repos that still have Ska.ParseCM -- it looks like
psmc_check => not run
pftank2_check => not run
star_stat_db => still running but out of ska2 anyway

@taldcroft taldcroft merged commit df0d5b6 into master Dec 6, 2023
@taldcroft taldcroft deleted the discontinue-package branch December 6, 2023 18:59
@javierggt javierggt mentioned this pull request Mar 6, 2024
@javierggt javierggt mentioned this pull request Jun 26, 2024
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.

3 participants