{"id":25030443,"url":"https://github.com/nextyfine-dev/python-setup","last_synced_at":"2025-03-30T19:26:21.211Z","repository":{"id":274859608,"uuid":"924292462","full_name":"nextyfine-dev/python-setup","owner":"nextyfine-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T19:04:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T21:59:58.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextyfine-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-01-29T18:43:10.000Z","updated_at":"2025-01-29T19:04:37.000Z","dependencies_parsed_at":"2025-01-29T20:29:36.785Z","dependency_job_id":null,"html_url":"https://github.com/nextyfine-dev/python-setup","commit_stats":null,"previous_names":["nextyfine-dev/python-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2Fpython-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2Fpython-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2Fpython-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2Fpython-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextyfine-dev","download_url":"https://codeload.github.com/nextyfine-dev/python-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246367659,"owners_count":20765914,"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":[],"created_at":"2025-02-05T22:00:12.075Z","updated_at":"2025-03-30T19:26:21.185Z","avatar_url":"https://github.com/nextyfine-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Project Setup\n\nThis project is a Python-based setup that includes various tools for code quality, testing, and development. It leverages the `pipenv` environment manager to handle dependencies, and integrates tools like `ruff` for linting, `mypy` for type-checking, `pytest` for testing, `black` for automatic code formatting, and `autopep8` for style fixes. Additionally, a file-watching script is included to automatically restart the server when changes are made to the codebase.\n\n## Project Structure\n\n```\n📂 src\n ┣ 📂 logs\n ┃ ┣ 📜 __init__.py\n ┃ ┗ 📜 logger.py\n ┃ ┣ 📜 __init__.py\n ┃ ┗ 📜 main.py\n ┣ 📂 tests\n ┣ 📜 .flake8\n ┣ 📜 .pre-commit-config.yaml\n ┣ 📜 Pipfile\n ┣ 📜 Pipfile.lock\n ┣ 📜 mypy.ini\n ┣ 📜 pyproject.toml\n ┣ 📜 requirements.txt\n ┗ 📜 watch.py\n```\n\n## Prerequisites\n\n1. **Python 3.12+**: This project is designed to work with Python 3.12 or newer.\n2. **pipenv**: The project uses `pipenv` for managing virtual environments and dependencies.\n\n## Setup\n\n### 1. Install Dependencies\n\nTo install the project dependencies, run the following command:\n\n```bash\npipenv install\n```\n\nThis will create a virtual environment and install the dependencies specified in the `Pipfile`.\n\n### 2. Activate the Virtual Environment\n\nActivate the virtual environment using:\n\n```bash\npipenv shell\n```\n\n### 3. Install Pre-Commit Hooks\n\nTo set up pre-commit hooks (such as `black`, `ruff`, etc.), run the following:\n\n```bash\npipenv run pre-commit install\n```\n\nThis will install the hooks defined in `.pre-commit-config.yaml`.\n\n## Available Scripts\n\nThe project includes several convenient scripts for running different tools:\n\n### 1. Start the Application\n\nTo start the application, use the following script:\n\n```bash\npipenv run start\n```\n\nThis will run the `main.py` file located in the `src` directory.\n\n### 2. Watch for File Changes\n\nTo automatically restart the server when files change, use the `watch` script:\n\n```bash\npipenv run watch\n```\n\nThis uses `watchdog` to monitor the `src` directory and restarts the server when changes are detected.\n\n### 3. Run Tests\n\nTo run the tests in the `tests` directory, use:\n\n```bash\npipenv run test\n```\n\nThis will execute the tests using `pytest`.\n\n### 4. Lint the Code\n\nTo lint the code using `ruff`, run:\n\n```bash\npipenv run lint\n```\n\nThis will check the code for style issues and automatically fix any issues it can find.\n\n### 5. Check Type Annotations\n\nTo check the type annotations with `mypy`, use:\n\n```bash\npipenv run typecheck\n```\n\nThis will verify that type hints are correct across the codebase.\n\n### 6. Auto-format Code\n\nTo auto-format your code using `black`, run:\n\n```bash\npipenv run format\n```\n\nThis will format the code according to `black`'s style guidelines.\n\n### 7. Auto-fix Style Issues\n\nTo fix styling issues using `autopep8`, run:\n\n```bash\npipenv run fix\n```\n\nThis will automatically fix minor style issues, such as indentation.\n\n### 8. Run All Checks\n\nTo run all the checks (linting, type-checking, testing, and formatting), use:\n\n```bash\npipenv run all-checks\n```\n\nThis will run all the checks in sequence, helping you maintain high-quality code.\n\n## Configuration Files\n\n### `.flake8`\n\nThis file contains configuration options for the `flake8` linter. It defines the rules for the linting process.\n\n### `.pre-commit-config.yaml`\n\nThis file contains the configuration for pre-commit hooks. It includes hooks for `black`, `ruff`, and other tools to ensure code quality before commits.\n\n### `mypy.ini`\n\nThis file configures `mypy` for type checking in the project. You can define specific type-checking rules here.\n\n### `pyproject.toml`\n\nThis file contains general project metadata and configuration options for tools like `black`.\n\n## Development Notes\n\n- To add new dependencies, use `pipenv install \u003cpackage_name\u003e`.\n- To update the dependencies, run `pipenv update`.\n- To remove a package, use `pipenv uninstall \u003cpackage_name\u003e`.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a feature branch (`git checkout -b feature-branch`).\n3. Commit your changes (`git commit -am 'Add new feature'`).\n4. Push to the branch (`git push origin feature-branch`).\n5. Create a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextyfine-dev%2Fpython-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextyfine-dev%2Fpython-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextyfine-dev%2Fpython-setup/lists"}