From fcbf93041880a5fc426911d165c0e87a1f72efce Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 31 Dec 2023 20:05:58 +0100 Subject: [PATCH 1/2] Update pyproject.toml --- pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a720a63..2db9e00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ build-backend = "setuptools.build_meta" # Project settings ----------------------------------------------------------------------------------------------------- [project] name = "template" # Required -version = "0.0.0" # Required +dynamic = ["version"] description = "Ultralytics Template Python Package" # Optional readme = "README.md" # Optional requires-python = ">=3.8" @@ -75,8 +75,12 @@ tests = ["pytest"] # sample = "sample:main" # executes the function `main` from this package when "sample" is called. # Tools settings ------------------------------------------------------------------------------------------------------- -[tool.setuptools] # This is configuration specific to the `setuptools` build backend. +[tool.setuptools] # configuration specific to the `setuptools` build backend. +packages = { find = { where = ["."], include = ["template", "template.*"] } } package-data = { "sample" = ["*.yaml"] } +[tool.setuptools.dynamic] +version = { attr = "template.__version__" } + [tool.ruff] line-length = 120 From e2269de5ea967421f7899587d41edd8a382dca52 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 31 Dec 2023 20:07:17 +0100 Subject: [PATCH 2/2] Update pyproject.toml --- README.md | 6 +++--- template/README.md | 2 +- template/__init__.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7aeafcb..de3dd3a 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,9 @@ your-project/ โ””โ”€โ”€ README.md ``` -### Source Code in `src/` Directory ๐Ÿ“‚ +### Source Code in `src/` or `your_package_name/` Directory ๐Ÿ“‚ -The `src/` directory is the heart of your project, containing the Python code that constitutes your package. This structure encourages clean imports and testing practices. +The `src/` or `your_package_name/` directory is the heart of your project, containing the Python code that constitutes your package. This structure encourages clean imports and testing practices. ### Testing with the `tests/` Directory ๐Ÿงช @@ -61,7 +61,7 @@ To kickstart a new Python project with this template: 1. **Create Your New Repository**: Use this template to generate a new repository for your project. 2. **Customize the Template**: Tailor the template files like `requirements.txt`, `.pre-commit-config.yaml`, and GitHub workflow YAMLs to suit your project's needs. -3. **Develop Your Package**: Begin adding your code into the `src/` directory and corresponding tests in the `tests/` directory. +3. **Develop Your Package**: Begin adding your code into the `src/` or `your_package_name/` directory and corresponding tests in the `tests/` directory. 4. **Document Your Project**: Update the README and, if necessary, add documentation to the `docs/` directory. 5. **Continuous Integration**: Leverage the pre-configured GitHub Actions for automated testing and other CI/CD processes. diff --git a/template/README.md b/template/README.md index 7629f01..b0efe9b 100644 --- a/template/README.md +++ b/template/README.md @@ -1,7 +1,7 @@
-# Source Code Directory (`/template`) +# Source Code Directory (`src/` or `your_package_name/`) The root directory of this project serves as the container for the Python source code. diff --git a/template/__init__.py b/template/__init__.py index c36cab7..6c8e6b9 100644 --- a/template/__init__.py +++ b/template/__init__.py @@ -1 +1 @@ -__version__ == "0.0.0" +__version__ = "0.0.0"