{"id":26924974,"url":"https://github.com/sinkukumar/pybasedeprecated","last_synced_at":"2025-04-02T02:20:18.267Z","repository":{"id":281129130,"uuid":"944299088","full_name":"SinkuKumar/PyBaseDeprecated","owner":"SinkuKumar","description":"A minimal, Python repository template with .gitignore, .vscode extensions, code formatter and linter.","archived":false,"fork":false,"pushed_at":"2025-03-11T10:56:54.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T09:25:23.397Z","etag":null,"topics":["github","python","template-repo","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SinkuKumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2025-03-07T05:34:41.000Z","updated_at":"2025-04-01T08:00:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fe6cc11-a575-4579-8aea-84f1020d634d","html_url":"https://github.com/SinkuKumar/PyBaseDeprecated","commit_stats":null,"previous_names":["sinkukumar/pybase"],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinkuKumar%2FPyBaseDeprecated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinkuKumar%2FPyBaseDeprecated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinkuKumar%2FPyBaseDeprecated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SinkuKumar%2FPyBaseDeprecated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SinkuKumar","download_url":"https://codeload.github.com/SinkuKumar/PyBaseDeprecated/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741280,"owners_count":20826096,"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":["github","python","template-repo","vscode","vscode-extension"],"created_at":"2025-04-02T02:20:15.472Z","updated_at":"2025-04-02T02:20:17.089Z","avatar_url":"https://github.com/SinkuKumar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyBase\n\nA minimal, Python repository template with .gitignore, .vscode extensions, code formatter and linter.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://s3.dualstack.us-east-2.amazonaws.com/pythondotorg-assets/media/community/logos/python-logo-only.png\" alt=\"Python Logo\" height=\"100\"\u003e\n  \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\n  \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Visual_Studio_Code_1.35_icon.svg/480px-Visual_Studio_Code_1.35_icon.svg.png\" alt=\"VS Code Logo\" height=\"100\"\u003e\n\u003c/p\u003e\n\n## VS Code Configuration for Python Development\n\nThis repo includes a recommended set of VS Code extensions and settings to enhance Python development.\n\n## 📦 Recommended Extensions\n\nTo ensure a smooth development experience, install the following extensions by adding them to your `.vscode/extensions.json` file:\n\n```json\n{\n  \"recommendations\": [\n    \"ms-python.isort\", // Sorts Python imports automatically\n    \"ms-python.flake8\", // Linter for enforcing code quality\n    \"ms-python.python\", // Core Python extension for VS Code\n    \"ms-python.pylint\", // Another Python linter\n    \"ms-python.debugpy\", // Debugging support for Python\n    \"yzane.markdown-pdf\", // Converts Markdown to PDF\n    \"ms-toolsai.jupyter\", // Jupyter Notebook support\n    \"qwtel.sqlite-viewer\", // View SQLite databases\n    \"ritwickdey.liveserver\", // Live server for web development\n    \"ms-python.vscode-pylance\", // Python language server\n    \"ms-toolsai.jupyter-keymap\", // Key bindings for Jupyter\n    \"ms-python.black-formatter\", // Black code formatter\n    \"ms-toolsai.jupyter-renderers\", // Jupyter notebook renderers\n    \"ms-toolsai.vscode-jupyter-slideshow\", // Jupyter slideshow support\n    \"ms-toolsai.vscode-jupyter-cell-tags\" // Jupyter cell tagging\n  ]\n}\n```\n\n## ⚙️ VS Code Settings\n\nTo maintain consistent formatting and linting, use the following settings in `.vscode/settings.json`:\n\n```json\n{\n  \"[python]\": {\n    \"editor.defaultFormatter\": \"ms-python.black-formatter\", // Use Black for formatting\n    \"editor.formatOnSave\": true // Auto-format on save\n  },\n  \"black-formatter.args\": [\"--line-length\", \"200\"],\n  \"flake8.args\": [\"--max-line-length=200\"],\n  \"pylint.args\": [\"--max-line-length=200\"],\n  \"editor.formatOnSave\": true,\n  \"editor.formatOnPaste\": true,\n  \"diffEditor.codeLens\": true, // Show inline code lens in diff view\n  \"editor.codeActionWidget.includeNearbyQuickFixes\": true // Enable quick fixes\n}\n```\n\n---\n\nThis setup ensures consistent formatting, efficient linting, and an improved development workflow. 🚀\n\n# Deployment\n\n## Project Setup\n\n### 1. Use Git Template\n\nAlways use the Git template repository to create your project. It contains the necessary template code required for developing automation scripts. You can access it here: [PyBase GitHub Repository](https://github.com/Graphxsys/PyBase).\n\n### 2. Set Up a Virtual Environment\n\nTo develop your script, always create a new virtual environment using Python **3.10.11**, as this is the version used in the production server.\n\n#### Steps to Set Up the Virtual Environment:\n\n```sh\npython3 -m venv venv\nsource venv/bin/activate  # For macOS/Linux\nvenv\\Scripts\\activate     # For Windows\n```\n\nOnce the virtual environment is activated, install the required dependencies:\n\n```sh\npip install -r requirements.txt\n```\n\n### 3. Install and Manage Dependencies\n\nDuring development, use `pip` to install additional packages. Before pushing changes to GitHub, update the `requirements.txt` file:\n\n```sh\npip freeze \u003e requirements.txt\n```\n\nThis ensures that all required dependencies are stored and can be installed in production.\n\n## Deployment Setup\n\n### 1. Prepare `deployment.yaml`\n\nBefore deploying the script, ensure your `deployment.yaml` file is available at the root of the project. This file specifies the necessary environment variables and deployment settings.\n\nExample `deployment.yaml` format:\n\n```yaml\nrepo_url: \"https://github.com/SinkuKumar/CI-CD-Python.git\"\nbranch: \"main\"\ncommit_hash: \"\"\nlocal_dir: \"./Users/Sinku/Desktop/Deployment\"\nexclude_ext: \".ipynb\"\n\nenv:\n  # SMTP Server Credentials\n  SMTP_ADDRESS: \"smtp.abc.com\"\n  SMTP_PORT: 587\n  SMTP_ACCOUNT: \"email@graphxsys.com\"\n  SMTP_PASSWORD: \"password\"\n\n  # SQL Server Credentials\n  SQL_SERVER: \"127.0.0.1\"\n  SQL_DATABASE: \"CI_CD\"\n  SQL_USERNAME: \"sa\"\n  SQL_PASSWORD: \"Password@123\"\n```\n\n### 2. Push Changes to GitHub\n\nTo commit and push your changes, use the following commands:\n\n```sh\ngit add .\ngit commit -m \"Your commit message\"\ngit pull\ngit push\n```\n\n### 3. Trigger Deployment\n\nOnce the code is pushed to GitHub, trigger the deployment script by running:\n\n```sh\npython utils/deployment.py\n```\n\n## Rollback to a Previous Commit\n\nIf you encounter an issue after deployment, you can revert to a previous commit using `git log`, which provides commit history.\n\nExample:\n\n```sh\n(venv) Sinku@Macbook4 CI-CD-Python % git log\ncommit f96b8b261cf08040c023e2328366dfb751404629 (HEAD -\u003e main, origin/main, origin/HEAD)\nAuthor: SinkuKumar \u003csudosinku@gmail.com\u003e\nDate:   Tue Mar 11 14:32:25 2025 +0530\n\n    Add deployment configuration and enhance deployment functionality\n```\n\nTo deploy a specific commit, update the `commit_hash` in `deployment.yaml` and redeploy the script. This ensures that your project rolls back to the desired checkpoint.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinkukumar%2Fpybasedeprecated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinkukumar%2Fpybasedeprecated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinkukumar%2Fpybasedeprecated/lists"}