π§βπ»π€ Contributing to afk-botΒΆ
Hello from the SlickMLπ§ Team π and welcome to our contributing guidelines π€. Here we laid out the details of the development process based on our coding standards, and we hope these guidelines ease the process for you. Please feel free to apply your revisions if you did not find these guidelines useful.
π©ββοΈ Code of ConductΒΆ
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. By participating and contributing to this project, you agree to uphold our community standards π.
ππ Getting StartedΒΆ
Please note that before starting any major work, open an issue describing what you are planning to work on. The best way to start is to check the good-first-issue labelπ· on the issue board. In this way, the SlickML team members and other interested parties can give you feedback on the opened issue πββοΈ regarding the possible idea π‘, bug πͺ², or feature π§¬. Additionally, it will reduce the chance of duplicated work and it would help us to manage the tasks in a parallel fashion; so your pull request would get merged faster π π. Whether the contributions consist of adding new features, optimizing the code-base, or assisting with the documentation, we welcome new contributors of all experience levels. The SlickMLπ§ community goals are to be helpful and effective π.
π Coding StandardsΒΆ
Long time Pythoneer π Tim Peters succinctly channels the BDFLβs guiding principles for Pythonβs design into 20 aphorisms, only 19 of which have been written down as Zen of Python π§ββοΈ.
We try to follow Google Python Style Guide as much as possible.
We follow numpydoc style guidelines for docstrings π.
Every public and private function/method must have full type annotations (parameters + return type). Prefer precise types over
Any.Prefer keyword (named) arguments over positional calls.
π π₯· Environment ManagementΒΆ
To begin with, install a Python version >=3.10,<3.15.
All developments are done via uv. To begin with, first install
uvfollowing the installation documentation depending on your operating system.Once you setup your environment, to install the dependencies (
uv.lock), simply run πββοΈ:uv syncDocumentation build extras:
uv sync --group docs
We mainly use Poe the Poet, a pythonic task runner that works well with
uv. Install the CLI once πββοΈ:uv tool install poethepoet
To make sure your environment is setup correctly, simply run πββοΈ:
poe greetFor more options for task runners, simply run πββοΈ:
poe --help
π FormattingΒΆ
To ease the process and reduce headache πββοΈ, we have serialized the required formatting commands to save more time β°. To apply all the required
formattingsteps, simply run πββοΈ:poe formatFormatting uses
add-trailing-comma,isort(black profile), andblack(line-length = 100).
πͺ LintingΒΆ
To apply all the required
lintingsteps, simply run πββοΈ:poe checkpoe checkrunsblack --check,isort --check-only,flake8, andmypybehind the scenes.We use mypy with more specification laid out in
mypy.ini. To applymypyπββοΈ:poe mypyTo run lint + tests + build across supported Python versions, use tox (
tox.ini):poe tox
π§ͺ TestingΒΆ
We mainly use pytest, assertpy along with pytest-cov with more specification laid out in .coveragerc.
All unit-tests live in
tests/directory separated from the source code.All unit-test files should begin with the word
testi.e.test_foo.py.Our naming convention for naming tests is
test_<method_under_test>__<when>__<then>pattern which would increase the code readability.Prefer
assertpyover bareassertin tests.To run all unit-tests, simply run πββοΈ:
poe test
π DocumentationΒΆ
We follow numpydoc style guidelines for docstrings syntax, and best practices π.
Sphinx docs live under
docs/(same layout as slick-tune): pages indocs/pages/, config indocs/conf.py.Build HTML locally πββοΈ:
uv sync --group docs poe sphinx # open docs/_build/index.html
Keep the product overview in
README.md; keep contributor workflow details in this file.
π₯ Pull RequestsΒΆ
Please make sure to open an issue before starting major work and get core-team feedback.
Try to fix one bug or add one new feature per PR. This would minimize the amount of code changes and it is easier for code-review.
We recommend to follow Fork and Pull Request Workflow.
Fork our repository to your own Github account.
Clone the forked repository to your machine.
Create a branch locally; our naming conventions are
bugfix/the-bug-i-fixandfeature/the-new-feature-i-addfor bug fixes and new features, respectively.Please use present tense verbs for your commit messages i.e.
Fix bug ...,Add feature ..., and avoid using past tense verbs.Try to
rebasethe commits as much as possible to keep the git history clean.Follow the
formatting,linting, andtestingguidelines above (poe format,poe check,poe test).CI (GitHub Actions) runs the same gates β see
.github/workflows/ci.yml.Now, you are ready to push your changes to your forked repository.
Lastly, open a PR in our repository so that we can efficiently review the changes as soon as possible and get your feature/bug-fix merged.
Nicely done! You are all set! You are now officially part of afk-bot contributors.
β π π² Need Help?ΒΆ
Please join our Slack Channel to interact directly with the core team and our small community. This is a good place to discuss your questions and ideas or in general ask for help π¨βπ©βπ§ π« π¨βπ©βπ¦.