pyomeca project page and hit the Fork
button. You will want to clone your fork to your machine:
git clone https://github.com/your-user-name/pyomeca.git
cd pyomeca
git remote add upstream https://github.com/pyomeca/pyomeca.git
Before starting any development, you’ll need to create an isolated pyomeca development environment:
cd
to the pyomeca source directoryconda env create
conda activate pyomeca
pip install -r requirements-dev.txt
You want your master branch to reflect only production-ready code, so create a feature branch for making your changes. For example:
git branch -b new-feature
Keep any changes in this branch specific to one bug or feature so it is clear what the branch brings to pyomeca.
Adding tests is required if you add or modify existing codes in pyomeca. Therefore, it is worth getting in the habit of writing tests ahead of time so this is never an issue. The pyomeca test suite runs automatically on GitHub Actions, once your pull request is submitted. However, we strongly encourage running the tests prior to submitting the pull request. To do so, run make test
or simply pytest tests
.
Pyomeca uses several tools to ensure a consistent code format throughout the project. The easiest way to use them is to run make lint
from the source directory.
When you want your changes to appear publicly on your GitHub page, push your forked feature branch’s commits:
git push origin new-feature
If everything looks good, you are ready to make a pull request. This pull request and its associated changes will eventually be committed to the master branch and available in the next release.
Pull Request
buttonFiles Changed
to make sure everything looks OKSend Pull Request
This request then goes to the repository maintainers, and they will review the code. If you need to make more changes, you can make them in your branch, add them to a new commit and push them to GitHub. The pull request will be automatically updated.
PR Checklist
Let's summarize the steps needed to get your PR ready for submission.
Use an isolated Python environment.
Properly test your code. Write new tests if needed and make sure that your modification didn't break anything by running make test
.
Properly format your code. You can verify that it passes the formatting guidelines by running make lint
.
Push your code and create a PR.
Properly describe your modifications with a helpful title and description. If this addresses an issue, please reference it.