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

Issue #89: Check Basilisk version on import #93

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

Mark2000
Copy link
Contributor

@Mark2000 Mark2000 commented Dec 5, 2023

Description

Closes #89

Checks if BSK is at least the version specified in bsk_version_req.txt. BSK should have beta releases labelled soon, which

How should this pull request be reviewed?

  • By commit
  • All changes at once

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Manually tested install in various configs.

  • Unit tests (General Environment only) pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/unittest
  • Integrated tests (General Environment only) pytest --cov bsk_rl/envs/general_satellite_tasking --cov-report term-missing tests/integration

Test Configuration

  • Python: 3.10.11
  • Basilisk: 2.2.1b0
  • Platform: MacOS 13.3.1

Checklist:

  • My code follows the style guidelines of this project (passes Black, ruff, and isort)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Commit messages are atomic, are in the form Issue #XXX: Message and have a useful message
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Mark2000 Mark2000 force-pushed the feature/89-check-bsk-version branch from 05c86ed to 311007e Compare December 5, 2023 23:34
@Mark2000 Mark2000 requested a review from johnowagon December 5, 2023 23:34
@johnowagon
Copy link
Contributor

My only gripe is that this raises a new warning for me:

/Users/johnaldrete/AVS/bsk_rl/src/bsk_rl/check_bsk_version.py:4: 
DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

Other than that I see no real issues. Is this the most practical way of checking for the version for a library like Basilisk? I wonder if there is a way to add it as a dependency in the pyproject.toml, might just be speculation.

@Mark2000
Copy link
Contributor Author

Mark2000 commented Dec 6, 2023

I’ll switch to importlib before merging, for some reason I don’t get the warning about pkg_resources.

Will document some rationale here:

We could have it as a requirement, but since bsk and bsk_rl are often developed together (i.e. i rarely run the install script for rl or recompile bsk), checking on import seems best because I don’t have any other way of knowing that bsk_rl needs a new version of bsk pulled and compiled until something breaks.

The other benefit of not including bsk in the toml requirements is that bsk can only be installed manually, so this would allow someone to install bsk_rl and then install bsk based on the error message as opposed to having to figure out why pip can’t find bsk on their own. Allows us to eventually put this on pypi without pip install being impossible without already having bsk.

@Mark2000 Mark2000 force-pushed the feature/89-check-bsk-version branch from 311007e to 372ed2e Compare December 6, 2023 22:54
@Mark2000
Copy link
Contributor Author

Mark2000 commented Dec 6, 2023

Somewhat annoyingly, pkg_resources is replaced with multiple newer packages that have less functionality; still better than deprecation warnings.

@Mark2000 Mark2000 merged commit ca37e48 into develop Dec 6, 2023
8 checks passed
@Mark2000 Mark2000 deleted the feature/89-check-bsk-version branch December 6, 2023 22:56
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.

Ensure BSK_RL is compatible with BSK installation
2 participants