From 28006d931b864f0201cec38428113355051655fd Mon Sep 17 00:00:00 2001 From: David Slusser Date: Mon, 15 Jan 2024 20:34:42 -0800 Subject: [PATCH] adding docs for coc, styleguide, etc. --- .github/CODE_OF_CONDUCT.md | 49 +++++++++++++ .github/CONTRIBUTING.md | 86 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/bug_report.md | 38 ++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 22 ++++++ .github/ISSUE_TEMPLATE/question.md | 17 +++++ .github/STYLE_GUIDE.md | 26 +++++++ .github/workflows/bandit.yaml | 1 + .github/workflows/black.yaml | 1 + .github/workflows/isort.yaml | 1 + .github/workflows/mypy.yaml | 1 + .github/workflows/ruff.yaml | 3 +- .github/workflows/safety.yaml | 1 + pyproject.toml | 32 ++++----- 13 files changed, 260 insertions(+), 18 deletions(-) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/STYLE_GUIDE.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..2ba5baa --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,49 @@ + +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at info@djangoaddicts.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at https://www.contributor-covenant.org/version/1/3/0/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..05691ea --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,86 @@ +# Contributing to django-pygwalker + +First off, thank you for considering contributing to django-pygwalker! + +The following is a set of guidelines for contributing to this project. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Table of Contents + +1. [Code of Conduct](#code-of-conduct) +2. [How Can I Contribute?](#how-can-i-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Suggesting Enhancements](#suggesting-enhancements) + - [Pull Requests](#pull-requests) +3. [Development Setup](#development-setup) +4. [Style Guide](#style-guide) +5. [License](#license) + +
+ +## Code of Conduct + +This project and everyone participating in it are governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [maintainer email]. + +
+ +## How Can I Contribute? + +### Reporting Bugs + +- Before creating bug reports, please check the [existing issues](https://github.com/djangoaddicts/django-pygwalker/issues) as you might find that the issue has already been reported. +- When creating a bug report, please include a clear and concise description of the problem and steps to reproduce it. + +### Suggesting Enhancements + +- Before creating enhancement suggestions, please check the [list of open issues](https://github.com/djangoaddicts/django-pygwalker/issues) as you might find that the suggestion has already been made. +- When creating an enhancement suggestion, please provide a detailed description and, if possible, an implementation proposal. + +### Pull Requests + +- Provide a clear and concise description of your pull request. +- Ensure you have tested your changes thoroughly. +- Add/update unittests as nessessary. +- Make sure code quaility tools run successfully. + + Merging contributions requires passing the checks configured with the CI. This includes running tests, linters, and other code quaility tools successfully on the currently officially supported Python and Django versions. + +
+ +## Development + +You can contribute to this project forking it from GitHub and sending pull requests. + +First [fork](https://help.github.com/en/articles/fork-a-repo) the +[repository](https://github.com/djangoaddicts/django-pygwalker) and then clone it: + +```shell +git clone git@github.com:/django-pygwalker.git +``` + +Create a virtual environment and install dependancies: + +```shell +cd django-pygwalker +python -m venv venv +source venv/bin/activate +pip install .[dev] +``` + +Unit tests are located under the tests directory and can be executed via pytest: + +```shell +pytest +``` + + +
+ +## Style Guide + +Follow the coding style outlined in [STYLE_GUIDE.md](STYLE_GUIDE.md). + +
+ +## License + +By contributing, you agree that your contributions will be licensed under the [GNU-3 license](../LICENSE). diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..29d2ed2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature Request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +## Feature Request + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..dcb4ed8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,17 @@ +--- +name: Question +about: Ask a question or seek clarification +title: '' +labels: '' +assignees: '' + +--- + +## Question + +**Describe your question or request for clarification** + +[Please provide as much detail as possible] + +**Additional context** +Add any other context or information relevant to your question. diff --git a/.github/STYLE_GUIDE.md b/.github/STYLE_GUIDE.md new file mode 100644 index 0000000..fbbfae4 --- /dev/null +++ b/.github/STYLE_GUIDE.md @@ -0,0 +1,26 @@ +# Project Style Guide + +This style guide outlines the coding conventions and formatting standards for the django-pygwalker Python codebase. + +
+ +## PEP 8 + +We adhere to the PEP 8 style guide, which is the style guide for Python code. Please make sure to familiarize yourself with PEP 8 guidelines: [PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/). + +
+ +## Line Length + +The maximum line length for code and comments is set to 120 characters. This allows for better readability without excessively long lines. + +
+ +## Code Formatting with Black + +We recommend using the `black` code formatter to ensure consistent and automatically formatted code. `black` is an opinionated code formatter that automatically formats your code in a consistent style. + +To install `black`, run the following command: + +```bash +pip install black diff --git a/.github/workflows/bandit.yaml b/.github/workflows/bandit.yaml index 8724ded..6de25e8 100644 --- a/.github/workflows/bandit.yaml +++ b/.github/workflows/bandit.yaml @@ -10,3 +10,4 @@ jobs: src: "django_project" options: "-c pyproject.toml -r" pip_install_command: "pip install .[dev]" + python_version: "3.11" diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml index 0c3f188..1e652b2 100644 --- a/.github/workflows/black.yaml +++ b/.github/workflows/black.yaml @@ -10,3 +10,4 @@ jobs: src: "django_project" options: "" pip_install_command: "pip install .[dev]" + python_version: "3.11" diff --git a/.github/workflows/isort.yaml b/.github/workflows/isort.yaml index b1065d2..c92beeb 100644 --- a/.github/workflows/isort.yaml +++ b/.github/workflows/isort.yaml @@ -8,3 +8,4 @@ jobs: - uses: davidslusser/actions_python_isort@v1.0.0 with: src: "django_project" + python_version: "3.11" diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 1466e82..a9015b0 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -10,3 +10,4 @@ jobs: src: "django_project" options: "-v" pip_install_command: "pip install -e .[dev]" + python_version: "3.11" diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index bcd69a4..7b9461e 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -9,4 +9,5 @@ jobs: uses: davidslusser/actions_python_ruff@v1.0.0 with: src: "django_project" - options: "-v" \ No newline at end of file + options: "-v" + python_version: "3.11" \ No newline at end of file diff --git a/.github/workflows/safety.yaml b/.github/workflows/safety.yaml index 0a47d7b..d1fcba5 100644 --- a/.github/workflows/safety.yaml +++ b/.github/workflows/safety.yaml @@ -9,3 +9,4 @@ jobs: with: options: "--debug" pip_install_command: "pip install -e .[dev]" + python_version: "3.11" diff --git a/pyproject.toml b/pyproject.toml index fd59566..64e69fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,8 +46,9 @@ dev = [ "typing_extensions", ] + [tool.bandit] -exclude_dirs = ["venv", "django_project/tests"] +exclude_dirs = ["venv", "django_project/tests", "django_project/*/management/commands"] [tool.black] @@ -70,27 +71,17 @@ omit = [ ] -[tool.flake8] -ignore = "E203,E266,H106,H904,E133" -max-line-length = 120 -max-complexity = 25 -hang-closing = true -exclude = "django_project/manage.py, django_project/*/scripts" - - -[tool.pylint.format] -max-line-length = "120" +[tool.isort] +profile = "black" -[tool.pylint.MASTER] -ignore-paths = ["django_project/manage.py", "django_project/tests", "django_project/storemgr/migrations", "django_project/*/scripts", "django_project/*/local_test"] -exit-zero = true -[tool.pylint.'MESSAGES CONTROL'] -disable = "R0903,R0913,R0901,W0613,W0718,C0114,C0115,C0103,R1725" +[tool.mypy] +exclude = ["venv/*", "^django_project/*/migrations/*"] +ignore_missing_imports = true [tool.pytest.ini_options] -addopts = "-s -v -x --strict-markers -m 'not extra' --cov=django_project" +addopts = "-s -v -x --strict-markers -m 'not extra'" testpaths = ["django_project"] filterwarnings = [ "ignore::DeprecationWarning", @@ -101,3 +92,10 @@ filterwarnings = [ [tool.ruff] line-length = 120 exclude = ["django_project/manage.py", "django_project/tests", "django_project/*/migrations", "django_project/*/scripts", "django_project/*/local_test"] + + +[tool.setuptools.packages.find] +where = ["."] +include = ["django_project"] +exclude = [] +namespaces = false