Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report bugs at https://github.com/HDI-Project/MLBlocks/issues.
If you are reporting a bug, please include:
Your operating system name and version.
Any details about your local setup that might be helpful in troubleshooting.
Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.
MLBlocks could always use more documentation, whether as part of the official MLBlocks docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/HDI-Project/MLBlocks/issues.
If you are proposing a feature:
Explain in detail how it would work.
Keep the scope as narrow as possible, to make it easier to implement.
Remember that this is a volunteer-driven project, and that contributions are welcome :)
Ready to contribute? Here’s how to set up MLBlocks for local development.
Fork the MLBlocks repo on GitHub.
Clone your fork locally:
$ git clone email@example.com:your_name_here/MLBlocks.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv MLBlocks $ cd MLBlocks/ $ make install-develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
While hacking your changes, make sure to cover all your developments with the required unit tests, and that none of the old tests fail as a consequence of your changes. For this, make sure to run the tests suite and check the code coverage:
$ make test # Run the tests $ make coverage # Get the coverage report
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ make lint # Check code styling $ make test-all # Execute tests on all python versions
Make also sure to include the necessary documentation in the code as docstrings following the google docstring style. If you want to view how your documentation will look like when it is published, you can generate and view the docs with this command:
$ make viewdocs
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
It resolves an open GitHub Issue and contains its reference in the title or the comment. If there is no associated issue, feel free to create one.
Whenever possible, it resolves only one issue. If your PR resolves more than one issue, try to split it in more than one pull request.
The pull request should include unit tests that cover all the changed code
If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
The pull request should work for Python2.7, 3.4, 3.5 and 3.6. Check https://travis-ci.org/HDI-Project/MLBlocks/pull_requests and make sure that all the checks pass.
Unit Testing Guidelines¶
All the Unit Tests should comply with the following requirements:
Unit Tests should be based only in unittest and pytest modules.
The tests that cover a module called
mlblocks/path/to/a_module.pyshould be implemented in a separated module called
tests/mlblocks/path/to/test_a_module.py. Note that the module name has the
test_prefix and is located in a path similar to the one of the tested module, just inside te
Each method of the tested module should have at least one associated test method, and each test method should cover only one use case or scenario.
Test case methods should start with the
test_prefix and have descriptive names that indicate which scenario they cover. Names such as
test_some_method_timeoutare right, but names like
Each test should validate only what the code of the method being tested does, and not cover the behavior of any third party package or tool being used, which is assumed to work properly as far as it is being passed the right values.
Any third party tool that may have any kind of random behavior, such as some Machine Learning models, databases or Web APIs, will be mocked using the
mocklibrary, and the only thing that will be tested is that our code passes the right values to them.
Unit tests should not use anything from outside the test and the code being tested. This includes not reading or writting to any filesystem or database, which will be properly mocked.
To run a subset of tests:
$ pytest tests.test_mlblocks
The process of releasing a new version involves several steps combining both
bumpversion which, briefly:
Merge what is in
Update the version in
Create a new git tag pointing at the corresponding commit in
Merge the new commit from
Update the version in
mlblocks/__init__.pyto open the next development iteration.
Before starting the process, make sure that
HISTORY.md has been updated with a new
entry that explains the changes that will be included in the new version.
Normally this is just a list of the Pull Requests that have been merged to master
since the last release.
Once this is done, run of the following commands:
If you are releasing a patch version:
If you are releasing a minor version:
If you are releasing a major version:
Sometimes it is necessary or convenient to upload a release candidate to PyPi as a pre-release, in order to make some of the new features available for testing on other projects before they are included in an actual full-blown release.
In order to perform such an action, you can execute:
This will perform the following actions:
Build and upload the current version to PyPi as a pre-release, with the format
Bump the current version to the next release candidate,
After this is done, the new pre-release can be installed by including the
dev section in the
dependency specification, either in
install_requires = [ ... 'mlblocks>=X.Y.Z.dev', ... ]
or in command line:
pip install 'mlblocks>=X.Y.Z.dev'