{"id":20129333,"url":"https://github.com/aicore/template-pythonproject","last_synced_at":"2025-04-09T16:09:54.817Z","repository":{"id":37024252,"uuid":"359368269","full_name":"aicore/Template-PythonProject","owner":"aicore","description":"Template for python project","archived":false,"fork":false,"pushed_at":"2025-03-11T19:15:13.000Z","size":57,"stargazers_count":1,"open_issues_count":26,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T16:09:49.100Z","etag":null,"topics":["build-tool","python","template","template-project","unit-test"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aicore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-19T07:30:25.000Z","updated_at":"2024-03-31T18:30:29.000Z","dependencies_parsed_at":"2024-07-12T17:50:19.090Z","dependency_job_id":null,"html_url":"https://github.com/aicore/Template-PythonProject","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aicore%2FTemplate-PythonProject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aicore%2FTemplate-PythonProject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aicore%2FTemplate-PythonProject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aicore%2FTemplate-PythonProject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aicore","download_url":"https://codeload.github.com/aicore/Template-PythonProject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065283,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","python","template","template-project","unit-test"],"created_at":"2024-11-13T20:33:36.744Z","updated_at":"2025-04-09T16:09:54.791Z","avatar_url":"https://github.com/aicore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python template\n  * Click on [this link / Use This Template](https://github.com/aicore/Template-PythonProject/generate) button in the GitHub page above to  create a brand new python project with built in build and unit test system enabled.\n  * **TODO**: Edit this file for each project you create.\n\n## Building and testing\n### Prerequisites\n* Verify that Python-3 and pip3 should be installed in your system. terminal\u003e`pip3 -V`\n* Install pyb:  `pip3 install pybuilder`\n* Verify Pyb  installation :`pyb --version`\n```shell\n# If pyb command is not found, you will have to add pyb to path.\n# follow these instructions to add pyb to path.\n\n# for ubuntu/bash:\n\u003e echo 'export PATH=$PATH:/\u003cpath/to/pyb/bin\u003e' \u003e\u003e ~/.bashrc\n# this is usually /home/\u003chome folder\u003e/.local/bin \n\u003e source ~/.bashrc\n```\n\n### To build,clean and run tests, use the following command:\n#### Build and test\n```shell\npyb install_dependencies \n# Pyb should work without pyb install_dependencies, but unfortunately it doesnt.\n# See details: here https://github.com/pybuilder/pybuilder/issues/727 \npyb -v\n```\n* That's all you need to build the project.\n* Details about Test failures if any can be found in file `target\\reports\\unittest`\n* The binary artifacts will be available in the target folder.\n#### Running Integration Tests\n```shell\n# To skip integration tests during build use the below command\npyb -x run_integration_tests\n# To run only integration tests use the below command\npyb run_integration_tests -x run_unit_tests\n```\n\n#### Clean builds :\n* \u003e pyb clean\n  \n#### Reset environment :\n* \u003e pyb clean \u0026\u0026 rm -rf .pybuilder\n\n### working with the build system\n* Tutorial: https://pybuilder.io/documentation/tutorial\n* To make changes to build scripts see this: https://pythonhosted.org/pybuilder/walkthrough-new.html\n\n### Running Python Lint Checks \n* This project uses Flake8 as the default linter for coding style enforcement.  \n* Refer https://flake8.pycqa.org/en/latest/ for more details.\n* Before raising a pull request contributors are advised to run the below command locally to ensure there are no Flake8 warnings.\n```shell\n pyb analyze\n```\n* Please ensure build passes on running the above command without any warnings. Examples of Flake 8 warnings shown below:\n```shell\nE501 line too long (125 \u003e 120 characters)\nF403 'from local_settings import *' used; unable to detect undefined names\nF401 'django.contrib.auth.views as auth_views' imported but unused\n```\n\n## IDE/Editor setup\n### [Pycharm/intellij](https://www.jetbrains.com/pycharm/) \n Support is present in source. `.idea` files are avilable when you clone this repo. Just open the folder in pycharm.\n### Vim\n* Vim's config file is usually located in `~/.vimrc` . Locate the Vim rc file.\n* create/Append the file with this [config file](https://github.com/aicore/Template-PythonProject/blob/main/ideconfig/vimrc).\n\n## Project structure\n* Use `src/main/python/\u003cmodule\u003e` to add your python module.\n* Write unit tests in `src/unittest/` directory mirroring the same module structure in `src/main` directory.\n* The build artifacts can be found in `target` directory.\n\n## Adding dependencies\n* Dependencies are managed through the build.py file.\n* Refer https://pybuilder.io/documentation/plugins#installing-dependencies to see how this can be done.\n* After updating dependencies, run the following command.\n```shell\n pyb install_dependencies\n```\n\n## Writing tests\n* Write unit tests in `src/unittest/` directory mirroring the same module structure in `src/main` directory.\n* Use One of the two below supported testing suites.\n  - Python unit test framework : https://docs.python.org/3/library/unittest.html\n  - Mockito spying framewrk, see docs: https://mockito-python.readthedocs.io/en/latest/\n\nFollow the above two links on details on how to write tests.\n\n## Writing integration tests\n* Write integration tests in `src/integrationtest/python/` directory.\n* Integration test file names should end with `_tests.py`.\n* Refer https://pybuilder.io/documentation/plugins#running-python-integration-tests for more details.\n\n### Running tests with coverage\n* `pyb -v` runs unit tests as part of every build\n* Default coverage is set to 70%. To change the defaults, see https://pybuilder.io/documentation/plugins#measuring-unittest-coverage \n\n## Credits\n* We use pybuilder as the build tool.\n* https://www.youtube.com/watch?v=iQU18hAjux4\u0026\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faicore%2Ftemplate-pythonproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faicore%2Ftemplate-pythonproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faicore%2Ftemplate-pythonproject/lists"}