Contributions#

Hi there! We’re thrilled that you’d like to contribute to this project. Your help is essential for keeping it great.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Overview#

The astro-provider-anyscale source code is available on this GitHub page

To contribute to the Astro Anyscale project:

  1. Please create a GitHub Issue describing your contribution.

  2. Open a feature branch off of the main branch and create a Pull Request into the main branch from your feature branch.

  3. Link your issue to the pull request.

  4. Once developments are complete on your feature branch, request a review and it will be merged once approved.

Test Changes Locally#

Pre-requisites#

  • pytest

pip install pytest

Run tests#

All tests are inside ./tests directory.

  • Just run pytest filepath+filename to run the tests.

Static Code Checks#

We check our code quality via static code checks. The static code checks in astro-provider-anyscale are used to verify that the code meets certain quality standards. All the static code checks can be run through pre-commit hooks.

Your code must pass all the static code checks in the CI in order to be eligible for Code Review. The easiest way to make sure your code is good before pushing is to use pre-commit checks locally.

Pre-Commit#

We use pre-commit to run a number of checks on the code before committing. To install pre-commit, run the following from your cloned astro-provider-anyscale directory:

pip install pre-commit
pre-commit install

To run the checks manually, run:

pre-commit run --all-files

For details on the pre-commit configuration, refer to the pre-commit config file.

For more details on each hook and additional configuration options, refer to the official pre-commit documentation: https://pre-commit.com/hooks.html

Writing Docs#

You can run the docs locally by running the following:

hatch run docs:serve

This will run the docs server in a virtual environment with the right dependencies. Note that it may take longer on the first run as it sets up the virtual environment, but will be quick on subsequent runs.

Building#

We use hatch to build the project. To build the project, run:

hatch build

Releasing#

We use GitHub actions to create and deploy new releases. To create a new release, first create a new version using:

hatch version minor

hatch will automatically update the version for you. Then, create a new release on GitHub with the new version. The release will be automatically deployed to PyPI.

Note

You can update the version in a few different ways. Check out the hatch docs to learn more.

To validate a release locally, it is possible to build it using:

hatch build

To publish a release to PyPI, use:

hatch publish