Thank you for considering reading this guide! Contributions are welcome :)
- Types of Contributions
- Contributor Setup
- Contributor Guidelines
- Contributor Testing
- Core Committer Guide
You can contribute in many ways:
Report bugs at https://github.com/boromir674/cookiecutter-python-package/issues.
Stmbling upon a Bug means encountering different behaviour than the expected/advertised one. When you are reporting a bug, please include the following infromation by filling in the template.
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- If you can, provide detailed steps to reproduce the bug.
- If you don't have steps to reproduce the bug, just note your observations in as much detail as you can. Questions to start a discussion about the issue are welcome.
Look through the GitHub issues for bugs. Anything tagged with "bug" is open to whoever wants to implement it. See Contributor Setup to get started.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "please-help" is open to whoever wants to implement it.
Please do not combine multiple feature enhancements into a single pull request.
See Contributor Setup to get started.
Cookiecutter Python Package could always use more documentation, whether as part of the official Cookiecutter Python Package docs, in docstrings, etc.
If you want to review your changes on the documentation locally, you can do:
python3 -m pip install --user tox
tox -e live-htmlThis will compile the documentation (into html) and start watching the files for changes, recompiling as you save. You can open it in your browser at http://127.0.0.1:8000 !
The best way to send feedback is to file an issue at https://github.com/boromir674/cookiecutter-python-package/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 :)
Here's how to set up cookiecutter-python-package for local development.
- Fork the
cookiecutter-python-packagerepo on GitHub. - Clone your fork locally:
git clone git@github.com:boromir674/cookiecutter-python-package.git- Install your local copy into a virtualenv. Assuming you have virtualenv installed, this is how you set up your fork for local development:
cd cookiecutter-python-package
virtualenv cookie-pypi --python=python3
source cookie-pypi/bin/activate
pip install -e .- Create a branch for local development:
git checkout -b name-of-your-bugfix-or-featureNow you can make your changes locally.
Probably, you should start by writting test case(s) and then the production code.
- When you're done making changes, check that your changes pass the tests locally.
Please install tox first:
python3 -m pip install --user toxFor a quick feedback loop run tests in dev setup, against your installed python version:
Assuming you are using python3.8:
tox -e py38-dev -vvRun all Test Suite under Python3.8 and test against different ways of doing a 'python installation':
tox -e py38 -vvFor more extensive testing, run the Test Suite against multiple python versions if they are found available on the host machine:
tox -vvFor checking against all of our Lint Rules, run:
tox -e lintFor refactoring the code to match all of our Lint Rules, run:
APPLY_LINT= tox -e lintFor checking compliance with Best Practises for Packaging Python code, run:
tox -e check- Ensure that your feature or commit is fully covered by tests. Check the coverage report that should be visible on the console when you run tox
You report will be placed to htmlcov directory. Please do not include this directory to your commits, accidentally.
- Commit your changes and push your branch to GitHub:
git add -p
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.
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- The pull request should be contained: if it's too big consider splitting it into smaller pull requests.
- If the pull request adds functionality, the docs should be updated.
- The pull request must pass all CI/CD jobs before being ready for review.
- If one CI/CD job is failing for unrelated reasons you may want to create another PR to fix that first.
- Single Responsibility of Units
- Modularity
- Compisition over Inheritance
Tox uses pytest under the hood, hence it supports the same syntax for selecting tests.
For further information please consult the pytest usage docs.
To run all tests using various versions of python in virtualenvs defined in tox.ini, just run tox:
toxTo run all tests using python 3.8:
tox -e py38To only run test cases matching the string 'smoke_test', using python 3.8:
tox -e py38 -k 'smoke_test'Core committers, use this section to:
- Guide your instinct and decisions as a core committer
- Limit the codebase from growing infinitely
- Provides a command-line utility that creates a Python Package Project
- Easy to use without having to think too hard
- Flexible for more complex use cases
- Easily extensible
- Modular API striving for statelessness
- Modular Design
- Aim for statelessness
Cookiecutter Python Package is designed to do one thing, and do that one thing very well.
- Cover the important use cases and as little as possible beyond that :)
- Generate Python Package's from the command-line or API, nothing more
- Cross-platform and cross-version support
- Aim for high test coverage and covering corner cases
- No pull requests will be accepted that drop test coverage on any platform
- Stable APIs that tool builders can rely on
How to prioritize pull requests, from most to least important:
- Fixes for broken tests. Broken means broken on any supported platform or Python version.
- Extra tests to cover corner cases.
- Minor edits to docs.
- Bug fixes.
- Major edits to docs.
- Features.
- Think carefully about the long-term implications of the change. How will it affect existing projects that are dependent on this? If this is complicated, do we really want to maintain it forever?
- Take the time to get things right, PRs almost always require additional improvements to meet the bar for quality. Be very strict about quality.
- When you merge a pull request take care of closing/updating every related issue explaining how they were affected by those changes. Also, remember to add the author to
AUTHORS.md.
If an issue is a bug that needs an urgent fix, mark it for the next patch release. Then either fix it or mark as please-help.
For other issues: encourage friendly discussion, moderate debate, offer your thoughts.
The roadmap located here
Due dates are flexible.
- Follow semantic versioning. Look at: http://semver.org