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

update supported Python version #356

Merged
merged 4 commits into from
Sep 9, 2024
Merged

update supported Python version #356

merged 4 commits into from
Sep 9, 2024

Conversation

aormu
Copy link
Collaborator

@aormu aormu commented Aug 21, 2024

🗣 Description

Refresh Python dependencies.

💭 Motivation and context

Closes #321
Closes #326

🧪 Testing

Updated setup.py and requirements.txt and installed Python 3.10 locally on macOS. Run ScubaGoggles to validate there are no errors.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • If applicable, All future TODOs are captured in issues, which are referenced in the PR description.
  • The relevant issues PR resolves are linked preferably via closing keywords.
  • All relevant type-of-change labels have been added.
  • I have read and agree to the CONTRIBUTING.md document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge Checklist

  • This PR has been smoke tested to ensure main is in a functional state when this PR is merged.
  • Squash all commits into one PR level commit using the Squash and merge button.

✅ Post-merge Checklist

  • Delete the branch to clean up.
  • Close issues resolved by this PR if the closing keywords did not activate.

requirements.txt Outdated Show resolved Hide resolved
docs/installation/DownloadAndInstall.md Outdated Show resolved Hide resolved
@aormu aormu changed the title update doc to support Python 3.10.x update supported Python version Aug 22, 2024
@aormu aormu added the bug This issue or pull request addresses broken functionality label Aug 22, 2024
@aormu aormu added this to the Coast milestone Aug 22, 2024
@aormu aormu self-assigned this Aug 22, 2024
@adhilto
Copy link
Collaborator

adhilto commented Aug 22, 2024

Tests have been added and/or modified to cover the changes in this PR.

@mitchelbaker-cisa what implications does this PR have for the smoke test?

@mitchelbaker-cisa
Copy link
Collaborator

Tests have been added and/or modified to cover the changes in this PR.

@mitchelbaker-cisa what implications does this PR have for the smoke test?

Assuming pandas 2.x compatibility with Python 3.9+, there won't be any issues. However, the smoke test does uninstall numpy/install numpy v1.26.4 which should be removed if #326 is resolved by this PR.

This also incentives me to implement #340 so we can specify Python versions to test against.

@adhilto
Copy link
Collaborator

adhilto commented Aug 22, 2024

Tests have been added and/or modified to cover the changes in this PR.

@mitchelbaker-cisa what implications does this PR have for the smoke test?

Assuming pandas 2.x compatibility with Python 3.9+, there won't be any issues. However, the smoke test does uninstall numpy/install numpy v1.26.4 which should be removed if #326 is resolved by this PR.

This also incentives me to implement #340 so we can specify Python versions to test against.

Still need to do more testing, but the #326 should be resolved by this PR.

Copy link
Collaborator

@LaurenBassett LaurenBassett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Alden's comments, I think make those changes and it should be good to go.

@adhilto
Copy link
Collaborator

adhilto commented Aug 29, 2024

Quick update. I'm testing with the latest changes. scubagoggles gws ... works, but running it via python .\scuba.py gws gives me a ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import) . Still looking into it

@adhilto
Copy link
Collaborator

adhilto commented Aug 29, 2024

Quick update. I'm testing with the latest changes. scubagoggles gws ... works, but running it via python .\scuba.py gws gives me a ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import) . Still looking into it

@aormu Not sure why this wasn't a problem before, but this appears to stem from the fact that types is an existing Python module and conflicts with our types.py file. The fix is easy enough, we need to rename the types.py file (maybe "scuba_constants.py"), as well as all lines that import things from that file (the provider and reporter).

Copy link
Collaborator

@adhilto adhilto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bug, see the comment about circular dependencies (#356 (comment)).

Copy link
Collaborator

@adhilto adhilto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing performed:

  • On a Windows: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command
  • On a Windows: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command
  • On a Windows: install in a venv using the pip3 install -r requirements.txt Then run ScubaGoggles using the python3 scuba.py gws... command
  • On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command
  • On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command

Testing still needed on mac (@LaurenBassett I believe you can help with this). But as far as I can see, everything works as expected. @aormu I will approve once you address my remaining comment about the documentation.

Co-authored-by: Alden Hilton <106177711+adhilto@users.noreply.github.com>
@LaurenBassett
Copy link
Collaborator

Finished testing on Mac:
On a Mac: Run without the use of a virtual environment using python3 scuba.py gas <- circular import error
On a Mac: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command <- Circular import error
On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command <- Works just fine.

Overall seeing the same results on Mac as on other OS.

@adhilto
Copy link
Collaborator

adhilto commented Sep 4, 2024

Finished testing on Mac: On a Mac: Run without the use of a virtual environment using python3 scuba.py gas <- circular import error On a Mac: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command <- Circular import error On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command <- Works just fine.

Overall seeing the same results on Mac as on other OS.

Not a circular import error :(

Do you have the latest code? This commit fixed the circular import error on Windows.

@adhilto
Copy link
Collaborator

adhilto commented Sep 6, 2024

Finished testing on Mac: On a Mac: Run without the use of a virtual environment using python3 scuba.py gas <- circular import error On a Mac: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command <- Circular import error On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command <- Works just fine.
Overall seeing the same results on Mac as on other OS.

Not a circular import error :(

Do you have the latest code? This commit fixed the circular import error on Windows.

@LaurenBassett

@LaurenBassett
Copy link
Collaborator

Finished testing on Mac: On a Mac: Run without the use of a virtual environment using python3 scuba.py gas <- circular import error On a Mac: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the python3 scuba.py gws... command <- Circular import error On a Linux: install in a venv using the python3 -m pip install . Then run ScubaGoggles using the scubagoggles gws... command <- Works just fine.
Overall seeing the same results on Mac as on other OS.

Not a circular import error :(
Do you have the latest code? This commit fixed the circular import error on Windows.

@LaurenBassett

I thought I pulled the most recent when I had it. I can try again.

Copy link
Collaborator

@LaurenBassett LaurenBassett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed there's no longer a circular import on my Mac, going to go ahead and merge.

@adhilto adhilto merged commit 127bf6b into main Sep 9, 2024
5 of 8 checks passed
@adhilto adhilto deleted the python_321 branch September 9, 2024 15:43
@adhilto adhilto mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy 2.0 release breaks Pandas functionality Determine the minimum supported Python version
4 participants