Table of Contents
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature_name). - Commit your Changes (
git commit -a -m "feat: a wonderful new feature"). - Push to the Branch (
git push origin feature_name). - Open a Pull Request.
This project (optionally) uses Python Semantic Release. To use this feature, please follow the commit message convention to ensure changes are correctly versioned in any future releases.
Cheat sheet:
- Patch release, backwards-compatible bug
fixin git commit message title.git commit -a -m "fix: a great fix"
- Minor release, backwards-compatible
featin git commit message title.git commit -a -m "feat: a wonderful new feature"
- Major release, incompatible API change
BREAKING CHANGEin git commit message footer (usefixorfeatfor message title).git commit -a -m "feat: total refactor" -m "BREAKING CHANGE: breaks api"
Update to reflect the new project's specific requirements!
The below instructions assume a virtual environment created from mayapy is being used for the project, for more info see: https://help.autodesk.com/view/MAYACRE/ENU/?guid=GUID-6AF99E9C-1473-481E-A144-357577A53717.
Project dependencies are available in the requirements.in file, which should be compiled with pip-tools.
- Install pip-tools:
pip install pip-tools
- Dependencies can be added to:
- requirements.in: User requirements.
- requirements-dev.in: Development requirements.
- requirements-test.in: Test requirements.
- Compile the requirement files as needed (below combines all three files into one
requirements.txt, however it's possible to have separate files for each):pip-compile --output-file requirements.txt requirements.in requirements-dev.in requirements-test.in
- Install dependencies:
- Windows:
-
pip-sync --python-executable %VIRTUAL_ENV%/scripts/python.exe requirements.txt
-
- Linux:
-
pip-sync --python-executable $VIRTUAL_ENV/bin/python.exe requirements.txt
-
- Windows:
Tests are written with Pytest and should adhere to the "Arrange, Act, Assert" pattern.
To run tests locally:
-
pytest
with coverage:
-
pytest --cov=src/
Static code analysis is performed with Pylint, formatting with Black format, and type hinting with mypy.
To run pylint locally:
-
pylint --rcfile=.pylintrc src/
- A modified .pylintrc file is provided with modifications to ignore Maya import errors. Append to this file as needed.
Black formater can be run locally with:
-
black src/
Run mypy checks locally with:
-
mypy src/
- A modified mypy.ini file is included with modifications to ignore Maya import errors. Append to this file as needed.
Documentation is built with mkdocs. To build the docs locally:
-
mkdocs build
To serve the docs locally:
-
mkdocs serve
Continuous integration is set up with GitHub Actions, workflows can be found in the .github/workflows directory. There are 2 main workflows:
- ci-main.yml: This workflow is intended to be a fast check to ensure the code is in a good state, and code standards are met. It runs automatically on every push and pull request to main or can be triggered from the
Run workflowbutton on the actions menu. It runs tests (if they exist), and performs linting, formatting, and type hinting checks. - ci-release.yml: This workflow will do all the above, create a release version of the repo and deploy the documentation to GitHub pages. It can be run from the
Run workflowbutton on the actions menu.
- Versions of Maya to test against can be specified in the reusable-maya-tests.yml file.
- The Maya tests workflow will only run if tests exist in the
testsdirectory, otherwise the CI will skip this workflow to avoid pulling the Maya Docker image unnecessarily.
- The Maya tests workflow will only run if tests exist in the
- Coding standards enforced with pylint, black, and mypy, with minimal configuration.
- Docs are built with mkdocs and deployed to GitHub pages: https://{{PROJECT_OWNER}}.github.io/{{PROJECT_NAME}}.


