Closed
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Collaborator
Author
|
A common tool that is used for automating these tests and formatting rules is |
Collaborator
|
I tried the setup and activated my environment, and ran I'm getting errors like these, even though I have podman installed on my Intel MacBook Pro. Any clues why that would be happening? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds some extra tooling and introduces a change in how tests are conducted. The tooling introduced is:
To get started with this PR, all you need is
uv. After checking out this branch, you can runuv sync --all-groupswhich will create a virtual environment in the project directory. You can activate this virtual environment just like any otherpyenvorvirtualenvwithsource .venv/bin/activate(making sure to grab the right activation script if your default shell is notbash,sh, orzsh).All the tests that previously existed only within jupyter notebooks have been cloned as standard
pytesttests. These reside under thetest/directory. Each test will spin up a companion container with either podman or docker for the duration of the tests, so it's crucial that one of the two binaries is available. Furthermore, the interactions betweenfirefly_clientand the web browser have been mocked. You can run these tests withpytestwith no extra arguments, as all arguments are defined in thepyproject.tomlunder[tool.pytest.ini_options].Additionally,
toxhas been added for testing across python versions. To run these tests, use the commandtox- again with no added arguments. When you invoketoxit will leverageuvto install python versions 3.10-3.14 and then run thepytesttests against each version of python.Lastly, ruff was added and configured with sensible defaults for code quality. To ensure standard code formatting, you can run
ruff format, which will format all files (including the jupyter notebooks) following the PEP standards and the configuration stated in the[tool.ruff]sections of thepyproject.toml. To ensure standard linting and to stay up to date with general python code standards, you can also runruff checkto lint all files. This will output all linting errors, warnings, and suggestions. You may also useruff check --fixto automatically fix the linting rules that have auto-corrections. Note thatruff formatnorruff check --fixwill rewrite any logic. These commands will only modify the syntax of the code.Similarly to
condaandpip, one ready to release,uvprovides theuv buildanduv publishcommands for managing the package. A good place to begin exploringuvbeyond the documentation is by simply runninguv help.Disclaimer:
I made some minor modifications to the package. These changes were to support python type checking, as the codebase was failing
rufftype checks.Using Ruff:
Ruff can be added to your code editor, with extensions for NeoVim, VS Code, Sublime, and many other IDEs. With the Ruff tooling extensions, you will get live linting results as you code. This is the recommended way to work with Ruff.
Code Consistency Improvements:
examples/basic-demo-tableload.ipynb: Standardized the use of double quotes for strings and improved formatting for multi-line strings. [1] [2] [3] [4] [5] [6]examples/demo-3color.ipynb: Replaced single quotes with double quotes for strings and adjusted formatting for better readability. [1] [2] [3] [4] [5] [6]examples/demo-HiPS.ipynb: Updated string quotes to double quotes and reformatted code blocks for clarity. [1] [2] [3] [4] [5] [6] [7]examples/demo-advanced-all.ipynb: Changed single quotes to double quotes for strings and added spacing for improved readability. [1] [2]Build Process Update:
docs/Makefile: Modified theSPHINXBUILDcommand to useuv run sphinx-buildinstead ofsphinx-buildfor building documentation.