Developers can use hatch to simplify set up of a pyosMeta development environment and executing development tasks.
- Follow the hatch installation instructions.
- Open a new terminal and run
hatch --version
to verify thathatch
is available.
In a terminal, enter:
hatch shell
You will now have an activated virtual environment.
To learn more about working with Hatch environments, check out this tutorial which explains how hatch uses environments.
To deactivate an environment, enter:
deactivate
We use Hatch scripts to automate workflows. 🚀
To run tests there is a single hatch environment parsed with three script options that you can chose to run.
-
To run only tests with a code coverage report out in the terminal use:
hatch run test:run-coverage
-
To run tests without code coverage report outs use:
hatch run test:run-no-cov
-
To run tests with an xml report generated use:
hatch run test:run-report
The hatch run-report script is the script used in our CI tests action.
To modify how scripts are run, you can look at this section in our pyproject.toml file:
[tool.hatch.envs.test.scripts]
run-coverage = "pytest --cov-config=pyproject.toml --cov=pyosmeta --cov=tests/*"
run-no-cov = "run-coverage --no-cov"
run-report = "run-coverage --cov-report=xml:coverage.xml"
pyosMeta uses hatch and hatchling as its build back end.
To create a local sdist and wheel, run:
hatch build