Thank you for your interest in tools-python
. The project is open-source software, and bug reports, suggestions, and
most especially patches are welcome.
tools-python
has a project page on GitHub where you
can create an issue to report a bug, make a suggestion, or propose a
substantial change or improvement. You may also wish to contact the SPDX working group technical team through its
mailing list, [email protected].
If you would like to work on a fix for any issue, please assign the issue to yourself or write a comment indicating your intention prior to creating a patch.
We use the GitHub flow that is described here: https://guides.github.com/introduction/flow/
Here's the process to make changes to the codebase:
-
Find or file an issue you'd like to address. Every change should be made to fix or close an issue. Please try to keep issues reasonably small, focusing on one aspect, or split off sub-issues if possible. Large pull requests that fix many things at the same time tend to cause a lot of conflicts.
-
Review open pull requests before committing time to a substantial revision. Work along similar lines may already be in progress.
-
Fork the repository as described here and optionally follow the further steps described to sync your fork and the original repository.
-
Create a new branch in your fork and set up environment:
git checkout -b fix-or-improve-something python -m venv ./venv ./venv/bin/activate pip install -e ".[development]"
Note: By using the group
[development]
for the installation, all dependencies (including optional ones) will be installed. This way we make sure that all tests are executed. -
Make some changes and commit them to the branch:
git commit --signoff -m 'description of my changes'
Please sign off in each of your commits that you license your contributions under the terms of the Developer Certificate of Origin. Git has utilities for signing off on commits:
git commit -s
or--signoff
signs a current commit, andgit rebase --signoff <revision-range>
retroactively signs a range of past commits. -
Test your changes:
pytest -vvs # in the repo root
-
Check your code style. When opening a pull request, your changes will automatically be checked with
isort
,black
andflake8
to make sure your changes fit with the rest of the code style.# run the following commands in the repo root isort src tests black src tests flake8 src tests
black
andisort
will automatically format the code and sort the imports. The configuration for these linters can be found in thepyproject.toml
.flake8
lists all problems found which then need to be resolved manually. The configuration for the linter can be found in the.flake8
file. -
Push the branch to your fork on GitHub:
git push origin fix-or-improve-something
-
Make a pull request on GitHub.
-
Continue making more changes and commits on the branch, with
git commit --signoff
andgit push
. -
When done, write a comment on the PR asking for a code review.
-
Some other developer will review your changes and accept your PR. The merge should be done with
rebase
, if possible, or withsquash
. -
The temporary branch on GitHub should be deleted (there is a button for deleting it).
-
Delete the local branch as well:
git checkout master git pull -p git branch -a git branch -d fix-or-improve-something
The tests framework is using pytest:
pip install pytest
pytest -vvs