From b7df7c0dd51f150fe60578a8487d7871479e7951 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 12 Jun 2026 22:14:19 +0200 Subject: [PATCH] Update formatting, headers, and redirects --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/ISSUE_TEMPLATE/feature-request.yml | 2 +- README.md | 4 ++-- docs/README.md | 2 +- template/README.md | 6 +++--- tests/README.md | 2 +- tests/test_with_unittest.py | 5 ++++- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 8b6932f..7303578 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -97,6 +97,6 @@ body: label: Are you willing to submit a PR? description: > (Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/PROJECT_NAME/pulls) (PR) to help improve Ultralytics software for everyone, especially if you have a good understanding of how to implement a fix or feature. - See the Ultralytics [Contributing Guide](https://docs.ultralytics.com/help/contributing/) to get started. + See the Ultralytics [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started. options: - label: Yes I'd like to help by submitting a PR! diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index ac658a8..bd3374f 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -48,6 +48,6 @@ body: label: Are you willing to submit a PR? description: > (Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/PROJECT_NAME/pulls) (PR) to help improve Ultralytics software for everyone, especially if you have a good understanding of how to implement a fix or feature. - See the Ultralytics [Contributing Guide](https://docs.ultralytics.com/help/contributing/) to get started. + See the Ultralytics [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started. options: - label: Yes I'd like to help by submitting a PR! diff --git a/README.md b/README.md index 5d1cbcb..47ea9ba 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Welcome to the Ultralytics Python Project Template! This repository provides a s This template is meticulously organized for intuitive navigation and a clear understanding of project components. Familiarize yourself with the [Python project structure best practices](https://realpython.com/python-application-layouts/) to make the most of this layout. - `src/` or `your_package_name/`: Contains the core source code of your Python package, organized into modules. Using a `src` layout is a common practice detailed in [Python packaging guides](https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata). -- `tests/`: Dedicated directory for unit tests and integration tests, crucial for implementing [continuous testing](https://docs.ultralytics.com/help/CI/) practices. Consider using frameworks like [pytest](https://docs.pytest.org/en/stable/) for writing tests. +- `tests/`: Dedicated directory for unit tests and integration tests, crucial for implementing [continuous testing](https://docs.ultralytics.com/help/CI) practices. Consider using frameworks like [pytest](https://docs.pytest.org/en/stable/) for writing tests. - `docs/`: (Optional) Houses project documentation. Tools like [MkDocs](https://www.mkdocs.org/) can be used to generate comprehensive documentation from this directory. - `pyproject.toml`: The standard configuration file for Python projects, detailing dependencies, build system requirements, formatting rules, and packaging information as specified by [PEP 518](https://peps.python.org/pep-0518/) and subsequent PEPs. - `.gitignore`: Configured to exclude unnecessary files (like `*.pyc` or virtual environment directories) from [Git](https://git-scm.com/) tracking. @@ -96,7 +96,7 @@ Ultralytics thrives on community collaboration, and we deeply value your contrib - **Reporting Issues**: Encounter a bug? Please report it on [GitHub Issues](https://github.com/ultralytics/template/issues). - **Feature Requests**: Have an idea for improvement? Share it via [GitHub Issues](https://github.com/ultralytics/template/issues). -- **Pull Requests**: Want to contribute code? Please read our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) first, then submit a Pull Request. +- **Pull Requests**: Want to contribute code? Please read our [Contributing Guide](https://docs.ultralytics.com/help/contributing) first, then submit a Pull Request. - **Feedback**: Share your thoughts and experiences by participating in our official [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A heartfelt thank you 🙏 goes out to all our contributors! Your efforts help make Ultralytics tools better for everyone. diff --git a/docs/README.md b/docs/README.md index c86da7b..b556295 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,4 +29,4 @@ The documentation should be continuously updated alongside the project's develop ## 🙌 Contributing -Contributions to improve the documentation are welcome! Whether it's fixing typos, clarifying explanations, adding examples, or translating content, your help is valuable. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for more details on how to get started. You can also find helpful [tips for contributing to Ultralytics open-source projects](https://www.ultralytics.com/blog/tips-to-start-contributing-to-ultralytics-open-source-projects) on our blog or ask questions on the [Ultralytics Community Forums](https://community.ultralytics.com/). +Contributions to improve the documentation are welcome! Whether it's fixing typos, clarifying explanations, adding examples, or translating content, your help is valuable. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for more details on how to get started. You can also find helpful [tips for contributing to Ultralytics open-source projects](https://www.ultralytics.com/blog/tips-to-start-contributing-to-ultralytics-open-source-projects) on our blog or ask questions on the [Ultralytics Community Forums](https://community.ultralytics.com/). diff --git a/template/README.md b/template/README.md index 13b7e92..bef027a 100644 --- a/template/README.md +++ b/template/README.md @@ -10,16 +10,16 @@ Our project follows a clean and organized structure to promote maintainability a - **Root Organization**: Python [modules and sub-packages](https://docs.python.org/3/tutorial/modules.html) are organized directly within this root source directory. - **Dedicated Folders**: Each significant feature or component typically resides in its own dedicated folder (sub-package) or file (module). -- **Configuration**: The [`pyproject.toml`](https://packaging.python.org/en/latest/specifications/pyproject-toml/) file, located at the project's root (outside this source directory), defines packaging, dependencies, and project metadata according to [PEP 621](https://peps.python.org/pep-0621/). You can find details on Ultralytics configuration options in our [docs](https://docs.ultralytics.com/usage/cfg/). +- **Configuration**: The [`pyproject.toml`](https://packaging.python.org/en/latest/specifications/pyproject-toml/) file, located at the project's root (outside this source directory), defines packaging, dependencies, and project metadata according to [PEP 621](https://peps.python.org/pep-0621/). You can find details on Ultralytics configuration options in our [docs](https://docs.ultralytics.com/usage/cfg). ## 📝 Guidelines To ensure code quality, consistency, and collaboration, please adhere to the following guidelines: - **Documentation**: Write clear, concise docstrings and comments. Consider using tools like [Sphinx](https://www.sphinx-doc.org/en/master/) or [MkDocs](https://www.mkdocs.org/) for generating comprehensive documentation, similar to the main [Ultralytics Docs](https://docs.ultralytics.com/). -- **Coding Standards**: Follow established Python best practices, primarily [PEP 8](https://peps.python.org/pep-0008/), and align with Ultralytics' internal coding conventions and [Code of Conduct](https://docs.ultralytics.com/help/code-of-conduct/). +- **Coding Standards**: Follow established Python best practices, primarily [PEP 8](https://peps.python.org/pep-0008/), and align with Ultralytics' internal coding conventions and [Code of Conduct](https://docs.ultralytics.com/help/code-of-conduct). - **Modularity**: Design components to be modular and reusable. Introduce new modules or packages logically as the project evolves. - **Testing**: Implement thorough unit and integration tests using frameworks like [`pytest`](https://docs.pytest.org/en/stable/). Rigorous testing is crucial for verifying functionality, performance, and preventing regressions. Explore [continuous integration (CI)](https://www.ultralytics.com/glossary/continuous-integration-ci) practices. - **Dependencies**: Manage dependencies explicitly via `pyproject.toml`. Avoid unnecessary dependencies. -We encourage contributions! If you have suggestions or improvements, please refer to our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) and feel free to open an issue or pull request on the [Ultralytics GitHub](https://github.com/ultralytics). +We encourage contributions! If you have suggestions or improvements, please refer to our [Contributing Guide](https://docs.ultralytics.com/help/contributing) and feel free to open an issue or pull request on the [Ultralytics GitHub](https://github.com/ultralytics). diff --git a/tests/README.md b/tests/README.md index fb9dc7b..c89197a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -47,4 +47,4 @@ If you prefer to avoid installing external dependencies, you can use Python's st ## ✨ Contributing -We love contributions! If you find an issue or have an idea for improving the tests, please feel free to create an issue or submit a pull request. See our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for more details on how to get started. +We love contributions! If you find an issue or have an idea for improving the tests, please feel free to create an issue or submit a pull request. See our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for more details on how to get started. diff --git a/tests/test_with_unittest.py b/tests/test_with_unittest.py index a8148b4..ea5764b 100644 --- a/tests/test_with_unittest.py +++ b/tests/test_with_unittest.py @@ -1,11 +1,13 @@ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license import unittest + from template.module1 import add_numbers, main + class TestModule1(unittest.TestCase): """Test cases for module1 functions.""" - + def test_add_numbers(self) -> None: """Tests add_numbers function with positive and negative integers.""" self.assertEqual(add_numbers(2, 3), 5) @@ -16,5 +18,6 @@ def test_main(self) -> None: """Tests main function executes without errors.""" main() + if __name__ == "__main__": unittest.main()