diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..bdd06bd --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.8 + uses: actions/setup-python@v3 + with: + python-version: "3.8" + + - name: Install dependencies + run: | + pip install -U pip + pip install . + pip install .[dev] + + - name: Test with pytest + run: PYTHONPATH=src pytest + + - name: Test Coverage + run: PYTHONPATH=src pytest --cov project_name diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6e4761 --- /dev/null +++ b/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..55e4b03 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,44 @@ +default_stages: [commit] + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + + - repo: https://github.com/asottile/pyupgrade + rev: v2.37.3 + hooks: + - id: pyupgrade + args: [--py38-plus] + + - repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black + + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + + - repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + args: ["--config=setup.cfg"] + additional_dependencies: [flake8-isort] + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.982 + hooks: + - id: mypy + additional_dependencies: [types-all] + +# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date +ci: + autoupdate_schedule: weekly + skip: [] + submodules: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..31f249e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 OpenPecha + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4b9a14 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ + +

+
+ OpenPecha +
+

+ + + +

Use this repo template for all new Python projects.

+ +## Description + +Project description goes here. + +## Project owner(s) + + + +- [@10zinten](https://github.com/10zinten) +- [@evanyerburgh](https://github.com/evanyerburgh) + +## Integrations + + + +None +## Docs + + + +Read the docs [here](https://wiki.openpecha.org/#/dev/coding-guidelines). diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/.nojekyll @@ -0,0 +1 @@ + diff --git a/docs/LICENSE.md b/docs/LICENSE.md new file mode 100644 index 0000000..7df6ac9 --- /dev/null +++ b/docs/LICENSE.md @@ -0,0 +1,22 @@ + +# MIT License + +Copyright (c) 2023 OpenPecha + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..aeb4a66 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,6 @@ + +# Project name + + + +_Short conceptual overview_ diff --git a/docs/_assets/favicon.ico b/docs/_assets/favicon.ico new file mode 100644 index 0000000..bd7c9d7 Binary files /dev/null and b/docs/_assets/favicon.ico differ diff --git a/docs/_assets/logo.png b/docs/_assets/logo.png new file mode 100644 index 0000000..764b699 Binary files /dev/null and b/docs/_assets/logo.png differ diff --git a/docs/_sidebar.md b/docs/_sidebar.md new file mode 100644 index 0000000..8ce5834 --- /dev/null +++ b/docs/_sidebar.md @@ -0,0 +1,6 @@ + +- [Overview](README.md) +- [Getting started](getting-started.md) +- [Reference](reference.md) +- [Help](help.md) +- [License](LICENSE.md) diff --git a/docs/background.md b/docs/background.md new file mode 100644 index 0000000..7c7558e --- /dev/null +++ b/docs/background.md @@ -0,0 +1,5 @@ + +# Background + +_Optional page_ + diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 0000000..1b81877 --- /dev/null +++ b/docs/examples.md @@ -0,0 +1,4 @@ + +# Examples + + diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..b5cde18 --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,29 @@ +# Getting started + +Intro + +## 1. Prerequisites + +- Python version +- _Dependency 1_ + +## 2. Installation + +1. _Write the step here._ +2. _Write the step here._ + +## 3. Configuration + +1. _Write the step here._ +2. _Write the step here._ + +## 4. Short how-to + +1. _Write the step here._ +2. _Write the step here._ + +## 5. Troubleshooting + +_Add any known issues and solutions_ + +Get more help [here](help.md). \ No newline at end of file diff --git a/docs/help.md b/docs/help.md new file mode 100644 index 0000000..9da8fa2 --- /dev/null +++ b/docs/help.md @@ -0,0 +1,6 @@ + +# Need help or have questions? + +- File an [issue](add link). +- Join our [Discord](https://discord.com/invite/7GFpPFSTeA) and ask there. +- Email us at openpecha[at]gmail[dot]com. diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..08ef899 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,45 @@ + + + + + Tool name + + + + + + + + + + +
+ + + + + + + + + + diff --git a/docs/reference.md b/docs/reference.md new file mode 100644 index 0000000..7dfb453 --- /dev/null +++ b/docs/reference.md @@ -0,0 +1,34 @@ + +# Reference + + + +Overview +## Main section (change title) + +## Reference articles + +- []() +- []() + + + +Overview +## Endpoints/library functions + + + +### Resource description + +### Endpoints and methods + +### Parameters + +### Request examples + +### Response examples and schema + +## Reference articles + +- []() +- []() diff --git a/non-coding-work-reports/2023-10-04.md b/non-coding-work-reports/2023-10-04.md new file mode 100644 index 0000000..61b2ec1 --- /dev/null +++ b/non-coding-work-reports/2023-10-04.md @@ -0,0 +1 @@ +Your non-coding work reports will go here diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a4cf13f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "project_name" +version = "0.0.1" +authors = [ + { name="OpenPecha", email="dev@openpecha.org" }, +] +description = "A small example package" +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.optional-dependencies] +dev = [ + "pytest", + "pytest-cov", + "pre-commit", +] + + +[project.urls] +"Homepage" = "https://github.com/OpenPecha/openpecha-project-template" +"Bug Tracker" = "https://github.com/OpenPecha/openpecha-project-template/issues" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..cf57192 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,31 @@ +[flake8] +max-line-length = 120 +exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv +per-file-ignores = __init__.py:F401 + +[pycodestyle] +max-line-length = 120 +exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv + +[isort] +line_length = 88 +known_first_party = bot +multi_line_output = 3 +default_section = THIRDPARTY +skip = venv/ +skip_glob = +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true + +[mypy] +python_version = 3.8 +exclude = test_*.py +check_untyped_defs = True +ignore_missing_imports = True +warn_unused_ignores = True +warn_redundant_casts = True +warn_unused_configs = True + +[coverage:run] +omit = tests/* diff --git a/src/project_name/__init__.py b/src/project_name/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/project_name/example.py b/src/project_name/example.py new file mode 100644 index 0000000..c929f88 --- /dev/null +++ b/src/project_name/example.py @@ -0,0 +1,2 @@ +def add_one(number): + return number + 1 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_example.py b/tests/test_example.py new file mode 100644 index 0000000..be899fd --- /dev/null +++ b/tests/test_example.py @@ -0,0 +1,5 @@ +from project_name.example import add_one + + +def test_add_one(): + assert add_one(1) == 2