Please follow this workflow when contributing to skops:
- Fork the repository under your own user
- Clone the repository locally
- Create a new branch for your changes
- Add your changes to the branch
- Commit your changes
- Push your branch to the remote repository
- Create a pull request on GitHub
When creating a pull request, please use a descriptive title. You can prefix the title to indicate the type of it:
DOC
: documentation changesFEAT/FEA
: new major featuresENH
: enhancements to existing features with user facing implicationsCI
: continuous integration, sometimes overlaps with MNTMNT/MAINT
: maintenance, technical debt, etcFIX
: bug fixesTST
: new tests, refactoring testsPERF
: performance improvements
If a contributor forgets to prefix the title, a maintainer can add the prefix
when merging into main
. While merging, it is recommended that the
maintainer refines the commit message to add a short description of what the PR
being merged does.
Don't hesitate to ping @skops-dev/maintainers in your issues and pull requests if you don't receive a review in a timely manner. We try to review all pull requests as soon as we can.
If you have permissions, you should almost never merge your own pull request unless it's a hotfix and needs to be merged really quick and it's not a major change.
Otherwise pull requests can be merged if at least one other person has approved it on GitHub. Please don't merge them until all outstanding comments are addressed or the discussions are concluded and people have agreed to tackle them in future pull requests.
If you intend to work on an issue, leave a comment and state your intentions. Also feel free to ask for clarifications if you're not sure what the issue entails. If you don't understand an issue, it's on us, not on you!
Following these steps you can prepare a dev environment for yourself to contribute to skops.
mamba create -c conda-forge -n skops python=3.10
mamba activate skops
python -m pip install -e ".[tests,docs]"
# add pre-commit hooks
mamba install -c conda-forge pre-commit
pre-commit install
You can also replace the above mamba commands with conda if you don't have mamba installed.
skops uses pytest as its test runner, just run it from the project root:
pytest
Certain tests require internet access to run, and they typically take slightly
longer to run than other tests. If you'd like to skip those tests, you can add
-m not network
to your pytest
command, or -m network
to only run
those tests. For example, you can run all tests except the ones requiring
internet with:
pytest -m "not network" skops
Similarly, there is a flag, -m inference
for tests that hit the Hugging Face
Inference API, which can be quite slow or even hang. Skip these tests as long as
you don't make any changes to this functionality. If you already skip network
tests, the inference tests will also be skipped.
Releases are created using manual GitHub workflows. As a maintainer, follow these steps:
Check and update the
docs/changes.rst
For a major release, create a new branch with the name "0.version.X", e.g. "0.2.X". This branch will have all tags for all releases under 0.2.
Bump the version defined in
skops/__init__.py
Git grep for any TODO's that need fixing before the release (e.g. deprecations). You can do this, for example by:
git grep -n TODO
Create a PR with all the changes and have it reviewed and merged
Create a tag with the format "v0.version", e.g. "v0.2", and push it to the remote repository. Use this tag for releasing the package. If there is a minor release under the same branch, it would be "v0.2.1" for example.
Use the GitHub action to create a new release on TestPyPI. Check it for correctness on test.pypi.
Use the GitHub action to create a new release on PyPI. Check it for correctness pypi.
Create a new release on GitHub
Update the patch version of the package to a new dev version, e.g. from
v0.3.dev0
tov0.4.dev0
- Add a section for the new release in the
docs/changes.rst
file. - Check that the new stable branch of documentation was built correctly on readthedocs, and make sure all relevant releases are active.